You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Register your SharePoint Add-ins in Azure ACS by using Visual Studio, the Seller Dashboard, or an AppRegNew.aspx page, and retrieve registration information.
4
-
ms.date: 12/26/2017
4
+
ms.date: 11/01/2019
5
5
ms.prod: sharepoint
6
6
localization_priority: Priority
7
7
---
@@ -15,29 +15,22 @@ Register your SharePoint Add-ins in Azure ACS by using Visual Studio, the Seller
15
15
16
16
For the remote components of a provider-hosted SharePoint Add-in to interact with SharePoint using OAuth, the add-in must first register with the [Azure ACS](https://msdn.microsoft.com/en-us/library/azure/gg429788.aspx) cloud-based service and the SharePoint App Management Service of the tenancy or farm. (It is called "App Management Service" because SharePoint Add-ins were originally called "apps for SharePoint.")
17
17
18
-
19
-
> [!NOTE]
18
+
> [!NOTE]
20
19
> This is not required for SharePoint-hosted add-ins.
21
-
22
20
23
21
To register your add-in with Azure ACS, you specify the following information:
24
22
25
23
- A GUID for the add-in, called a client ID.
26
-
27
24
- A password for the add-in, called a client secret.
28
-
29
25
- A display name of the add-in that is used on the consent page where the user is prompted to trust the add-in.
30
-
31
26
- A URL for the ___domain where the remote add-in is hosted.
32
-
33
27
- A redirect URL.
34
-
35
-
28
+
36
29
After you register your add-in, it has an add-in identity and is a *security principal*, referred to as an **add-in principal**. When you install your add-in, SharePoint administrators can retrieve information about that particular add-in principal.
37
-
30
+
38
31
When a user first grants an add-in permissions to access SharePoint resources (which can happen either at installation or runtime, depending on the design of the app), SharePoint gets information about the add-in from Azure ACS. SharePoint then stores this information in the App Management Service database of the SharePoint tenancy or farm. The client secret is stored only with Azure ACS. SharePoint never knows the add-in's secret. The content database service and other components, such as the user profile service, can get the display name and other basic information about the add-in directly from the app management shared service. For more information, see [Retrieve add-in registration and add-in principal information](#Retrieve) in this article.
39
-
40
-
> [!NOTE]
32
+
33
+
> [!NOTE]
41
34
> This article assumes that you are familiar with the basic concepts and principles behind the OAuth 2.0 Framework. For more information, see [OAuth.net](http://oauth.net/) and [Web Authorization Protocol (oauth)](http://datatracker.ietf.org/doc/active/).
42
35
43
36
## Register your SharePoint Add-in in Azure ACS
@@ -53,112 +46,105 @@ You can register your add-in in one of three ways, depending on where you are in
53
46
### To register by using AppRegNew.aspx
54
47
55
48
1. Go to `<site collection url>/_layouts/15/AppRegNew.aspx` by using a web browser.
56
-
57
-
**AppRegNew page form**
58
-
59
-

60
-
61
-
62
-
2. Enter values for the follow form fields:
63
-
64
-
-**Add-in ID**. Also known as client ID; a GUID that can be generated (when you select **Generate**) or pasted into AppRegNew.aspx. The value must be unique for each add-in, and *must be lowercase*.
65
-
66
-
-**Add-in Secret**. Also known as the client secret, an opaque string. It is generated on the AppRegNew.aspx page by using the **Generate** button. The following is an example of an add-in secret: `xvVpG0AgVIJfch6ldu4dLUlcZyysmGqBRbpFDu6AfJw=`.
67
-
68
-
> [!IMPORTANT]
69
-
> Add-in secrets expire. If you register the add-in on the Seller Dashboard, you can set the expiration for up to three years. In the dashboard, you can also add new secrets when the old ones reach their expiration date. The new secret will be enabled in all instances of the add-in. If you register the add-in with AppRegNew.aspx, the secret expires in one year. For details, see [Replace an expiring client secret in a SharePoint Add-in](replace-an-expiring-client-secret-in-a-sharepoint-add-in.md).
70
-
71
-
-**Title**. A user-friendly title; for example, **Contoso photo printing add-in**. Users are prompted to grant or deny the add-in the permissions that the add-in is requesting. This title appears as the name of the add-in on the consent prompt.
72
-
73
-
-**Add-in Domain**. The host name of the remote component of the SharePoint Add-in. If the remote application isn't using port 443, the add-in ___domain must also include the port number. The add-in ___domain must match the URL bindings you use for your web application. Do not include protocol ("https:") or "/" characters in this value. If your web application host is using a DNS CNAME alias, use the alias. Some examples:
74
-
75
-
-www.contoso.com:3333
76
-
77
-
-www.fabrikam.com
78
-
79
-
-**Redirect URI:**. The endpoint in your remote application or service to which ACS sends an authentication code. Strictly speaking, SharePoint Add-ins don't use this value. The redirect URI is required for web applications that are launched outside of SharePoint and that use the [Authentication Code flow](creating-sharepoint-add-ins-that-use-low-trust-authorization.md#Flows) to get authorized access to SharePoint data.
80
-
81
-
The Redirect URI is ignored for true SharePoint Add-ins (which are launched from SharePoint and use the [Context Token flow](creating-sharepoint-add-ins-that-use-low-trust-authorization.md#Flows)).
82
-
83
-
The Redirect URI is usually the same page, controller method, or web service method that requested the authentication code from ACS, but it can be a different endpoint. The endpoint must have logic that gets the authorization code from the HTTP Response that is sent by ACS and then uses that code to request an access and refresh token. For more information, see [Authorization Code OAuth flow for SharePoint Add-ins](authorization-code-oauth-flow-for-sharepoint-add-ins.md).
84
-
85
-
The form requires that you enter a valid value even for true SharePoint Add-ins, although it is not used. The value must be a complete endpoint URL including the protocol, *which must be HTTPS*. For example:
86
-
87
-
-https://www.contoso.com/Default.aspx
88
-
89
-
-https://www.fabrikam.com/RedirectAccept.aspx
90
-
91
-
-https://www.northwindtraders.com/home/index
92
-
93
-
-https://adventureworks.com/vacationdata.svc
94
-
95
-
3. Select **Create** on the form. The page reloads and shows a confirmation of the values that you entered. Make a record of these values in a form that is easy to copy and paste. You need to enter the values in web.config and AppManifest.xml files or in the Visual Studio Publish wizard.
96
-
49
+
50
+
**AppRegNew page form**
51
+
52
+

53
+
54
+
1. Enter values for the follow form fields:
55
+
56
+
-**Add-in ID**. Also known as client ID; a GUID that can be generated (when you select **Generate**) or pasted into AppRegNew.aspx. The value must be unique for each add-in, and *must be lowercase*.
57
+
-**Add-in Secret**. Also known as the client secret, an opaque string. It is generated on the AppRegNew.aspx page by using the **Generate** button. The following is an example of an add-in secret: `xvVpG0AgVIJfch6ldu4dLUlcZyysmGqBRbpFDu6AfJw=`.
58
+
59
+
> [!IMPORTANT]
60
+
> Add-in secrets expire. If you register the add-in on the Seller Dashboard, you can set the expiration for up to three years. In the dashboard, you can also add new secrets when the old ones reach their expiration date. The new secret will be enabled in all instances of the add-in. If you register the add-in with AppRegNew.aspx, the secret expires in one year. For details, see [Replace an expiring client secret in a SharePoint Add-in](replace-an-expiring-client-secret-in-a-sharepoint-add-in.md).
61
+
62
+
-**Title**. A user-friendly title; for example, **Contoso photo printing add-in**. Users are prompted to grant or deny the add-in the permissions that the add-in is requesting. This title appears as the name of the add-in on the consent prompt.
63
+
-**Add-in Domain**. The host name of the remote component of the SharePoint Add-in. If the remote application isn't using port 443, the add-in ___domain must also include the port number. The add-in ___domain must match the URL bindings you use for your web application. Do not include protocol ("https:") or "/" characters in this value. If your web application host is using a DNS CNAME alias, use the alias. Some examples:
64
+
65
+
-www.contoso.com:3333
66
+
-www.fabrikam.com
67
+
68
+
-**Redirect URI:**. The endpoint in your remote application or service to which ACS sends an authentication code. Strictly speaking, SharePoint Add-ins don't use this value. The redirect URI is required for web applications that are launched outside of SharePoint and that use the [Authentication Code flow](creating-sharepoint-add-ins-that-use-low-trust-authorization.md#Flows) to get authorized access to SharePoint data.
69
+
70
+
The Redirect URI is ignored for true SharePoint Add-ins (which are launched from SharePoint and use the [Context Token flow](creating-sharepoint-add-ins-that-use-low-trust-authorization.md#Flows)).
71
+
72
+
The Redirect URI is usually the same page, controller method, or web service method that requested the authentication code from ACS, but it can be a different endpoint. The endpoint must have logic that gets the authorization code from the HTTP Response that is sent by ACS and then uses that code to request an access and refresh token. For more information, see [Authorization Code OAuth flow for SharePoint Add-ins](authorization-code-oauth-flow-for-sharepoint-add-ins.md).
73
+
74
+
The form requires that you enter a valid value even for true SharePoint Add-ins, although it is not used. The value must be a complete endpoint URL including the protocol, *which must be HTTPS*. For example:
75
+
76
+
-https://www.contoso.com/Default.aspx
77
+
-https://www.fabrikam.com/RedirectAccept.aspx
78
+
-https://www.northwindtraders.com/home/index
79
+
-https://adventureworks.com/vacationdata.svc
80
+
81
+
1. Select **Create** on the form. The page reloads and shows a confirmation of the values that you entered. Make a record of these values in a form that is easy to copy and paste. You need to enter the values in web.config and AppManifest.xml files or in the Visual Studio Publish wizard.
82
+
97
83
Regardless of how you register your SharePoint Add-in, when you are ready to deploy the add-in to staging or production, you need to [Enter the registration values into the web.config and AppManifest.xml files](#EditConfigFiles). If you are using Visual Studio, the Microsoft Office Developer Tools for Visual Studio do this configuration for you.
98
84
99
-
<aname="EditConfigFiles"> </a>
85
+
<aname="EditConfigFiles"> </a>
100
86
101
87
## Enter the registration values into the web.config and AppManifest.xml files
102
88
103
89
Before you package the SharePoint Add-in and before you deploy its remote components, enter some of the registration values in the AppManifest.xml and the web.config file.
104
90
105
-
> [!TIP]
91
+
> [!TIP]
106
92
> If you publish your SharePoint Add-in by using the Visual Studio publish wizard, Visual Studio prompts you for a client ID and client secret during the publishing process, and it puts the information in the correct places for you.
107
93
108
94
1. In the Web.config file in your Visual Studio project, enter the add-in ID value as the **ClientId** value (replacing the temporary value that the tools entered).
109
-
110
-
> [!IMPORTANT]
111
-
> All the letters in the client ID GUID must be lowercase.
112
95
113
-
The following is an example.
96
+
> [!IMPORTANT]
97
+
> All the letters in the client ID GUID must be lowercase.
3. In the AppManifest.xml file in your Visual Studio project, enter the add-in ID value as the **ClientId** value, *with lowercase letters*.
134
-
135
-
> [!NOTE]
136
-
> The add-in manifest does not apply to web applications that request permission to access SharePoint resources on the fly. These are not really "SharePoint Add-ins". They are not installed on SharePoint and do not have an add-in manifest. For more information, see [Authorization Code OAuth flow for SharePoint Add-ins](authorization-code-oauth-flow-for-sharepoint-add-ins.md).
119
+
1. In the AppManifest.xml file in your Visual Studio project, enter the add-in ID value as the **ClientId** value, *with lowercase letters*.
137
120
138
-
The following example shows how the **ClientId** value is used in the AppManifest.xml file.
121
+
> [!NOTE]
122
+
> The add-in manifest does not apply to web applications that request permission to access SharePoint resources on the fly. These are not really "SharePoint Add-ins". They are not installed on SharePoint and do not have an add-in manifest. For more information, see [Authorization Code OAuth flow for SharePoint Add-ins](authorization-code-oauth-flow-for-sharepoint-add-ins.md).
139
123
140
-
```XML
124
+
The following example shows how the **ClientId** value is used in the AppManifest.xml file.
1. The Office Developer Tools for Visual Studio use the token `~remoteAppUrl` in the **StartPage** element. (For example, `<StartPage>~remoteAppUrl/Pages/Default.aspx?{StandardTokens}</StartPage>`.) This token resolves to the URL of the remote component if you are using the Publish wizard in Visual Studio. If you don't use the wizard (or if you do but you are publishing the remote component to Azure), you have to manually replace the token with the **Add-in Domain** value that you used when registering the add-in. It must be *exactly* the same value, including port number, if any, except that you include the HTTPS protocol as well. The following is an example.
145
133
146
-
4. The Office Developer Tools for Visual Studio use the token `~remoteAppUrl` in the **StartPage** element. (For example, `<StartPage>~remoteAppUrl/Pages/Default.aspx?{StandardTokens}</StartPage>`.) This token resolves to the URL of the remote component if you are using the Publish wizard in Visual Studio. If you don't use the wizard (or if you do but you are publishing the remote component to Azure), you have to manually replace the token with the **Add-in Domain** value that you used when registering the add-in. It must be *exactly* the same value, including port number, if any, except that you include the HTTPS protocol as well. The following is an example.
5. Consider using the same value for the **Title** element in the AppManifest.xml file that you used for the **Title** field in AppRegNew.aspx. The **Title** element value is the name of the add-in that users see after it is installed. It might be confusing to users for the add-in to have a different name in the consent dialog than it has in the SharePoint UI.
153
-
154
-
The following example shows these values in the add-in manifest.
138
+
1. Consider using the same value for the **Title** element in the AppManifest.xml file that you used for the **Title** field in AppRegNew.aspx. The **Title** element value is the name of the add-in that users see after it is installed. It might be confusing to users for the add-in to have a different name in the consent dialog than it has in the SharePoint UI.
155
139
156
-
```XML
140
+
The following example shows these values in the add-in manifest.
@@ -170,29 +156,23 @@ If your web application is launched from outside SharePoint (and is, thus, not a
170
156
171
157
## Retrieve add-in registration and add-in principal information
172
158
173
-
You can retrieve add-in registration information and add-in principal information for the add-ins you've installed or registered on SharePoint.
174
-
159
+
You can retrieve add-in registration information and add-in principal information for the add-ins you've installed or registered on SharePoint.
160
+
175
161
To look up registration information for an add-in that you have registered, go to `http://<SharePointWebsite>/_layouts/15/AppInv.aspx`.
176
162
177
163
To do a lookup, you have to remember the client ID (also known as the add-in ID) that was used to register the add-in. The lookup returns the following information for a particular client ID:
178
164
179
165
- Title
180
-
181
166
- Add-in ___domain
182
-
183
167
- Redirect URL (this is the same as the redirect URI)
184
-
185
-
168
+
186
169
The lookup does not return the add-in secret value.
187
170
188
171
To see a list of registered add-in principals, go to: `http://<SharePointWebsite>/_layouts/15/AppPrincipals.aspx`.
189
-
190
172
191
173
## See also
192
174
<aname="AR"> </a>
193
175
194
176
- [Three authorization systems for SharePoint Add-ins](three-authorization-systems-for-sharepoint-add-ins.md)
195
177
- [Get started creating provider-hosted SharePoint Add-ins](get-started-creating-provider-hosted-sharepoint-add-ins.md)
196
178
- [Authorization and authentication of SharePoint Add-ins](authorization-and-authentication-of-sharepoint-add-ins.md)
0 commit comments