api

package
v2.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountClient

type AccountClient struct {
	// contains filtered or unexported fields
}

AccountClient structure

func (*AccountClient) DeleteAccount

func (c *AccountClient) DeleteAccount(accessToken string, realmName string) error

DeleteAccount deletes current user

func (*AccountClient) DeleteCredential

func (c *AccountClient) DeleteCredential(accessToken string, realmName string, credentialID string) error

DeleteCredential deletes the credential

func (*AccountClient) ExecuteActionsEmail

func (c *AccountClient) ExecuteActionsEmail(accessToken string, realmName string, actions []string) error

ExecuteActionsEmail sends an email with required actions to the user

func (*AccountClient) GetAccount

func (c *AccountClient) GetAccount(accessToken string, realm string) (keycloak.UserRepresentation, error)

GetAccount provides the user's information

func (*AccountClient) GetCredentialRegistrators

func (c *AccountClient) GetCredentialRegistrators(accessToken string, realmName string) ([]string, error)

GetCredentialRegistrators returns list of credentials types available for the user

func (*AccountClient) GetCredentials

func (c *AccountClient) GetCredentials(accessToken string, realmName string) ([]keycloak.CredentialRepresentation, error)

GetCredentials returns the list of credentials of the user

func (*AccountClient) MoveAfter

func (c *AccountClient) MoveAfter(accessToken string, realmName string, credentialID string, previousCredentialID string) error

MoveAfter moves the credential after the specified one into the list

func (*AccountClient) MoveToFirst

func (c *AccountClient) MoveToFirst(accessToken string, realmName string, credentialID string) error

MoveToFirst moves the credential at the top of the list

func (*AccountClient) SendEmail

func (c *AccountClient) SendEmail(accessToken, realmName, template, subject string, recipient *string, attributes map[string]string) error

SendEmail sends an email

func (*AccountClient) UpdateAccount

func (c *AccountClient) UpdateAccount(accessToken string, realm string, user keycloak.UserRepresentation) error

UpdateAccount updates the user's information

func (*AccountClient) UpdateLabelCredential

func (c *AccountClient) UpdateLabelCredential(accessToken string, realmName string, credentialID string, label string) error

UpdateLabelCredential updates the label of credential

func (*AccountClient) UpdatePassword

func (c *AccountClient) UpdatePassword(accessToken, realm, currentPassword, newPassword, confirmPassword string) (string, error)

UpdatePassword updates the user's password Parameters: realm, currentPassword, newPassword, confirmPassword

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the keycloak client.

func New

func New(config keycloak.Config) (*Client, error)

New returns a keycloak client.

func (*Client) AccountClient

func (c *Client) AccountClient() *AccountClient

AccountClient gets the associated AccountClient

func (*Client) AddClientRolesToUserRoleMapping

func (c *Client) AddClientRolesToUserRoleMapping(accessToken string, realmName, userID, clientID string, roles []keycloak.RoleRepresentation) error

AddClientRolesToUserRoleMapping add client-level roles to the user role mapping.

func (*Client) AddGroupToUser

func (c *Client) AddGroupToUser(accessToken string, realmName, userID, groupID string) error

AddGroupToUser adds a group to the groups of the user.

func (*Client) AddRealmLevelRoleMappings

func (c *Client) AddRealmLevelRoleMappings(accessToken string, realmName, userID string, roles []keycloak.RoleRepresentation) error

AddRealmLevelRoleMappings gets realm level role mappings

func (*Client) AssignClientRole

func (c *Client) AssignClientRole(accessToken string, realmName string, groupID string, clientID string, roles []keycloak.RoleRepresentation) error

AssignClientRole assigns client roles to a specific group

func (*Client) CheckConsentCodeSMS

func (c *Client) CheckConsentCodeSMS(accessToken string, realmName string, userID string, consentCode string) error

CheckConsentCodeSMS checks a consent code previously sent by SMS to a user

