Skip to content

Commit aa876d8

Browse files
weltekialexellis
authored andcommitted
Add additional header for matching based on subject to the IAM example
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent 77495be commit aa876d8

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/openfaas-pro/iam/example-auth0.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,28 @@ Every condition must return true for the Role to be considered as a match.
5454

5555
The principal field is optional, however if it is given, both the principal and the condition must match. If there are multiple items given, then only one must match the token.
5656

57+
### Match on Subject
58+
59+
To match a role for a specific user you can use a `condition` or the `principal` field to match the subject in the JWT.
60+
61+
Using the principal field:
62+
63+
```yaml
64+
principal:
65+
jwt:sub:
66+
- github|1234567
67+
- github|7654321
68+
```
69+
70+
Using a condition:
71+
72+
```yaml
73+
condition:
74+
StringEqual:
75+
jwt:iss: ["github|1234567", "github|7654321"]
76+
```
77+
78+
Both examples will match the role for any staff subject included in the list.
5779

5880
### Match on group membership
5981

0 commit comments

Comments
 (0)