Intermittent ASP.NET oAuth issue with Google, AuthenticationManager.GetExternalIdentityAsync is returning null

后端 未结 7 1630
北海茫月
北海茫月 2020-12-29 23:37

I am trying to fix an intermittent issue when using Google as an external login provider.

When attempting to login, the user is redirected back to the login page ra

7条回答
  •  滥情空心
    2020-12-30 00:16

    I got this problem yesterday and I was COMPLETELY STUCK ! And, as you described, I got it just like that with no reason.

    I managed to fix it (after hours of comparing 2 projects - 1 test project that worked no problem every time and another that was a more serious project - and they had the exact same code, but different dll versions)

    The problem was with the DLLs - the referenced packages from Nuget. Make sure you have the latest packages and also check the runtime section in your web.config.

    After I updated all Owin related packages and Microsoft.Owin and added:

    
      
        
        
      
      
        
        
      
      
        
        
      
      
        
        
      
    
    

    ... it worked again ! They might vary based on your used packages, but that's how it worked for me.

提交回复
热议问题