func (*Client) ClearAllLoginFailures

func (c *Client) ClearAllLoginFailures(accessToken string, realmName string) error

ClearAllLoginFailures clears any user login failures for all users. This can release temporary disabled users.

func (*Client) ClearUserLoginFailures

func (c *Client) ClearUserLoginFailures(accessToken string, realmName, userID string) error

ClearUserLoginFailures clear any user login failures for the user. This can release temporary disabled user.

func (*Client) CopyExistingAuthenticationFlow

func (c *Client) CopyExistingAuthenticationFlow(accessToken string, realmName, flowAlias, newName string) error

CopyExistingAuthenticationFlow copy the existing authentication flow under a new name. 'flowAlias' is the name of the existing authentication flow, 'newName' is the new name of the authentication flow.

func (*Client) CountUsers

func (c *Client) CountUsers(accessToken string, realmName string) (int, error)

CountUsers returns the number of users in the realm.

func (*Client) CreateActivationCode

func (c *Client) CreateActivationCode(accessToken string, realmName string, userID string) (keycloak.ActivationCodeRepresentation, error)

CreateActivationCode creates a new activation code authenticator and returns the code.

func (*Client) CreateAuthenticationExecution

func (c *Client) CreateAuthenticationExecution(accessToken string, realmName string, authExec keycloak.AuthenticationExecutionRepresentation) (string, error)

CreateAuthenticationExecution add new authentication execution

func (*Client) CreateAuthenticationExecutionForFlow

func (c *Client) CreateAuthenticationExecutionForFlow(accessToken string, realmName, flowAlias, provider string) (string, error)

CreateAuthenticationExecutionForFlow add a new authentication execution to a flow. 'flowAlias' is the alias of the parent flow.

func (*Client) CreateAuthenticationFlow

func (c *Client) CreateAuthenticationFlow(accessToken string, realmName string, authFlow keycloak.AuthenticationFlowRepresentation) error

CreateAuthenticationFlow creates a new authentication flow.

func (*Client) CreateClientInitialAccess

func (c *Client) CreateClientInitialAccess(accessToken string, realmName string, access keycloak.ClientInitialAccessCreatePresentation) (keycloak.ClientInitialAccessPresentation, error)

CreateClientInitialAccess creates a new initial access token.

func (*Client) CreateClientRole

func (c *Client) CreateClientRole(accessToken string, realmName, clientID string, role keycloak.RoleRepresentation) (string, error)

CreateClientRole creates a new role for the realm or client

func (*Client) CreateFlowWithExecutionForExistingFlow

func (c *Client) CreateFlowWithExecutionForExistingFlow(accessToken string, realmName, flowAlias, alias, flowType, provider, description string) (string, error)

CreateFlowWithExecutionForExistingFlow add a new flow with a new execution to an existing flow. 'flowAlias' is the alias of the parent authentication flow.

func (*Client) CreateGroup

func (c *Client) CreateGroup(accessToken string, reqRealmName string, group keycloak.GroupRepresentation) (string, error)

CreateGroup creates the group from its GroupRepresentation. The group name must be unique.

func (*Client) CreateRealm

func (c *Client) CreateRealm(accessToken string, realm keycloak.RealmRepresentation) (string, error)

CreateRealm creates the realm from its RealmRepresentation.

func (*Client) CreateRecoveryCode

func (c *Client) CreateRecoveryCode(accessToken string, realmName string, userID string) (keycloak.RecoveryCodeRepresentation, error)

CreateRecoveryCode creates a new recovery code authenticator and returns the code.

func (*Client) CreateRole

func (c *Client) CreateRole(accessToken string, realmName string, role keycloak.RoleRepresentation) (string, error)

CreateRole creates a new role in a realm

func (*Client) CreateUser

func (c *Client) CreateUser(accessToken string, reqRealmName, targetRealmName string, user keycloak.UserRepresentation, paramKV ...string) (string, error)

