Browse Source

Merge pull request #237 from tobiashenkel/delete-user-social-login

Add delete_user_social_login
pull/245/head^2
Marcos Pereira 3 years ago
committed by GitHub
parent
commit
d826ea5119
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      keycloak/keycloak_admin.py

12
keycloak/keycloak_admin.py

@ -613,6 +613,18 @@ class KeycloakAdmin:
params_path = {"realm-name": self.realm_name, "id": user_id, "provider": provider_id} params_path = {"realm-name": self.realm_name, "id": user_id, "provider": provider_id}
data_raw = self.raw_post(URL_ADMIN_USER_FEDERATED_IDENTITY.format(**params_path), data=json.dumps(payload)) data_raw = self.raw_post(URL_ADMIN_USER_FEDERATED_IDENTITY.format(**params_path), data=json.dumps(payload))
def delete_user_social_login(self, user_id, provider_id):
"""
Delete a federated identity / social login provider from the user
:param user_id: User id
:param provider_id: Social login provider id
:return:
"""
params_path = {"realm-name": self.realm_name, "id": user_id, "provider": provider_id}
data_raw = self.raw_delete(URL_ADMIN_USER_FEDERATED_IDENTITY.format(**params_path))
return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[204])
def send_update_account(self, user_id, payload, client_id=None, lifespan=None, redirect_uri=None): def send_update_account(self, user_id, payload, client_id=None, lifespan=None, redirect_uri=None):
""" """
Send an update account email to the user. An email contains a Send an update account email to the user. An email contains a

Loading…
Cancel
Save