'ASP.NET Web API Google OAuth keep return "Access Denied"
I need to integrate my ASP.NET Web API with Google and Facebook OAuth. I was following all the steps from https://bitoftech.net/2014/08/11/asp-net-web-api-2-external-logins-social-logins-facebook-google-angularjs-app/ but no luck..
Every time I login to my Google Account, it always returns an "Access denied" xml page.
I believe there is something wrong with my code, not my Google OAuth 2.0 Client IDs since I downloaded Taiseer's sample code and run it on my localhost and it succeed to authenticate my Google account.
But no idea why in my code it doesn't work. Desperately need some advice.
Solution 1:[1]
I solved my problem. The issue coming from Microsoft.Owin.Security.Google library. I was using version 3.0.1 but after I update to the newest version, boom... Voila! It works..
Solution 2:[2]
I got this error "access_denied" also, because I hadnt added my google email to the list of Test Users in the google developer console, under OAuth consent screen.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Oscar |
Solution 2 | Vandana Chadha |