CreateUser creates the user from its UserRepresentation. The username must be unique.

func (*Client) DeleteAuthenticationExecution

func (c *Client) DeleteAuthenticationExecution(accessToken string, realmName, executionID string) error

DeleteAuthenticationExecution deletes the execution.

func (*Client) DeleteAuthenticationFlow

func (c *Client) DeleteAuthenticationFlow(accessToken string, realmName, flowID string) error

DeleteAuthenticationFlow deletes an authentication flow.

func (*Client) DeleteAuthenticatorConfig

func (c *Client) DeleteAuthenticatorConfig(accessToken string, realmName, configID string) error

DeleteAuthenticatorConfig deletes the authenticator configuration.

func (*Client) DeleteClientInitialAccess

func (c *Client) DeleteClientInitialAccess(accessToken string, realmName, accessID string) error

DeleteClientInitialAccess deletes the client initial access.

func (*Client) DeleteClientRolesFromUserRoleMapping

func (c *Client) DeleteClientRolesFromUserRoleMapping(accessToken string, realmName, userID, clientID string, roles []keycloak.RoleRepresentation) error

DeleteClientRolesFromUserRoleMapping deletes client-level roles from user role mapping.

func (*Client) DeleteCredential

func (c *Client) DeleteCredential(accessToken string, realmName string, userID string, credentialID string) error

DeleteCredential deletes the credential

func (*Client) DeleteGroup

func (c *Client) DeleteGroup(accessToken string, realmName string, groupID string) error

DeleteGroup deletes a specific group’s representation

func (*Client) DeleteGroupFromUser

func (c *Client) DeleteGroupFromUser(accessToken string, realmName, userID, groupID string) error

DeleteGroupFromUser adds a group to the groups of the user.

func (*Client) DeleteRealm

func (c *Client) DeleteRealm(accessToken string, realmName string) error

DeleteRealm deletes the realm.

func (*Client) DeleteRealmLevelRoleMappings

func (c *Client) DeleteRealmLevelRoleMappings(accessToken string, realmName, userID string, roles []keycloak.RoleRepresentation) error

DeleteRealmLevelRoleMappings gets realm level role mappings

func (*Client) DeleteRequiredAction

func (c *Client) DeleteRequiredAction(accessToken string, realmName, actionAlias string) error

DeleteRequiredAction deletes the required action.

func (*Client) DeleteRole

func (c *Client) DeleteRole(accessToken string, realmName string, roleID string) error

DeleteRole deletes a role in a realm

func (*Client) DeleteUser

func (c *Client) DeleteUser(accessToken string, realmName, userID string) error

DeleteUser deletes the user.

func (*Client) ExecuteActionsEmail

func (c *Client) ExecuteActionsEmail(accessToken string, reqRealmName string, targetRealmName string, userID string, actions []string, paramKV ...string) error

ExecuteActionsEmail sends an update account email to the user. An email contains a link the user can click to perform a set of required actions.

func (*Client) ExportRealm

func (c *Client) ExportRealm(accessToken string, realmName string) (keycloak.RealmRepresentation, error)

ExportRealm recovers the full realm.

func (*Client) GenerateCertificate

func (c *Client) GenerateCertificate(accessToken string, realmName, idClient, attr string) (keycloak.CertificateRepresentation, error)

GenerateCertificate generates a new certificate with new key pair. idClient is the id of client (not client-id).

func (*Client) GenerateKeyPairAndCertificate

func (c *Client) GenerateKeyPairAndCertificate(accessToken string, realmName, idClient, attr string, keyStoreConfig keycloak.KeyStoreConfig) ([]byte, error)

GenerateKeyPairAndCertificate generates a keypair and certificate and serves the private key in a specified keystore format.

func (*Client) GenerateTrustIDAuthToken added in v2.5.7

func (c *Client) GenerateTrustIDAuthToken(accessToken string, reqRealmName string, realmName string, userID string) (string, error)

