diff --git a/README.md b/README.md index 77f2147..a11a985 100644 --- a/README.md +++ b/README.md @@ -83,4 +83,9 @@ KEYCLOAK_PUBLIC_KEY = "secret" options = {"verify_signature": True, "verify_aud": True, "exp": True} token_info = keycloak.decode_token(token['access_token'], key=KEYCLOAK_PUBLIC_KEY, options=options) +# Get permissions by token +token = keycloak.token("user", "password") +keycloak.load_authorization_config("example-authz-config.json") +permissions = keycloak.get_permissions(token['access_token']) + ``` \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index 3cd8f61..a785943 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -113,3 +113,8 @@ Main methods:: options = {"verify_signature": True, "verify_aud": True, "exp": True} token_info = keycloak.decode_token(token['access_token'], key=KEYCLOAK_PUBLIC_KEY, options=options) + # Get permissions by token + token = keycloak.token("user", "password") + keycloak.load_authorization_config("example-authz-config.json") + permissions = keycloak.get_permissions(token['access_token']) +