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
Copy file name to clipboardExpand all lines: articles/static-apps/user-information.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,22 +13,20 @@ ms.author: cshoe
13
13
14
14
Azure Static Web Apps provides authentication-related user information via a [direct-access endpoint](#direct-access-endpoint) and to [API functions](#api-functions).
15
15
16
-
Many user interfaces rely heavily on user authentication data. The direct-access endpoint is a helper that exposes user information without having to implement a custom function. Beyond convenience, the direct-access endpoint isn't subject to cold start delays associated with serverless architecture.
16
+
Many user interfaces rely heavily on user authentication data. The direct-access endpoint is a utility API that exposes user information without having to implement a custom function. Beyond convenience, the direct-access endpoint isn't subject to cold start delays that are associated with serverless architecture.
17
17
18
18
## Client principal data
19
19
20
-
User information is available in the app via the `x-ms-client-principal` request header. The client principal data is sent as a [Base64](https://www.wikipedia.org/wiki/Base64)-encoded string containing a serialized JSON object.
21
-
22
-
The following properties are featured in the client principal object:
20
+
Client principal data object exposes user-identifiable information to your app. The following properties are featured in the client principal object:
23
21
24
22
| Property | Description |
25
23
|-----------|---------|
26
24
|`identityProvider`| The name of the [identity provider](authentication-authorization.md). |
27
-
|`userId`| An Azure Static Web Apps-specific unique identifier for the user. <ul><li>The value is unique on a per-app basis. For instance, the same user returns a different `userId` value on a different Static Web Apps site.<li>The value persists for the lifetime of a user. If you delete and add the same user back to the app, a new `userId` is generated.</ul>|
25
+
|`userId`| An Azure Static Web Apps-specific unique identifier for the user. <ul><li>The value is unique on a per-app basis. For instance, the same user returns a different `userId` value on a different Static Web Apps resource.<li>The value persists for the lifetime of a user. If you delete and add the same user back to the app, a new `userId` is generated.</ul>|
28
26
|`userDetails`| Username or email address of the user. Some providers return the [user's email address](authentication-authorization.md), while others send the [user handle](authentication-authorization.md). |
29
27
|`userRoles`| An array of the [user's assigned roles](authentication-authorization.md). |
30
28
31
-
The following example is a sample decoded `x-ms-client-principal` object:
29
+
The following example is a sample clientprincipal object:
32
30
33
31
```json
34
32
{
@@ -60,7 +58,9 @@ console.log(getUserInfo());
60
58
61
59
## API functions
62
60
63
-
Client principal data is passed to API functions in the request header. The following example function, named `user`, shows how to read and return user information.
61
+
Client principal data is passed to API functions in the `x-ms-client-principal` request header. The client principal data is sent as a [Base64](https://www.wikipedia.org/wiki/Base64)-encoded string containing a serialized JSON object.
62
+
63
+
The following example function, named `user`, shows how to read and return user information.
0 commit comments