GenerateTrustIDAuthToken generates a TrustID auth token

func (*Client) GetAttackDetectionStatus

func (c *Client) GetAttackDetectionStatus(accessToken string, realmName, userID string) (map[string]interface{}, error)

GetAttackDetectionStatus gets the status of a username in brute force detection.

func (*Client) GetAuthenticationExecutionForFlow

func (c *Client) GetAuthenticationExecutionForFlow(accessToken string, realmName, flowAlias string) (keycloak.AuthenticationExecutionInfoRepresentation, error)

GetAuthenticationExecutionForFlow returns the authentication executions for a flow.

func (*Client) GetAuthenticationFlow

func (c *Client) GetAuthenticationFlow(accessToken string, realmName, flowID string) (keycloak.AuthenticationFlowRepresentation, error)

GetAuthenticationFlow gets the authentication flow for id.

func (*Client) GetAuthenticationFlows

func (c *Client) GetAuthenticationFlows(accessToken string, realmName string) ([]keycloak.AuthenticationFlowRepresentation, error)

GetAuthenticationFlows returns a list of authentication flows.

func (*Client) GetAuthenticatorConfig

func (c *Client) GetAuthenticatorConfig(accessToken string, realmName, configID string) (keycloak.AuthenticatorConfigRepresentation, error)

GetAuthenticatorConfig returns the authenticator configuration.

func (*Client) GetAuthenticatorProviderConfig

func (c *Client) GetAuthenticatorProviderConfig(accessToken string, realmName, providerID string) (keycloak.AuthenticatorConfigInfoRepresentation, error)

GetAuthenticatorProviderConfig returns the authenticator provider’s configuration description.

func (*Client) GetAuthenticatorProviders

func (c *Client) GetAuthenticatorProviders(accessToken string, realmName string) ([]map[string]interface{}, error)

GetAuthenticatorProviders returns a list of authenticator providers.

func (*Client) GetAvailableGroupClientRoles

func (c *Client) GetAvailableGroupClientRoles(accessToken string, realmName string, groupID string, clientID string) ([]keycloak.RoleRepresentation, error)

GetAvailableGroupClientRoles gets client roles available in a specific group

func (*Client) GetClient

func (c *Client) GetClient(accessToken string, realmName, idClient string) (keycloak.ClientRepresentation, error)

GetClient get the representation of the client. idClient is the id of client (not client-id).

func (*Client) GetClientAuthenticatorProviders

func (c *Client) GetClientAuthenticatorProviders(accessToken string, realmName string) ([]map[string]interface{}, error)

GetClientAuthenticatorProviders returns a list of client authenticator providers.

func (*Client) GetClientInitialAccess

func (c *Client) GetClientInitialAccess(accessToken string, realmName string) ([]keycloak.ClientInitialAccessPresentation, error)

GetClientInitialAccess returns a list of clients initial access.

func (*Client) GetClientMappers

func (c *Client) GetClientMappers(accessToke string, realmName, idClient string) ([]keycloak.ClientMapperRepresentation, error)

GetClientMappers gets mappers of the client specified by id

func (*Client) GetClientRegistrationPolicy

func (c *Client) GetClientRegistrationPolicy(accessToken string, realmName, configID string) ([]keycloak.ComponentTypeRepresentation, error)

GetClientRegistrationPolicy is the base path to retrieve providers with the configProperties properly filled.

func (*Client) GetClientRoleMappings

func (c *Client) GetClientRoleMappings(accessToken string, realmName, userID, clientID string) ([]keycloak.RoleRepresentation, error)

GetClientRoleMappings gets client-level role mappings for the user, and the app.

func (*Client) GetClientRoles

func (c *Client) GetClientRoles(accessToken string, realmName, idClient string) ([]keycloak.RoleRepresentation, error)

GetClientRoles gets all roles for the realm or client

func (*Client) GetClients

