Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I created an empty web api project (without authentication) and made my controllers and Database.

Now i want to make google authentication, what should i do? All the data online shows how to do google authentication if u created a project with authorization ticked. So can u tell me how to start?


What I have tried:

I copied the Startup.Auth from another project ( i don't know if what i'm doing is correct

but when i run this link
api/Account/ExternalLogins?returnUrl=%2F&generateState=true


i get error object reference null on this line
private IAuthenticationManager Authentication
{
    get { return Request.GetOwinContext().Authentication; }
}
Posted
Updated 21-May-20 15:39pm

1 solution

I would probably start a new project, getting all of the authentication in and then migrate the code from your current application.

I would recommend reading through the following links to MS Docs, and then go step by step once you understand what all will need to be done
Facebook, Google, and external provider authentication in ASP.NET Core | Microsoft Docs[^]
Google external login setup in ASP.NET Core | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900