Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/keycloak/openid_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,21 @@ def userinfo(self, token):
url, headers={"Authorization": "Bearer {}".format(token)}
)

def permissions(self, token, **kwargs):
"""
:param str audience: (optional) Client ID to get te permissions for.
:rtype: dict
"""

payload = {"grant_type": "urn:ietf:params:oauth:grant-type:uma-ticket"}
payload.update(**kwargs)

return self._realm.client.post(
self.get_url("token_endpoint"),
payload,
headers={"Authorization": "Bearer {}".format(token)}
)

def authorization_url(self, **kwargs):
"""
Get authorization URL to redirect the resource owner to.
Expand Down
3 changes: 3 additions & 0 deletions src/keycloak/realm.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
from keycloak.admin import KeycloakAdmin
from keycloak.authz import KeycloakAuthz
from keycloak.client import KeycloakClient
Expand Down Expand Up @@ -68,6 +69,8 @@ def authz(self, client_id):
:param str client_id:
:rtype: keycloak.authz.KeycloakAuthz
"""
warnings.warn("The Authz API will be removed in Keycloak 4.0.0",
DeprecationWarning)
return KeycloakAuthz(realm=self, client_id=client_id)

def uma(self):
Expand Down