func (c *Client) GetClients(accessToken string, realmName string, paramKV ...string) ([]keycloak.ClientRepresentation, error)

GetClients returns a list of clients belonging to the realm. Parameters: clientId (filter by clientId), viewableOnly (filter clients that cannot be viewed in full by admin, default="false")

func (*Client) GetConfigDescriptionForClients

func (c *Client) GetConfigDescriptionForClients(accessToken string, realmName string) (map[string]interface{}, error)

GetConfigDescriptionForClients returns the configuration descriptions for all clients.

func (*Client) GetCredentialTypes

func (c *Client) GetCredentialTypes(accessToken string, realmName string) ([]string, error)

GetCredentialTypes returns list of credentials types available for the realm

func (*Client) GetCredentials

func (c *Client) GetCredentials(accessToken string, realmName string, userID string) ([]keycloak.CredentialRepresentation, error)

GetCredentials returns the list of credentials of the user

func (*Client) GetExpiredTermsOfUseAcceptance

func (c *Client) GetExpiredTermsOfUseAcceptance(accessToken string) ([]keycloak.DeletableUserRepresentation, error)

GetExpiredTermsOfUseAcceptance gets the list of users created for a long time (configured in Keycloak) who declined the terms of use

func (*Client) GetFederatedIdentities added in v2.6.0

func (c *Client) GetFederatedIdentities(accessToken string, realmName string, userID string) ([]keycloak.FederatedIdentityRepresentation, error)

GetFederatedIdentities gets the federated identities of a user in the given realm

func (*Client) GetFormActionProviders

func (c *Client) GetFormActionProviders(accessToken string, realmName string) ([]map[string]interface{}, error)

GetFormActionProviders returns a list of form action providers.

func (*Client) GetFormProviders

func (c *Client) GetFormProviders(accessToken string, realmName string) ([]map[string]interface{}, error)

GetFormProviders returns a list of form providers.

func (*Client) GetGroup

func (c *Client) GetGroup(accessToken string, realmName string, groupID string) (keycloak.GroupRepresentation, error)

GetGroup gets a specific group’s representation

func (*Client) GetGroupClientRoles

func (c *Client) GetGroupClientRoles(accessToken string, realmName string, groupID string, clientID string) ([]keycloak.RoleRepresentation, error)

GetGroupClientRoles gets client roles assigned to a specific group

func (*Client) GetGroups

func (c *Client) GetGroups(accessToken string, realmName string) ([]keycloak.GroupRepresentation, error)

GetGroups gets all groups for the realm

func (*Client) GetGroupsOfUser

func (c *Client) GetGroupsOfUser(accessToken string, realmName, userID string) ([]keycloak.GroupRepresentation, error)

GetGroupsOfUser gets the groups of the user.

func (*Client) GetIdp

func (c *Client) GetIdp(accessToken string, realmName string, idpAlias string) (keycloak.IdentityProviderRepresentation, error)

GetIdp gets an identity provider matching the given alias

func (*Client) GetIdpMappers

func (c *Client) GetIdpMappers(accessToken string, realmName string, idpAlias string) ([]keycloak.IdentityProviderMapperRepresentation, error)

GetIdpMappers gets the mappers of the specified identity provider

func (*Client) GetIdps

func (c *Client) GetIdps(accessToken string, realmName string) ([]keycloak.IdentityProviderRepresentation, error)

GetIdps gets the list of identity providers

func (*Client) GetKeyInfo

func (c *Client) GetKeyInfo(accessToken string, realmName, idClient, attr string) (keycloak.CertificateRepresentation, error)

GetKeyInfo returns the key info. idClient is the id of client (not client-id).

func (*Client) GetKeyStore

func (c *Client) GetKeyStore(accessToken string, realmName, idClient, attr string, keyStoreConfig keycloak.KeyStoreConfig) ([]byte, error)

GetKeyStore returns a keystore file for the client, containing private key and public certificate. idClient is the id of client (not client-id).

