Skip to content

Commit da1628a

Browse files
committed
Add example of openfaas token
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent f892fa7 commit da1628a

1 file changed

Lines changed: 43 additions & 1 deletion

File tree

_posts/2023-06-20-walkthrough-iam-for-openfaas.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,13 +593,55 @@ $ faas-cli pro auth \
593593

594594
To print out the formatted OpenFaaS token after having done an exchange, remove `--no-exchange` from the command above.
595595

596+
Here's an example of an OpenFaaS Token:
597+
598+
```json
599+
{
600+
"header": {
601+
"alg": "ES256",
602+
"kid": "ARyHBtoRuXRzCEqR_9NRr_HPP_s36vHKf9_X_Mjpad4x",
603+
"typ": "JWT"
604+
},
605+
"payload": {
606+
"at_hash": "F53gv7injmJ9hUGCOtDgBw",
607+
"aud": "https://gateway.example.com",
608+
"auth_time": 1706088607,
609+
"azp": "openfaas",
610+
"email_verified": true,
611+
"exp": 1706131945,
612+
"family_name": "Verstraete",
613+
"fed:iss": "https://keycloak.example.com/realms/openfaas",
614+
"given_name": "Han",
615+
"groups": [
616+
"openfaas-dev"
617+
],
618+
"iat": 1706088745,
619+
"iss": "https://gateway.example.com",
620+
"jti": "81d42f43-8ebe-4d62-84f8-e1ecab5eb4b1",
621+
"name": "Han Verstraete",
622+
"nonce": "1706088744941521000",
623+
"policy": [
624+
"staging-rw"
625+
],
626+
"preferred_username": "welteki",
627+
"session_state": "65c3df72-dad8-4b2f-95aa-f1556b40ab80",
628+
"sid": "65c3df72-dad8-4b2f-95aa-f1556b40ab80",
629+
"sub": "fed:a81bcb85-72a8-446a-9263-004944a4e9f4",
630+
"typ": "ID"
631+
}
632+
}
633+
```
634+
635+
Note the `policy` array which contains the policies associated with the user's Role.
636+
637+
596638
## Wrapping up
597639

598640
We covered a lot of ground in this post including new API objects for OpenFaaS, how to configure an IdP, and then how to authenticate to OpenFaaS using the CLI and Dashboard.
599641

600642
Covering CI was out of scope, but you can learn about that in the docs for GitHub Actions and GitLab CI: [Overview: Identity and Access Management (IAM)](https://docs.openfaas.com/openfaas-pro/iam/overview/)
601643

602-
You can reach out to us to see if OpenFaaS Standard or OpenFaaS for Enterprises is right for your team here: [OpenFaaS Pricing](https://openfaas.com/pricing/)
644+
You can reach out to us to see if OpenFaaS Standard or OpenFaaS for Enterprises is right for your team [here](https://openfaas.com/pricing/).
603645

604646
FAQ:
605647

0 commit comments

Comments
 (0)