Browse Source
add deprecation exception on entitlement call
pull/119/head
domste
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
1 deletions
-
keycloak/keycloak_openid.py
|
|
@ -28,7 +28,8 @@ from jose import jwt |
|
|
|
from .authorization import Authorization |
|
|
|
from .connection import ConnectionManager |
|
|
|
from .exceptions import raise_error_from_response, KeycloakGetError, \ |
|
|
|
KeycloakRPTNotFound, KeycloakAuthorizationConfigError, KeycloakInvalidTokenError |
|
|
|
KeycloakRPTNotFound, KeycloakAuthorizationConfigError, KeycloakInvalidTokenError, |
|
|
|
KeycloakDeprecationError |
|
|
|
from .urls_patterns import ( |
|
|
|
URL_REALM, |
|
|
|
URL_AUTH, |
|
|
@ -292,6 +293,9 @@ class KeycloakOpenID: |
|
|
|
params_path = {"realm-name": self.realm_name, "resource-server-id": resource_server_id} |
|
|
|
data_raw = self.connection.raw_get(URL_ENTITLEMENT.format(**params_path)) |
|
|
|
|
|
|
|
if data_raw.status_code == 404: |
|
|
|
return raise_error_from_response(data_raw, KeycloakDeprecationError) |
|
|
|
|
|
|
|
return raise_error_from_response(data_raw, KeycloakGetError) |
|
|
|
|
|
|
|
def introspect(self, token, rpt=None, token_type_hint=None): |
|
|
|