func (*Client) GetRealm

func (c *Client) GetRealm(accessToken string, realmName string) (keycloak.RealmRepresentation, error)

GetRealm get the top level represention of the realm. Nested information like users are not included.

func (*Client) GetRealmCredentialRegistrators

func (c *Client) GetRealmCredentialRegistrators(accessToken string, realmName string) ([]string, error)

GetRealmCredentialRegistrators returns list of credentials types available for the realm

func (*Client) GetRealmLevelRoleMappings

func (c *Client) GetRealmLevelRoleMappings(accessToken string, realmName, userID string) ([]keycloak.RoleRepresentation, error)

GetRealmLevelRoleMappings gets realm level role mappings

func (*Client) GetRealms

func (c *Client) GetRealms(accessToken string) ([]keycloak.RealmRepresentation, error)

GetRealms get the top level represention of all the realms. Nested information like users are not included.

func (*Client) GetRequiredAction

func (c *Client) GetRequiredAction(accessToken string, realmName, actionAlias string) (keycloak.RequiredActionProviderRepresentation, error)

GetRequiredAction returns the required action for the alias.

func (*Client) GetRequiredActions

func (c *Client) GetRequiredActions(accessToken string, realmName string) ([]keycloak.RequiredActionProviderRepresentation, error)

GetRequiredActions returns a list of required actions.

func (*Client) GetRole

func (c *Client) GetRole(accessToken string, realmName string, roleID string) (keycloak.RoleRepresentation, error)

GetRole gets a specific role’s representation

func (*Client) GetRoles

func (c *Client) GetRoles(accessToken string, realmName string) ([]keycloak.RoleRepresentation, error)

GetRoles gets all roles for the realm or client

func (*Client) GetRolesWithAttributes

func (c *Client) GetRolesWithAttributes(accessToken string, realmName string) ([]keycloak.RoleRepresentation, error)

GetRolesWithAttributes gets all roles for the realm or client with their attributes

func (*Client) GetSecret

func (c *Client) GetSecret(accessToken string, realmName, idClient string) (keycloak.CredentialRepresentation, error)

GetSecret get the client secret. idClient is the id of client (not client-id).

func (*Client) GetStatisticsAuthenticators

func (c *Client) GetStatisticsAuthenticators(accessToken string, realmName string) (map[string]int64, error)

GetStatisticsAuthenticators returns statistics on the authenticators used by the users on a certain realm

func (*Client) GetStatisticsUsers

func (c *Client) GetStatisticsUsers(accessToken string, realmName string) (keycloak.StatisticsUsersRepresentation, error)

GetStatisticsUsers returns statisctics on the total number of users and on their status

func (*Client) GetSupportInfo added in v2.5.5

func (c *Client) GetSupportInfo(accessToken string, email string) ([]keycloak.EmailInfoRepresentation, error)

GetSupportInfo gets the list of accounts matching a given email address

func (*Client) GetToken

func (c *Client) GetToken(realm string, username string, password string) (string, error)

GetToken returns a valid token from keycloak

func (*Client) GetUnregisteredRequiredActions

func (c *Client) GetUnregisteredRequiredActions(accessToken string, realmName string) ([]map[string]interface{}, error)

GetUnregisteredRequiredActions returns a list of unregistered required actions.

func (*Client) GetUser

func (c *Client) GetUser(accessToken string, realmName, userID string) (keycloak.UserRepresentation, error)

GetUser gets the represention of the user.

func (*Client) GetUserProfile added in v2.6.1

func (c *Client) GetUserProfile(accessToken string, realmName string) (keycloak.UserProfileRepresentation, error)

GetUserProfile gets the configuration of attribute management

func (*Client) GetUsers

func (c *Client) GetUsers(accessToken string, reqRealmName, targetRealmName string, paramKV ...string) (keycloak.UsersPageRepresentation, error)

