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
|`identityProvider`| The name of the [identity provider](authentication-authorization.yml). |
26
-
|`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> |
27
-
|`userDetails`| Username or email address of the user. Some providers return the [user's email address](authentication-authorization.yml), while others send the [user handle](authentication-authorization.yml).|
28
-
|`userRoles`| An array of the [user's assigned roles](authentication-authorization.yml).|
29
-
|`claims`| An array of claims returned by your [custom authentication provider](authentication-custom.md). Only accessible in the direct-access endpoint.|
23
+
| Property | Description |
24
+
|---|---|
25
+
|`identityProvider`| The name of the [identity provider](authentication-authorization.yml). |
26
+
|`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> |
27
+
|`userDetails`| Username or email address of the user. Some providers return the [user's email address](authentication-authorization.yml), while others send the [user handle](authentication-authorization.yml). |
28
+
|`userRoles`| An array of the [user's assigned roles](authentication-authorization.yml). |
29
+
|`claims`| An array of claims returned by your [custom authentication provider](authentication-custom.md). Only accessible in the direct-access endpoint. |
30
30
31
31
The following example is a sample client principal object:
32
32
33
33
```json
34
34
{
35
35
"identityProvider": "github",
36
-
"userId": "d75b260a64504067bfc5b2905e3b8182",
36
+
"userId": "abcd12345abcd012345abcdef0123450",
37
37
"userDetails": "username",
38
38
"userRoles": ["anonymous", "authenticated"],
39
39
"claims": [{
@@ -103,7 +103,7 @@ console.log(await getUser());
103
103
104
104
# [C#](#tab/csharp)
105
105
106
-
In a C# function, the user information is available from the `x-ms-client-principal` header which can be deserialized into a `ClaimsPrincipal` object, or your own custom type. The following code demonstrates how to unpack the header into an intermediary type, `ClientPrincipal`, which is then turned into a `ClaimsPrincipal` instance.
106
+
In a C# function, the user information is available from the `x-ms-client-principal` header which your app can deserialize into a `ClaimsPrincipal` object, or your own custom type. The following code demonstrates how to unpack the header into an intermediary type, `ClientPrincipal`, which is then turned into a `ClaimsPrincipal` instance.
0 commit comments