Browse Source

Merge pull request #71 from Filirom1/admin-client-credentials-grant

Add support for Client Credentials Grant in KeycloakAdmin
pull/75/head
Marcos Pereira 5 years ago
committed by GitHub
parent
commit
af06091ef2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      docs/source/index.rst
  2. 2
      keycloak/keycloak_admin.py

8
docs/source/index.rst

@ -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",

2
keycloak/keycloak_admin.py

@ -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):
""" """

Loading…
Cancel
Save