GetUsers returns a list of users, filtered according to the query parameters. Parameters: email, first (paging offset, int), firstName, lastName, username, max (maximum result size, default = 100), search (string contained in username, firstname, lastname or email. by default, value is searched with a like -%value%- but you can introduce your own % symbol or you can use =value to search an exact value)

func (*Client) LinkShadowUser

func (c *Client) LinkShadowUser(accessToken string, reqRealmName string, userID string, provider string, fedIDKC keycloak.FederatedIdentityRepresentation) error

LinkShadowUser links shadow user to a realm in the context of brokering

func (*Client) LogoutAllSessions

func (c *Client) LogoutAllSessions(accessToken string, realmName, userID string) error

LogoutAllSessions of the user.

func (*Client) LowerExecutionPriority

func (c *Client) LowerExecutionPriority(accessToken string, realmName, executionID string) error

LowerExecutionPriority lowers the execution’s priority.

func (*Client) MoveAfter

func (c *Client) MoveAfter(accessToken string, realmName string, userID string, credentialID string, previousCredentialID string) error

MoveAfter moves the credential after the specified one into the list

func (*Client) MoveToFirst

func (c *Client) MoveToFirst(accessToken string, realmName string, userID string, credentialID string) error

MoveToFirst moves the credential at the top of the list

func (*Client) RaiseExecutionPriority

func (c *Client) RaiseExecutionPriority(accessToken string, realmName, executionID string) error

RaiseExecutionPriority raise the execution’s priority.

func (*Client) RegisterRequiredAction

func (c *Client) RegisterRequiredAction(accessToken string, realmName, providerID, name string) error

RegisterRequiredAction register a new required action.

func (*Client) RemoveClientRole

func (c *Client) RemoveClientRole(accessToken string, realmName string, groupID string, clientID string, roles []keycloak.RoleRepresentation) error

RemoveClientRole deletes client roles from a specific group

func (*Client) ResetPapercardFailures

func (c *Client) ResetPapercardFailures(accessToken, realmName, userID, credentialID string) error

ResetPapercardFailures reset failures information in a paper card credential

func (*Client) ResetPassword

func (c *Client) ResetPassword(accessToken string, realmName, userID string, cred keycloak.CredentialRepresentation) error

ResetPassword resets password of the user.

func (*Client) SendConsentCodeSMS

func (c *Client) SendConsentCodeSMS(accessToken string, realmName string, userID string) error

SendConsentCodeSMS sends an SMS to a user with a consent code

func (*Client) SendEmail

func (c *Client) SendEmail(accessToken string, reqRealmName string, realmName string, emailRep keycloak.EmailRepresentation) error

SendEmail sends an email to a user

func (*Client) SendEmailToUser added in v2.6.0

func (c *Client) SendEmailToUser(accessToken string, reqRealmName string, realmName string, userID string, emailRep keycloak.EmailRepresentation) error

SendEmailToUser sends an email to the user specified by the UserID

func (*Client) SendPaperCardsReminders

func (c *Client) SendPaperCardsReminders(accessToken, realmName string, firstReminderDays, nextReminderDays, maxCount int) (bool, error)

SendPaperCardsReminders sends reminders to users of paper cards which will soon be expired

func (*Client) SendReminderEmail

func (c *Client) SendReminderEmail(accessToken string, realmName string, userID string, paramKV ...string) error

SendReminderEmail sends a reminder email to a user

func (*Client) SendSMS

func (c *Client) SendSMS(accessToken string, realmName string, smsRep keycloak.SMSRepresentation) error

SendSMS sends an SMS to a user

func (*Client) SendSmsCode

func (c *Client) SendSmsCode(accessToken string, realmName string, userID string) (keycloak.SmsCodeRepresentation, error)

SendSmsCode sends a SMS code and return it

func (*Client) UpdateAuthenticationExecution

func (c *Client) UpdateAuthenticationExecution(accessToken string, realmName, executionID string, authConfig keycloak.AuthenticatorConfigRepresentation) error

