Browse Source
Merge pull request #71 from Filirom1/admin-client-credentials-grant
Add support for Client Credentials Grant in KeycloakAdmin
master
Marcos Pereira
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
1 deletions
-
docs/source/index.rst
-
keycloak/keycloak_admin.py
|
@ -158,6 +158,14 @@ Main methods:: |
|
|
# realm_name="example_realm", |
|
|
# realm_name="example_realm", |
|
|
# verify=True, |
|
|
# verify=True, |
|
|
# custom_headers={'CustomHeader': 'value'}) |
|
|
# custom_headers={'CustomHeader': 'value'}) |
|
|
|
|
|
# |
|
|
|
|
|
# You can also authenticate with client_id and client_secret |
|
|
|
|
|
#keycloak_admin = KeycloakAdmin(server_url="http://localhost:8080/auth/", |
|
|
|
|
|
# client_id="example_client", |
|
|
|
|
|
# client_secret_key="secret", |
|
|
|
|
|
# realm_name="example_realm", |
|
|
|
|
|
# verify=True, |
|
|
|
|
|
# custom_headers={'CustomHeader': 'value'}) |
|
|
|
|
|
|
|
|
# Add user |
|
|
# Add user |
|
|
new_user = keycloak_admin.create_user({"email": "example@example.com", |
|
|
new_user = keycloak_admin.create_user({"email": "example@example.com", |
|
|
|
@ -60,7 +60,7 @@ class KeycloakAdmin: |
|
|
_custom_headers = None |
|
|
_custom_headers = None |
|
|
_user_realm_name = None |
|
|
_user_realm_name = None |
|
|
|
|
|
|
|
|
def __init__(self, server_url, username, password, realm_name='master', client_id='admin-cli', verify=True, |
|
|
|
|
|
|
|
|
def __init__(self, server_url, username=None, password=None, realm_name='master', client_id='admin-cli', verify=True, |
|
|
client_secret_key=None, custom_headers=None, user_realm_name=None, auto_refresh_token=None): |
|
|
client_secret_key=None, custom_headers=None, user_realm_name=None, auto_refresh_token=None): |
|
|
""" |
|
|
""" |
|
|
|
|
|
|
|
|