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 |
andretms |
mtillman |
active-directory |
na |
include |
na |
identity |
05/04/2018 |
andret |
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:
- Register your application via the Microsoft Application Registration Portal.
- Enter a name for your application and your email.
- Make sure the option for Guided Setup is checked.
- Follow the instructions to add a Redirect URL to your application.
To register your application and add your application registration information to your solution, do the following:
-
Go to the Microsoft Application Registration Portal to register an application.
-
Enter a name for your application and your email.
-
Make sure the option for Guided Setup is unchecked
-
Select
Add Platform
, and then selectWeb
. -
Go back 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 and add this URL to the list of Redirect URLs in the Registration Portal’s list of Redirect URLs:
-
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.