UpdateAuthenticationExecution update execution with new configuration.

func (*Client) UpdateAuthenticationExecutionForFlow

func (c *Client) UpdateAuthenticationExecutionForFlow(accessToken string, realmName, flowAlias string, authExecInfo keycloak.AuthenticationExecutionInfoRepresentation) error

UpdateAuthenticationExecutionForFlow updates the authentication executions of a flow.

func (*Client) UpdateAuthenticatorConfig

func (c *Client) UpdateAuthenticatorConfig(accessToken string, realmName, configID string, config keycloak.AuthenticatorConfigRepresentation) error

UpdateAuthenticatorConfig updates the authenticator configuration.

func (*Client) UpdateClient

func (c *Client) UpdateClient(accessToken string, realmName, idClient string, clientRep keycloak.ClientRepresentation) error

UpdateClient updates the client. idClient is the id of client (not client-id).

func (*Client) UpdateIdp added in v2.6.3

func (c *Client) UpdateIdp(accessToken string, realmName, idpAlias string, idpRep keycloak.IdentityProviderRepresentation) error

UpdateIdp updates the identity provider. idpAlias is the alias of identity provider.

func (*Client) UpdateLabelCredential

func (c *Client) UpdateLabelCredential(accessToken string, realmName string, userID string, credentialID string, label string) error

UpdateLabelCredential updates the label of credential

func (*Client) UpdatePassword

func (c *Client) UpdatePassword(accessToken, realm, currentPassword, newPassword, confirmPassword string) (string, error)

UpdatePassword updates the user's password Parameters: realm, currentPassword, newPassword, confirmPassword

func (*Client) UpdateRealm

func (c *Client) UpdateRealm(accessToken string, realmName string, realm keycloak.RealmRepresentation) error

UpdateRealm update the top lovel information of the realm. Any user, role or client information from the realm representation will be ignored.

func (*Client) UpdateRequiredAction

func (c *Client) UpdateRequiredAction(accessToken string, realmName, actionAlias string, action keycloak.RequiredActionProviderRepresentation) error

UpdateRequiredAction updates the required action.

func (*Client) UpdateRole added in v2.5.4

func (c *Client) UpdateRole(accessToken string, realmName string, roleID string, role keycloak.RoleRepresentation) error

UpdateRole updates a role in a realm

func (*Client) UpdateUser

func (c *Client) UpdateUser(accessToken string, realmName, userID string, user keycloak.UserRepresentation) error

UpdateUser updates the user.

func (*Client) UploadCertificate

func (c *Client) UploadCertificate(accessToken string, realmName, idClient, attr string, file []byte) (keycloak.CertificateRepresentation, error)

UploadCertificate uploads only a certificate, not the private key.

func (*Client) UploadCertificatePrivateKey

func (c *Client) UploadCertificatePrivateKey(accessToken string, realmName, idClient, attr string, file []byte) (keycloak.CertificateRepresentation, error)

UploadCertificatePrivateKey uploads a certificate and eventually a private key.

func (*Client) VerifyToken

func (c *Client) VerifyToken(issuer string, realmName string, accessToken string) error

VerifyToken verifies a token. It returns an error it is malformed, expired,...

type RemindersResponse

type RemindersResponse struct {
	Partial bool `json:"partial"`
}

RemindersResponse struct

type Token

type Token struct {
	Issuer         string `json:"iss,omitempty"`
	Subject        string `json:"sub,omitempty"`
	ExpirationTime int64  `json:"exp,omitempty"`
	NotBefore      int64  `json:"nbf,omitempty"`
	IssuedAt       int64  `json:"iat,omitempty"`
	ID             string `json:"jti,omitempty"`
	Username       string `json:"preferred_username,omitempty"`
	// contains filtered or unexported fields
}

Token is JWT token. We need to define our own structure as the library define aud as a string but it can also be a string array. To fix this issue, we remove aud as we do not use it here.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL