From 451f0d8c4073336d6e5ab31fc414155f7cd61740 Mon Sep 17 00:00:00 2001 From: Marcos Pereira Date: Wed, 23 Aug 2017 09:51:43 -0300 Subject: [PATCH] Updated docs. --- README.md | 5 +++++ docs/source/index.rst | 5 +++++ 2 files changed, 10 insertions(+) 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']) +