title | description | services | documentationcenter | author | manager | editor | ms.service | ms.devlang | ms.topic | ms.tgt_pltfrm | ms.workload | ms.date | ms.author | ms.custom |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
include file |
include file |
active-directory |
dev-center-name |
jmprieur |
CelesteDG |
active-directory |
na |
include |
na |
identity |
04/11/2019 |
jmprieur |
include file |
To register your application and add your application registration information to your solution, you have two options:
You can quickly register your application by doing the following:
- Go to the new Azure portal - App registrations pane.
- Enter a name for your application and click Register.
- Follow the instructions to download and automatically configure your new application for you in one click.
To register your application and add the app's registration information to your solution manually, follow these steps:
-
Go to Visual Studio and:
- in Solution Explorer, select the project and look at the Properties window (if you don’t see a Properties window, press F4).
- Change SSL Enabled to
True
. - Right-click on the project in Visual Studio, then choose Properties, and the Web tab. In the Servers section change the Project Url to be the SSL URL.
- Copy the SSL URL. You will add this URL to the list of Redirect URLs in the Registration Portal’s list of Redirect URLs in the next step:
-
Sign in to the Azure portal using either a work or school account, or a personal Microsoft account.
-
If your account gives you access to more than one tenant, select your account in the top right corner, and set your portal session to the desired Azure AD tenant.
-
Navigate to the Microsoft identity platform for developers App registrations page.
-
Select New registration.
-
When the Register an application page appears, enter your application's registration information:
- In the Name section, enter a meaningful application name that will be displayed to users of the app, for example
ASPNET-Tutorial
. - Add the SSL URL you had copied from Visual Studio in Step 1 (for instance
https://localhost:44368/
) in Reply URL, and click Register.
- In the Name section, enter a meaningful application name that will be displayed to users of the app, for example
-
Select Authentication menu, set ID tokens under Implicit Grant, and then select Save.
-
Add the following in
web.config
located in the root folder under the sectionconfiguration\appSettings
:<add key="ClientId" value="Enter_the_Application_Id_here" /> <add key="redirectUri" value="Enter_the_Redirect_URL_here" /> <add key="Tenant" value="common" /> <add key="Authority" value="https://login.microsoftonline.com/{0}/v2.0" />
-
Replace
ClientId
with the Application ID you just registered. -
Replace
redirectUri
with the SSL URL of your project.