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-19Lines changed: 7 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ User information is available in the app via the `x-ms-client-principal` request
20
20
| Property | Description |
21
21
|-----------|---------|
22
22
|`identityProvider`| The name of the [identity provider](authentication-authorization.md). |
23
-
|`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 App.<li>The value persists for the lifetime of a user. If you delete and then add the same user back to the app, then the `userId` is a different value.</ul>|
23
+
|`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 App.<li>The value persists for the lifetime of a user. If you delete and then add the same user back to the app, then the `userId` is a different value.</ul>|
24
24
|`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). |
25
25
|`userRoles`| An array of the [user's assigned roles](authentication-authorization.md). |
26
26
@@ -37,7 +37,7 @@ The following example is a sample decoded `x-ms-client-principal` payload:
37
37
38
38
## Direct access
39
39
40
-
To get direct access to the client principal data, you can send a `GET` request to the `/.auth/me` route. When the state of your view is driven by authorization, use this approach for the best performance.
40
+
You can send a `GET` request to the `/.auth/me` route and receive direct access to the client principal data. When the state of your view is driven by authorization, use this approach for the best performance.
41
41
42
42
When users are logged-in, the payload from this request is a client principal JSON object. Requests from unauthenticated users returns `null`.
Client principal data is passed to API functions in the request header. To make this information accessible to the browser, you can return user data from a function.
67
67
68
-
### In the function
68
+
### API access in the function
69
69
70
70
The following example function, named `user`, shows how to return user information to the client.
0 commit comments