ASP.NET Core Identity is a membership system that adds login functionality to ASP.NET Core apps.
Below you will find the instructions, step-by-step to configure the following external login provider in your development environment.
- Log In to Facebook using your account
- Go to All Apps - Facebook for Developers
- In the upper right corner, select My Apps and then click on Create App
- Fill the fields Display Name and Contact Email then click Create App ID
- You will see in the Dashboard a list of Products that you can add, we're going to configure Facebook Login, so, click on the Set Up button for that product
- On the menu on the left, under Facebook Login, click on Settings. Under the Client OAuth Settings, there is a field called Valid OAuth Redirect URIs, where you have to put the URL of the project, eg. https://localhost:5001/, and then click on the Save Changes button.
- On the menu on the left, under Settings, click on Basic, you will see the Facebook App ID and App Secret, necessary to configure the Authentication in the project, copy them, you will need it in next step.
- In the Web project go to the file appsettings.Development.json go to the Facebook object, under Authentication, paste the App ID, and App Secret copied in the previous step.
- Run the project and Log In using Facebook.
-
Log In to Microsoft Azure Portal using your Microsoft account
-
Go to App registrations
-
In the upper left corner, select New registration, now we need to fill the basic information about the application:
-
Fill the Name field for the application name, eg.: Emplea.do.
-
For Supported account types choose Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox), this will allow to login anyone with a Microsoft account.
-
For Redirect URI we need to use: https://localhost:5001/signin-microsoft, in the Development Environment this is the local URL that the projects use, appending the 'signin-microsoft' that identifies the login provider, in this case, Microsoft.
-
Click the Register button.
-
-
In the left menu, select Certificates & secrets, under Client secrets:
- Click the New client secret button.
- Add a Description for the new client secrete, eg.: ClientSecret
- Select when this secret Expires, eg.: In 1 year
This will generate a new client secret, copy the value we will need it.
-
In the left menu, go to the application Overview, there you will see the Application (client) ID, copy it, we will need it in the next step.
-
Back in our Emplea.do Web project go to the file appsettings.Development.json to the Microsoft object under Authentication and paste the App ID and App Secret copied in the previous steps.
- Run the project and Log In using Microsoft.
-
Log In to LinkedIn using your account
-
Go to Developers | Linkedin and click in the Create app button
-
We need to fill the basic information about the application:
-
Go to the Auth tab, in the OAuth 2.0 settings add https://localhost:5001/signin-github in the Redirect URLs. From the Application credentials section copy the Client ID and the Client Secret, we will need it in the next step.
-
Go to he Products tab, Select the product Sign In with LinkedIn, in almost 2 minutes they will approve your application.
-
Back in our Emplea.do Web project go to the file appsettings.Development.json to the Linkedin object under Authentication and paste the ClientId and ClientSecret copied in the previous steps.
-
Run the project and Log In using LinkedIn.
-
Log In to GitHub using your account
-
Go to New OAuth Application
-
We need to fill the basic information about the application:
-
Set the Application Name, eg.: Emplea.do.
-
Homepage URL: https://localhost:5001
-
For Authorization callback URL we need to use: https://localhost:5001/signin-github, in the Development Environment this is the local URL that the projects use, appending the 'signing-github' that identifies the login provider, in this case, GitHub.
-
Click the Register Application button.
-
-
Copy the Client ID and Client Secret, we will need it in the next step.
-
Back in our Emplea.do Web project go to the file appsettings.Development.json to the Github object under Authentication and paste the ClientId and ClientSecret copied in the previous steps.
-
Run the project and Log In using GitHub.
-
Log In to Google using your account
-
Go to Integrating Google Sign-In into your web app and click in the Configure a project button
-
From the dropdown, select + Create a new project, we need to fill the basic information about the application:
- Set the Project name and click next, eg.: Empleado.
- Enter the Product Name and click next, eg.: Emplea.do
- From the dropdown select Web server as your OAuth client and set https://localhost:44343/signin-google as Authorized redirect URIs and click Create
-
Copy the Client ID and Client Secret, we will need it in the next step.
-
Back in our Emplea.do Web project go to the file appsettings.Development.json to the Google object under Authentication and paste the ClientId and ClientSecret copied in the previous steps.
-
Run the project and Log In using Google.