Skip to content

Commit 0ccf82c

Browse files
committed
Fix typo, cleanup markdown formatting
- fixes SharePoint#3055
1 parent 3474aad commit 0ccf82c

File tree

1 file changed

+73
-93
lines changed

1 file changed

+73
-93
lines changed
Lines changed: 73 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Register SharePoint Add-ins
33
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
55
ms.prod: sharepoint
66
localization_priority: Priority
77
---
@@ -15,29 +15,22 @@ Register your SharePoint Add-ins in Azure ACS by using Visual Studio, the Seller
1515
1616
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.")
1717

18-
19-
> [!NOTE]
18+
> [!NOTE]
2019
> This is not required for SharePoint-hosted add-ins.
21-
2220
2321
To register your add-in with Azure ACS, you specify the following information:
2422

2523
- A GUID for the add-in, called a client ID.
26-
2724
- A password for the add-in, called a client secret.
28-
2925
- 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-
3126
- A URL for the ___domain where the remote add-in is hosted.
32-
3327
- A redirect URL.
34-
35-
28+
3629
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+
3831
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]
4134
> 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/).
4235
4336
## 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
5346
### To register by using AppRegNew.aspx
5447

5548
1. Go to `<site collection url>/_layouts/15/AppRegNew.aspx` by using a web browser.
56-
57-
**AppRegNew page form**
58-
59-
![The form on the App Reg New page with boxes for client ID, client secret, title, app ___domain, and redirect URL. Buttons named "generate" are beside the first two. In the corner are Create and Cancel buttons.](../images/9a38d876-2189-418c-9314-ae493a4cab61.PNG)
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+
![The form on the App Reg New page with boxes for client ID, client secret, title, app ___domain, and redirect URL. Buttons named "generate" are beside the first two. In the corner are Create and Cancel buttons.](../images/9a38d876-2189-418c-9314-ae493a4cab61.PNG)
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+
9783
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.
9884

99-
<a name="EditConfigFiles"> </a>
85+
<a name="EditConfigFiles"> </a>
10086

10187
## Enter the registration values into the web.config and AppManifest.xml files
10288

10389
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.
10490

105-
> [!TIP]
91+
> [!TIP]
10692
> 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.
10793
10894
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.
11295

113-
The following is an example.
96+
> [!IMPORTANT]
97+
> All the letters in the client ID GUID must be lowercase.
11498
115-
```XML
99+
The following is an example.
100+
101+
```XML
116102
<appSettings>
117103
<add key="ClientId" value="a044e184-7de2-4d05-aacf-52118008c44e " />
118104
. . .
119105
</appSettings>
120-
```
106+
```
107+
108+
1. Enter the add-in secret value as the **ClientSecret** value (replacing the temporary value that the tools entered).
121109

122-
2. Enter the add-in secret value as the **ClientSecret** value (replacing the temporary value that the tools entered).
123-
124-
The following is an example of how the values are used in the Web.config file of a web application.
110+
The following is an example of how the values are used in the Web.config file of a web application.
125111

126-
```XML
112+
```XML
127113
<appSettings>
128114
<add key="ClientId" value="a044e184-7de2-4d05-aacf-52118008c44e " />
129115
<add key="ClientSecret" value="l0z/8TzWN0yQBzMBSEZtYts2Vt3Eo/oE3rfCdPaogKQ= " />
130116
</appSettings>
131-
```
117+
```
132118

133-
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*.
137120

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).
139123

140-
```XML
124+
The following example shows how the **ClientId** value is used in the AppManifest.xml file.
125+
126+
```XML
141127
<AppPrincipal>
142-
<RemoteWebApplication ClientId="a044e184-7de2-4d05-aacf-52118008c44e "/>
128+
<RemoteWebApplication ClientId="a044e184-7de2-4d05-aacf-52118008c44e"/>
143129
</AppPrincipal>
144-
```
130+
```
131+
132+
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.
145133

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.
147-
148-
```XML
134+
```XML
149135
<StartPage>https://www.contoso.com/Pages/Default.aspx?{StandardTokens}</StartPage>
150-
```
136+
```
151137

152-
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.
155139

156-
```XML
140+
The following example shows these values in the add-in manifest.
141+
142+
```XML
157143
<Properties>
158144
<Title>Contoso photo printing app</Title>
159145
<StartPage>https://www.contoso.com/Pages/Default.aspx?{StandardTokens}</StartPage>
160146
</Properties>
161-
```
147+
```
162148

163149
<a name="UseRedirectUrl"> </a>
164150

@@ -170,29 +156,23 @@ If your web application is launched from outside SharePoint (and is, thus, not a
170156

171157
## Retrieve add-in registration and add-in principal information
172158

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+
175161
To look up registration information for an add-in that you have registered, go to `http://<SharePointWebsite>/_layouts/15/AppInv.aspx`.
176162

177163
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:
178164

179165
- Title
180-
181166
- Add-in ___domain
182-
183167
- Redirect URL (this is the same as the redirect URI)
184-
185-
168+
186169
The lookup does not return the add-in secret value.
187170

188171
To see a list of registered add-in principals, go to: `http://<SharePointWebsite>/_layouts/15/AppPrincipals.aspx`.
189-
190172

191173
## See also
192174
<a name="AR"> </a>
193175

194176
- [Three authorization systems for SharePoint Add-ins](three-authorization-systems-for-sharepoint-add-ins.md)
195177
- [Get started creating provider-hosted SharePoint Add-ins](get-started-creating-provider-hosted-sharepoint-add-ins.md)
196178
- [Authorization and authentication of SharePoint Add-ins](authorization-and-authentication-of-sharepoint-add-ins.md)
197-
198-

0 commit comments

Comments
 (0)