|
1 | 1 | ---
|
2 |
| -title: Application registration in Azure Active Directory B2C | Microsoft Docs |
3 |
| -description: How to register your application with Azure Active Directory B2C |
| 2 | +title: Register an application in Azure Active Directory B2C | Microsoft Docs |
| 3 | +description: Learn how to register your application with Azure Active Directory B2C. |
4 | 4 | services: active-directory-b2c
|
5 | 5 | author: davidmu1
|
6 | 6 | manager: mtillman
|
7 | 7 |
|
8 | 8 | ms.service: active-directory
|
9 | 9 | ms.workload: identity
|
10 | 10 | ms.topic: conceptual
|
11 |
| -ms.date: 6/13/2017 |
| 11 | +ms.date: 11/01/2018 |
12 | 12 | ms.author: davidmu
|
13 | 13 | ms.component: B2C
|
14 | 14 | ---
|
15 | 15 |
|
16 |
| -# Azure Active Directory B2C: Register your application |
| 16 | +# Register an application in Azure Active Directory B2C |
17 | 17 |
|
18 |
| -This Quickstart helps you register an application in a Microsoft Azure Active Directory (Azure AD) B2C tenant in a few minutes. When you're finished, your application is registered for use in the Azure AD B2C tenant. |
| 18 | +To build an [application](active-directory-b2c-apps.md) that accepts consumer sign-up and sign-in, you first need to register the application with an Azure AD B2C tenant. This article helps you register an application in an Azure Active Directory (Azure AD) B2C tenant in a few minutes. When you're finished, your application is registered for use in the Azure AD B2C tenant. |
19 | 19 |
|
20 | 20 | ## Prerequisites
|
21 | 21 |
|
22 |
| -To build an application that accepts consumer sign-up and sign-in, you first need to register the application with an Azure Active Directory B2C tenant. Get your own tenant by using the steps outlined in [Create an Azure AD B2C tenant](active-directory-b2c-get-started.md). |
| 22 | +Get your own tenant by using the steps in [Create an Azure Active Directory B2C tenant](tutorial-create-tenant.md). |
23 | 23 |
|
24 |
| -Applications created in the Azure portal must be managed from the same location. If you edit the Azure AD B2C applications using PowerShell or another portal, they become unsupported and do not work with Azure AD B2C. See details in the [faulted apps](#faulted-apps) section. |
| 24 | +Choose next steps based on your application type: |
25 | 25 |
|
26 |
| -This article uses examples that will help you get started with our samples. You can learn more about these samples in the subsequent articles. |
| 26 | +- [Register a web application](#register-a-web-application) |
| 27 | +- [Register a web API](#register-a-web-api) |
| 28 | +- [Register a mobile or native application](#register-a-mobile-or-native-application) |
27 | 29 |
|
28 |
| -## Navigate to B2C settings |
| 30 | +## Register a web application |
29 | 31 |
|
30 |
| -Log in to the [Azure portal](https://portal.azure.com/) as the Global Administrator of the B2C tenant. |
| 32 | +1. Make sure you're using the directory that contains your Azure AD B2C tenant by clicking the **Directory and subscription filter** in the top menu and choosing the directory that contains your tenant. |
| 33 | +2. Choose **All services** in the top-left corner of the Azure portal, and then search for and select **Azure AD B2C**. |
| 34 | +3. Select **Applications**, and then select **Add**. |
| 35 | +4. Enter a name for the application. For example *testapp1*. |
| 36 | +5. For **Include web app/ web API** and **Allow implicit flow**, select **Yes**. |
| 37 | +6. For **Reply URL**, enter endpoint where Azure AD B2C should return any tokens that your app requests. For example, you can set it to listen locally at `https://localhost:44316`. If you don't yet know the port number, you can enter a placeholder value and change it later. |
| 38 | +7. Click **Create**. |
31 | 39 |
|
32 |
| -[!INCLUDE [active-directory-b2c-switch-b2c-tenant](../../includes/active-directory-b2c-switch-b2c-tenant.md)] |
| 40 | +### Create a client secret |
33 | 41 |
|
34 |
| -[!INCLUDE [active-directory-b2c-portal-navigate-b2c-service](../../includes/active-directory-b2c-portal-navigate-b2c-service.md)] |
| 42 | +If your application calls a web API secured by Azure AD B2C, you need to create an application secret. |
35 | 43 |
|
36 |
| -## Choose next steps based on your application type |
| 44 | +1. Select **Keys** and then click **Generate key**. |
| 45 | +2. Select **Save** to view the key. Make note of the **App key** value. You use the value as the application secret in your application's code. |
| 46 | +3. Select **API Access**, click **Add**, and select your web API and scopes (permissions). |
37 | 47 |
|
38 |
| -* [Register a web application](#register-a-web-app) |
39 |
| -* [Register a web API](#register-a-web-api) |
40 |
| -* [Register a mobile or native application](#register-a-mobile-or-native-app) |
41 |
| - |
42 |
| -### Register a web app |
| 48 | +## Register a web API |
43 | 49 |
|
44 |
| -[!INCLUDE [active-directory-b2c-register-web-app](../../includes/active-directory-b2c-register-web-app.md)] |
| 50 | +1. Make sure you're using the directory that contains your Azure AD B2C tenant by clicking the **Directory and subscription filter** in the top menu and choosing the directory that contains your tenant. |
| 51 | +2. Choose **All services** in the top-left corner of the Azure portal, and then search for and select **Azure AD B2C**. |
| 52 | +3. Select **Applications**, and then select **Add**. |
| 53 | +4. Enter a name for the application. For example *testapp2*. |
| 54 | +5. For **Include web app/ web API** and **Allow implicit flow**, select **Yes**. |
| 55 | +6. For **Reply URL**, enter endpoint where Azure AD B2C should return any tokens that your app requests. For example, you can set it to listen locally at `https://localhost:44316`. If you don't yet know the port number, you can enter a placeholder value and change it later. |
| 56 | +7. For **App ID URI**, enter the identifier used for your web API. The full identifier URI including the domain is generated for you. For example, `https://contosotenant.onmicrosoft.com/api`. |
| 57 | +8. Click **Create**. |
| 58 | +9. Select **Published scopes** to add more scopes as necessary. By default, the `user_impersonation` scope is defined. The `user_impersonation` scope gives other applications the ability to access this API on behalf of the signed-in user. If you wish, the `user_impersonation` scope can be removed. |
45 | 59 |
|
46 |
| -### Create a web app client secret |
| 60 | +## Register a mobile or native application |
47 | 61 |
|
48 |
| -If your web application calls a web API secured by Azure AD B2C, perform these steps: |
49 |
| - 1. Create an application secret by going to the **Keys** blade and clicking the **Generate Key** button. Make note of the **App key** value. You use the value as the application secret in your application's code. |
50 |
| - 2. Click **API Access**, click **Add**, and select your web API and scopes (permissions). |
| 62 | +1. Make sure you're using the directory that contains your Azure AD B2C tenant by clicking the **Directory and subscription filter** in the top menu and choosing the directory that contains your tenant. |
| 63 | +2. Choose **All services** in the top-left corner of the Azure portal, and then search for and select **Azure AD B2C**. |
| 64 | +3. Select **Applications**, and then select **Add**. |
| 65 | +4. Enter a name for the application. For example *testapp3*. |
| 66 | +5. For **Include web app/ web API**, select **No**. |
| 67 | +6. For **Include native client**, select **Yes**. |
| 68 | +7. For **Redirect URI**, enter a [redirect URI with a custom scheme](active-directory-b2c-apps.md). Make sure you choose a good redirect URI and do not include special characters such as underscores. |
| 69 | +8. Click **Create**. |
51 | 70 |
|
52 |
| -> [!NOTE] |
53 |
| -> An **Application Secret** is an important security credential, and should be secured appropriately. |
54 |
| -> |
| 71 | +### Create a client secret |
55 | 72 |
|
56 |
| -[Jump to **next steps**](#next-steps) |
| 73 | +If your application calls a web API secured by Azure AD B2C, you need to create an application secret. |
57 | 74 |
|
58 |
| -### Register a web API |
59 |
| - |
60 |
| -[!INCLUDE [active-directory-b2c-register-web-api](../../includes/active-directory-b2c-register-web-api.md)] |
61 |
| - |
62 |
| -Click **Published scopes** to add more scopes as necessary. By default, the "user_impersonation" scope is defined. The user_impersonation scope gives other applications the ability to access this api on behalf of the signed-in user. If you wish, the user_impersonation scope can be removed. |
63 |
| - |
64 |
| -[Jump to **next steps**](#next-steps) |
65 |
| - |
66 |
| -### Register a mobile or native app |
67 |
| - |
68 |
| -[!INCLUDE [active-directory-b2c-register-mobile-native-app](../../includes/active-directory-b2c-register-mobile-native-app.md)] |
69 |
| - |
70 |
| -[Jump to **next steps**](#next-steps) |
71 |
| - |
72 |
| -## Limitations |
73 |
| - |
74 |
| -### Choosing a web app or api reply URL |
75 |
| - |
76 |
| -Currently, apps that are registered with Azure AD B2C are restricted to a limited set of reply URL values. The reply URL for web apps and services must begin with the scheme `https`, and all reply URL values must share a single DNS domain. For example, you cannot register a web app that has one of these reply URLs: |
77 |
| - |
78 |
| -`https://login-east.contoso.com` |
79 |
| - |
80 |
| -`https://login-west.contoso.com` |
81 |
| - |
82 |
| -The registration system compares the whole DNS name of the existing reply URL to the DNS name of the reply URL that you are adding. The request to add the DNS name fails if either of the following conditions is true: |
83 |
| - |
84 |
| -* The whole DNS name of the new reply URL does not match the DNS name of the existing reply URL. |
85 |
| -* The whole DNS name of the new reply URL is not a subdomain of the existing reply URL. |
86 |
| - |
87 |
| -For example, if the app has this reply URL: |
88 |
| - |
89 |
| -`https://login.contoso.com` |
90 |
| - |
91 |
| -You can add to it, like this: |
92 |
| - |
93 |
| -`https://login.contoso.com/new` |
94 |
| - |
95 |
| -In this case, the DNS name matches exactly. Or, you can do this: |
96 |
| - |
97 |
| -`https://new.login.contoso.com` |
98 |
| - |
99 |
| -In this case, you're referring to a DNS subdomain of login.contoso.com. If you want to have an app that has login-east.contoso.com and login-west.contoso.com as reply URLs, you must add those reply URLs in this order: |
100 |
| - |
101 |
| -`https://contoso.com` |
102 |
| - |
103 |
| -`https://login-east.contoso.com` |
104 |
| - |
105 |
| -`https://login-west.contoso.com` |
106 |
| - |
107 |
| -You can add the latter two because they are subdomains of the first reply URL, contoso.com. |
108 |
| - |
109 |
| -### Choosing a native app redirect URI |
110 |
| - |
111 |
| -There are two important considerations when choosing a redirect URI for mobile/native applications: |
112 |
| - |
113 |
| -* **Unique**: The scheme of the redirect URI should be unique for every application. In the example (com.onmicrosoft.contoso.appname://redirect/path), com.onmicrosoft.contoso.appname is the scheme. We recommend following this pattern. If two applications share the same scheme, the user sees a "choose app" dialog. If the user makes an incorrect choice, the login fails. |
114 |
| -* **Complete**: Redirect URI must have a scheme and a path. The path must contain at least one forward slash after the domain (for example, //contoso/ works and //contoso fails). |
115 |
| - |
116 |
| -Ensure there are no special characters like underscores in the redirect uri. |
117 |
| - |
118 |
| -### Faulted apps |
119 |
| - |
120 |
| -B2C applications should NOT be edited: |
121 |
| - |
122 |
| -* On other application management portals such as the [Application Registration Portal](https://apps.dev.microsoft.com/). |
123 |
| -* Using Graph API or PowerShell |
124 |
| - |
125 |
| -If you edit the Azure AD B2C application as described and try to edit it again in Azure AD B2C features on the Azure portal, it becomes a faulted app, and your application is no longer usable with Azure AD B2C. You need to delete the application and create it again. |
126 |
| - |
127 |
| -To delete the app, go to the [Application Registration Portal](https://apps.dev.microsoft.com/) and delete the application there. In order for the application to be visible, you need to be the owner of the application (and not just an admin of the tenant). |
| 75 | +1. Select **Keys** and then click **Generate key**. |
| 76 | +2. Select **Save** to view the key. Make note of the **App key** value. You use the value as the application secret in your application's code. |
| 77 | +3. Select **API Access**, click **Add**, and select your web API and scopes (permissions). |
128 | 78 |
|
129 | 79 | ## Next steps
|
130 | 80 |
|
|
0 commit comments