Documentation
¶
Index ¶
- func GetQueryParams(s interface{}) (map[string]string, error)
- type APIError
- type Access
- type ActiveKeys
- type Attributes
- type CertResponse
- type CertResponseKey
- type Client
- type ClientMappingsRepresentation
- type ClientScope
- type ClientScopeAttributes
- type Component
- type ComponentConfig
- type CredentialRepresentation
- type ExecuteActionsEmail
- type GetClientsParams
- type GetGroupsParams
- type GetUsersParams
- type GoCloak
- type Group
- type IssuerResponse
- type JWT
- type Key
- type KeyStoreConfig
- type MappingsRepresentation
- type MultivaluedHashMap
- type ObjectAlreadyExists
- type ProtocolMappers
- type ProtocolMappersConfig
- type RealmRepresentation
- type RetrospecTokenResult
- type Role
- type SetPasswordRequest
- type User
- type UserGroup
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetQueryParams ¶
GetQueryParams converts the struct to map[string]string The fields tags must have `json:"<name>,string,omitempty"` format for all types, except strings The string fields must have: `json:"<name>,omitempty"`. The `json:"<name>,string,omitempty"` tag for string field will add additional double quotes. "string" tag allows to convert the non-string fields of a structure to map[string]string. "omitempty" allows to skip the fields with default values.
Types ¶
type Access ¶
type Access struct {
ManageGroupMembership bool `json:"manageGroupMembership,omitempty"`
View bool `json:"view,omitempty"`
MapRoles bool `json:"mapRoles,omitempty"`
Impersonate bool `json:"impersonate,omitempty"`
Manage bool `json:"manage,omitempty"`
}
Access represents access
type ActiveKeys ¶
type ActiveKeys struct {
HS256 string `json:"HS256,omitempty"`
RS256 string `json:"RS256,omitempty"`
AES string `json:"AES,omitempty"`
}
ActiveKeys holds the active keys
type Attributes ¶
type Attributes struct {
LDAPENTRYDN []string `json:"LDAP_ENTRY_DN,omitempty"`
LDAPID []string `json:"LDAP_ID,omitempty"`
}
Attributes holds Attributes
type CertResponse ¶
type CertResponse struct {
Keys []CertResponseKey `json:"keys,omitempty"`
}
CertResponse is returned by the certs endpoint
type CertResponseKey ¶
type CertResponseKey struct {
Kid string `json:"kid,omitempty"`
Kty string `json:"kty,omitempty"`
Alg string `json:"alg,omitempty"`
Use string `json:"use,omitempty"`
N string `json:"n,omitempty"`
E string `json:"e,omitempty"`
}
CertResponseKey is returned by the certs endpoint
type ClientMappingsRepresentation ¶
type ClientMappingsRepresentation struct {
ID string `json:"id,omitempty"`
Client string `json:"client,omitempty"`
Mappings []Role `json:"mappings,omitempty"`
}
ClientMappingsRepresentation is a client role mappings
type ClientScope ¶
type ClientScope struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Protocol string `json:"protocol,omitempty"`
ClientScopeAttributes ClientScopeAttributes `json:"attributes,omitempty"`
ProtocolMappers ProtocolMappers `json:"protocolMappers,omitempty"`
}
ClientScope is a ClientScope
type ClientScopeAttributes ¶
type ClientScopeAttributes struct {
ConsentScreenText string `json:"consent.screen.text,omitempty"`
DisplayOnConsentScreen string `json:"display.on.consent.screen,omitempty"`
}
ClientScopeAttributes are attributes of client scopes
type Component ¶
type Component struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
ProviderID string `json:"providerId,omitempty"`
ProviderType string `json:"providerType,omitempty"`
ParentID string `json:"parentId,omitempty"`
ComponentConfig ComponentConfig `json:"config,omitempty"`
SubType string `json:"subType,omitempty"`
}
Component is a component
type ComponentConfig ¶
type ComponentConfig struct {
Priority []string `json:"priority,omitempty"`
Algorithm []string `json:"algorithm,omitempty"`
}
ComponentConfig is a componentconfig
type CredentialRepresentation ¶
type CredentialRepresentation struct {
Algorithm string `json:"algorithm,omitempty"`
Config MultivaluedHashMap `json:"config,omitempty"`
Counter int32 `json:"counter,omitempty"`
CreatedDate int64 `json:"createdDate,omitempty"`
Device string `json:"device,omitempty"`
Digits int32 `json:"digits,omitempty"`
HashIterations int32 `json:"hashIterations,omitempty"`
HashedSaltedValue string `json:"hashedSaltedValue,omitempty"`
Period int32 `json:"period,omitempty"`
Salt string `json:"salt,omitempty"`
Temporary bool `json:"temporary,omitempty"`
Type string `json:"type,omitempty"`
Value string `json:"value,omitempty"`
}
CredentialRepresentation represents credentials
type ExecuteActionsEmail ¶
type ExecuteActionsEmail struct {
UserID string `json:"-,omitempty"`
ClientID string `json:"client_id,omitempty"`
Lifespan int `json:"lifespan,string,omitempty"`
RedirectURI string `json:"redirect_uri,omitempty"`
Actions []string `json:"-,omitempty"`
}
ExecuteActionsEmail represents parameters for executing action emails
type GetClientsParams ¶
type GetClientsParams struct {
ClientID string `json:"clientId,omitempty"`
ViewableOnly bool `json:"viewableOnly,string,omitempty"`
}
GetClientsParams represents the query parameters
type GetGroupsParams ¶
type GetGroupsParams struct {
First int `json:"first,string,omitempty"`
Max int `json:"max,string,omitempty"`
Search string `json:"search,omitempty"`
}
GetGroupsParams represents the optional parameters for getting groups
type GetUsersParams ¶
type GetUsersParams struct {
BriefRepresentation *bool `json:"briefRepresentation,string,omitempty"`
Email string `json:"email,omitempty"`
First int `json:"first,string,omitempty"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
Max int `json:"max,string,omitempty"`
Search string `json:"search,omitempty"`
Username string `json:"username,omitempty"`
}
GetUsersParams represents the optional parameters for getting users
type GoCloak ¶
type GoCloak interface {
// Login sends a request to the token endpoint using user and client credentials
Login(clientID string, clientSecret string, realm string, username string, password string) (*JWT, error)
// Logout sends a request to the logout endpoint using refresh token
Logout(clientID, clientSecret, realm, refreshToken string) error
// LoginClient sends a request to the token endpoint using client credentials
LoginClient(clientID, clientSecret, realm string) (*JWT, error)
// LoginAdmin login as admin
LoginAdmin(username, password, realm string) (*JWT, error)
// RequestPermisssion sends a request to the token endpoint with permission parameter
RequestPermission(clientID string, clientSecret string, realm string, username string, password string, permission string) (*JWT, error)
// RefreshToken used to refresh the token
RefreshToken(refreshToken string, clientID, clientSecret, realm string) (*JWT, error)
// DecodeAccessToken decodes the accessToken
DecodeAccessToken(accessToken string, realm string) (*jwt.Token, *jwt.MapClaims, error)
// DecodeAccessTokenCustomClaims decodes the accessToken and fills the given claims
DecodeAccessTokenCustomClaims(accessToken string, realm string, claims jwt.Claims) (*jwt.Token, error)
// DecodeAccessTokenCustomClaims calls the token introspection endpoint
RetrospectToken(accessToken string, clientID, clientSecret string, realm string) (*RetrospecTokenResult, error)
// GetIssuer calls the issuer endpoint for the given realm
GetIssuer(realm string) (*IssuerResponse, error)
// GetCerts gets the public keys for the given realm
GetCerts(realm string) (*CertResponse, error)
// GetUserInfo gets the user info for the given realm
GetUserInfo(accessToken string, realm string) (*UserInfo, error)
// ExecuteActionsEmail executes an actions email
ExecuteActionsEmail(token string, realm string, params ExecuteActionsEmail) error
// CreateGroup creates a new group
CreateGroup(accessToken string, realm string, group Group) error
// CreateClientRole creates a new role for a client
CreateClientRole(accessToken string, realm string, clientID string, role Role) error
// CreateClient creates a new client
CreateClient(accessToken string, realm string, clientID Client) error
// CreateClientScope creates a new clientScope
CreateClientScope(accessToken string, realm string, scope ClientScope) error
// CreateComponent creates a new component
CreateComponent(accessToken string, realm string, component Component) error
// UpdateGroup updates the given group
UpdateGroup(accessToken string, realm string, group Group) error
// UpdateRole updates the given role
UpdateRole(accessToken string, realm string, clientID string, role Role) error
// UpdateClient updates the given client
UpdateClient(accessToken string, realm string, clientID Client) error
// UpdateClientScope updates the given clientScope
UpdateClientScope(accessToken string, realm string, scope ClientScope) error
// DeleteComponent deletes the given component
DeleteComponent(accessToken string, realm, componentID string) error
// DeleteGroup deletes the given group
DeleteGroup(accessToken string, realm, groupID string) error
// DeleteClientRole deletes the given role
DeleteClientRole(accessToken string, realm, clientID, roleName string) error
// DeleteClient deletes the given client
DeleteClient(accessToken string, realm, clientID string) error
// DeleteClientScope
DeleteClientScope(accessToken string, realm, scopeID string) error
// GetClient returns a client
GetClient(accessToken string, realm string, clientID string) (*Client, error)
// GetClientSecret returns a client's secret
GetClientSecret(token string, realm string, clientID string) (*CredentialRepresentation, error)
// GetKeyStoreConfig gets the keyStoreConfig
GetKeyStoreConfig(accessToken string, realm string) (*KeyStoreConfig, error)
// GetComponents gets components of the given realm
GetComponents(accessToken string, realm string) (*[]Component, error)
// GetGroups gets all groups of the given realm
GetGroups(accessToken string, realm string, params GetGroupsParams) (*[]Group, error)
// GetGroup gets the given group
GetGroup(accessToken string, realm, groupID string) (*Group, error)
// GetRoleMappingByGroupID gets the rolemapping for the given group id
GetRoleMappingByGroupID(accessToken string, realm string, groupID string) (*MappingsRepresentation, error)
// GetRoleMappingByUserID gets the rolemapping for the given user id
GetRoleMappingByUserID(accessToken string, realm string, userID string) (*MappingsRepresentation, error)
// GetClientRoles gets roles for the given client
GetClientRoles(accessToken string, realm string, clientID string) (*[]Role, error)
// GetClientRole get a role for the given client in a realm by role name
GetClientRole(token string, realm string, clientID string, roleName string) (*Role, error)
// GetClients gets the clients in the realm
GetClients(accessToken string, realm string, params GetClientsParams) (*[]Client, error)
// UserAttributeContains checks if the given attribute has the given value
UserAttributeContains(attributes map[string][]string, attribute string, value string) bool
// CreateRealmRole creates a role in a realm
CreateRealmRole(token string, realm string, role Role) error
// GetRealmRole returns a role from a realm by role's name
GetRealmRole(token string, realm string, roleName string) (*Role, error)
// GetRealmRoles get all roles of the given realm. It's an alias for the GetRoles function
GetRealmRoles(accessToken string, realm string) (*[]Role, error)
// GetRealmRolesByUserID returns all roles assigned to the given user
GetRealmRolesByUserID(accessToken string, realm string, userID string) (*[]Role, error)
// GetRealmRolesByGroupID returns all roles assigned to the given group
GetRealmRolesByGroupID(accessToken string, realm string, groupID string) (*[]Role, error)
// UpdateRealmRole updates a role in a realm
UpdateRealmRole(token string, realm string, roleName string, role Role) error
// DeleteRealmRole deletes a role in a realm by role's name
DeleteRealmRole(token string, realm string, roleName string) error
// AddRealmRoleToUser adds realm-level role mappings
AddRealmRoleToUser(token string, realm string, userID string, roles []Role) error
// DeleteRealmRoleFromUser deletes realm-level role mappings
DeleteRealmRoleFromUser(token string, realm string, userID string, roles []Role) error
// AddRealmRoleComposite adds roles as composite
AddRealmRoleComposite(token string, realm string, roleName string, roles []Role) error
// AddRealmRoleComposite adds roles as composite
DeleteRealmRoleComposite(token string, realm string, roleName string, roles []Role) error
// GetRealm returns top-level representation of the realm
GetRealm(token string, realm string) (*RealmRepresentation, error)
// CreateRealm creates a realm
CreateRealm(token string, realm RealmRepresentation) error
// DeleteRealm removes a realm
DeleteRealm(token string, realm string) error
// *** Users ***
// CreateUser creates a new user
CreateUser(token string, realm string, user User) (*string, error)
// DeleteUser deletes the given user
DeleteUser(accessToken string, realm, userID string) error
// GetUserByID gets the user with the given id
GetUserByID(accessToken string, realm string, userID string) (*User, error)
// GetUser count returns the userCount of the given realm
GetUserCount(accessToken string, realm string) (int, error)
// GetUsers gets all users of the given realm
GetUsers(accessToken string, realm string, params GetUsersParams) (*[]User, error)
// GetUserGroups gets the groups of the given user
GetUserGroups(accessToken string, realm string, userID string) (*[]UserGroup, error)
// GetUsersByRoleName returns all users have a given role
GetUsersByRoleName(token string, realm string, roleName string) (*[]User, error)
// SetPassword sets a new password for the user with the given id. Needs elevated privileges
SetPassword(token string, userID string, realm string, password string, temporary bool) error
// UpdateUser updates the given user
UpdateUser(accessToken string, realm string, user User) error
// AddUserToGroup puts given user to given group
AddUserToGroup(token string, realm string, userID string, groupID string) error
// DeleteUserFromGroup deletes given user from given group
DeleteUserFromGroup(token string, realm string, userID string, groupID string) error
}
GoCloak holds all methods a client should fulfill
type Group ¶
type Group struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
SubGroups []interface{} `json:"subGroups,omitempty"`
}
Group is a Group
type IssuerResponse ¶
type IssuerResponse struct {
Realm string `json:"realm,omitempty"`
PublicKey string `json:"public_key,omitempty"`
TokenService string `json:"token-service,omitempty"`
AccountService string `json:"account-service,omitempty"`
TokensNotBefore int `json:"tokens-not-before,omitempty"`
}
IssuerResponse is returned by the issuer endpoint
type JWT ¶
type JWT struct {
AccessToken string `json:"access_token"`
ExpiresIn int `json:"expires_in"`
RefreshExpiresIn int `json:"refresh_expires_in"`
RefreshToken string `json:"refresh_token"`
TokenType string `json:"token_type"`
NotBeforePolicy int `json:"not-before-policy"`
SessionState string `json:"session_state"`
Scope string `json:"scope"`
}
JWT is a JWT
type Key ¶
type Key struct {
ProviderID string `json:"providerId,omitempty"`
ProviderPriority int `json:"providerPriority,omitempty"`
Kid string `json:"kid,omitempty"`
Status string `json:"status,omitempty"`
Type string `json:"type,omitempty"`
Algorithm string `json:"algorithm,omitempty"`
PublicKey string `json:"publicKey,omitempty"`
Certificate string `json:"certificate,omitempty"`
}
Key is a key
type KeyStoreConfig ¶
type KeyStoreConfig struct {
ActiveKeys ActiveKeys `json:"active,omitempty"`
Key []Key `json:"keys,omitempty"`
}
KeyStoreConfig holds the keyStoreConfig
type MappingsRepresentation ¶
type MappingsRepresentation struct {
ClientMappings map[string]ClientMappingsRepresentation `json:"clientMappings,omitempty"`
RealmMappings []Role `json:"realmMappings,omitempty"`
}
MappingsRepresentation is a representation of role mappings
type MultivaluedHashMap ¶
type MultivaluedHashMap struct {
Empty bool `json:"empty,omitempty"`
LoadFactor float32 `json:"loadFactor,omitempty"`
Threshold int32 `json:"threshold,omitempty"`
}
MultivaluedHashMap represents something
type ObjectAlreadyExists ¶
type ObjectAlreadyExists struct{}
ObjectAllreadyExists is used when keycloak answers with 409
func (*ObjectAlreadyExists) Error ¶
func (o *ObjectAlreadyExists) Error() string
type ProtocolMappers ¶
type ProtocolMappers struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Protocol string `json:"protocol,omitempty"`
ProtocolMapper string `json:"protocolMapper,omitempty"`
ConsentRequired bool `json:"consentRequired,omitempty"`
ProtocolMappersConfig ProtocolMappersConfig `json:"config,omitempty"`
}
ProtocolMappers are protocolmappers
type ProtocolMappersConfig ¶
type ProtocolMappersConfig struct {
UserinfoTokenClaim string `json:"userinfo.token.claim,omitempty"`
UserAttribute string `json:"user.attribute,omitempty"`
IDTokenClaim string `json:"id.token.claim,omitempty"`
AccessTokenClaim string `json:"access.token.claim,omitempty"`
ClaimName string `json:"claim.name,omitempty"`
JSONTypeLabel string `json:"jsonType.label,omitempty"`
}
ProtocolMappersConfig is a config of a protocol mapper
type RealmRepresentation ¶
type RealmRepresentation struct {
AccessCodeLifespan int `json:"accessCodeLifespan,omitempty"`
AccessCodeLifespanLogin int `json:"accessCodeLifespanLogin,omitempty"`
AccessCodeLifespanUserAction int `json:"accessCodeLifespanUserAction,omitempty"`
AccessTokenLifespan int `json:"accessTokenLifespan,omitempty"`
AccessTokenLifespanForImplicitFlow int `json:"accessTokenLifespanForImplicitFlow,omitempty"`
AccountTheme string `json:"accountTheme,omitempty"`
ActionTokenGeneratedByAdminLifespan int `json:"actionTokenGeneratedByAdminLifespan,omitempty"`
ActionTokenGeneratedByUserLifespan int `json:"actionTokenGeneratedByUserLifespan,omitempty"`
AdminEventsDetailsEnabled bool `json:"adminEventsDetailsEnabled,omitempty"`
AdminEventsEnabled bool `json:"adminEventsEnabled,omitempty"`
AdminTheme string `json:"adminTheme,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
AuthenticationFlows []interface{} `json:"authenticationFlows,omitempty"`
AuthenticatorConfig []interface{} `json:"authenticatorConfig,omitempty"`
BrowserFlow string `json:"browserFlow,omitempty"`
BrowserSecurityHeaders map[string]string `json:"browserSecurityHeaders,omitempty"`
BruteForceProtected bool `json:"bruteForceProtected,omitempty"`
ClientAuthenticationFlow string `json:"clientAuthenticationFlow,omitempty"`
ClientScopeMappings map[string]string `json:"clientScopeMappings,omitempty"`
ClientScopes []interface{} `json:"clientScopes,omitempty"`
Clients []interface{} `json:"clients,omitempty"`
Components interface{} `json:"components,omitempty"`
DefaultDefaultClientScopes []string `json:"defaultDefaultClientScopes,omitempty"`
DefaultGroups []string `json:"defaultGroups,omitempty"`
DefaultLocale string `json:"defaultLocale,omitempty"`
DefaultOptionalClientScopes []string `json:"defaultOptionalClientScopes,omitempty"`
DefaultRoles []string `json:"defaultRoles,omitempty"`
DefaultSignatureAlgorithm string `json:"defaultSignatureAlgorithm,omitempty"`
DirectGrantFlow string `json:"directGrantFlow,omitempty"`
DisplayName string `json:"displayName,omitempty"`
DisplayNameHTML string `json:"displayNameHtml,omitempty"`
DockerAuthenticationFlow string `json:"dockerAuthenticationFlow,omitempty"`
DuplicateEmailsAllowed bool `json:"duplicateEmailsAllowed,omitempty"`
EditUsernameAllowed bool `json:"editUsernameAllowed,omitempty"`
EmailTheme string `json:"emailTheme,omitempty"`
Enabled bool `json:"enabled,omitempty"`
EnabledEventTypes []string `json:"enabledEventTypes,omitempty"`
EventsEnabled bool `json:"eventsEnabled,omitempty"`
EventsExpiration int64 `json:"eventsExpiration,omitempty"`
EventsListeners []string `json:"eventsListeners,omitempty"`
FailureFactor int `json:"failureFactor,omitempty"`
FederatedUsers []interface{} `json:"federatedUsers,omitempty"`
Groups []interface{} `json:"groups,omitempty"`
ID string `json:"id,omitempty"`
IdentityProviderMappers []interface{} `json:"identityProviderMappers,omitempty"`
IdentityProviders []interface{} `json:"identityProviders,omitempty"`
InternationalizationEnabled bool `json:"internationalizationEnabled,omitempty"`
KeycloakVersion string `json:"keycloakVersion,omitempty"`
LoginTheme string `json:"loginTheme,omitempty"`
LoginWithEmailAllowed bool `json:"loginWithEmailAllowed,omitempty"`
MaxDeltaTimeSeconds int `json:"maxDeltaTimeSeconds,omitempty"`
MaxFailureWaitSeconds int `json:"maxFailureWaitSeconds,omitempty"`
MinimumQuickLoginWaitSeconds int `json:"minimumQuickLoginWaitSeconds,omitempty"`
NotBefore int `json:"notBefore,omitempty"`
OfflineSessionIdleTimeout int `json:"offlineSessionIdleTimeout,omitempty"`
OfflineSessionMaxLifespan int `json:"offlineSessionMaxLifespan,omitempty"`
OfflineSessionMaxLifespanEnabled bool `json:"offlineSessionMaxLifespanEnabled,omitempty"`
OtpPolicyAlgorithm string `json:"otpPolicyAlgorithm,omitempty"`
OtpPolicyDigits int `json:"otpPolicyDigits,omitempty"`
OtpPolicyInitialCounter int `json:"otpPolicyInitialCounter,omitempty"`
OtpPolicyLookAheadWindow int `json:"otpPolicyLookAheadWindow,omitempty"`
OtpPolicyPeriod int `json:"otpPolicyPeriod,omitempty"`
OtpPolicyType string `json:"otpPolicyType,omitempty"`
OtpSupportedApplications []string `json:"otpSupportedApplications,omitempty"`
PasswordPolicy string `json:"passwordPolicy,omitempty"`
PermanentLockout bool `json:"permanentLockout,omitempty"`
ProtocolMappers []interface{} `json:"protocolMappers,omitempty"`
QuickLoginCheckMilliSeconds int64 `json:"quickLoginCheckMilliSeconds,omitempty"`
Realm string `json:"realm,omitempty"`
RefreshTokenMaxReuse int `json:"refreshTokenMaxReuse,omitempty"`
RegistrationAllowed bool `json:"registrationAllowed,omitempty"`
RegistrationEmailAsUsername bool `json:"registrationEmailAsUsername,omitempty"`
RegistrationFlow string `json:"registrationFlow,omitempty"`
RememberMe bool `json:"rememberMe,omitempty"`
RequiredActions []interface{} `json:"requiredActions,omitempty"`
ResetCredentialsFlow string `json:"resetCredentialsFlow,omitempty"`
ResetPasswordAllowed bool `json:"resetPasswordAllowed,omitempty"`
RevokeRefreshToken bool `json:"revokeRefreshToken,omitempty"`
Roles interface{} `json:"roles,omitempty"`
ScopeMappings []interface{} `json:"scopeMappings,omitempty"`
SMTPServer map[string]string `json:"smtpServer,omitempty"`
SslRequired string `json:"sslRequired,omitempty"`
SsoSessionIdleTimeout int `json:"ssoSessionIdleTimeout,omitempty"`
SsoSessionIdleTimeoutRememberMe int `json:"ssoSessionIdleTimeoutRememberMe,omitempty"`
SsoSessionMaxLifespan int `json:"ssoSessionMaxLifespan,omitempty"`
SsoSessionMaxLifespanRememberMe int `json:"ssoSessionMaxLifespanRememberMe,omitempty"`
SupportedLocales []string `json:"supportedLocales,omitempty"`
UserFederationMappers []interface{} `json:"userFederationMappers,omitempty"`
UserFederationProviders []interface{} `json:"userFederationProviders,omitempty"`
UserManagedAccessAllowed bool `json:"userManagedAccessAllowed,omitempty"`
Users []interface{} `json:"users,omitempty"`
VerifyEmail bool `json:"verifyEmail,omitempty"`
WaitIncrementSeconds int `json:"waitIncrementSeconds,omitempty"`
}
RealmRepresentation represent a realm
type RetrospecTokenResult ¶
type RetrospecTokenResult struct {
Permissions map[string]string `json:"permissions,omitempty"`
Exp int `json:"exp,omitempty"`
Nbf int `json:"nbf,omitempty"`
Iat int `json:"iat,omitempty"`
Aud string `json:"aud,omitempty"`
Active bool `json:"active,omitempty"`
AuthTime int `json:"auth_time,omitempty"`
Jti string `json:"jti,omitempty"`
Type string `json:"typ,omitempty"`
}
RetrospecTokenResult is returned when a token was checked
type Role ¶
type Role struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
ScopeParamRequired bool `json:"scopeParamRequired,omitempty"`
Composite bool `json:"composite,omitempty"`
ClientRole bool `json:"clientRole,omitempty"`
ContainerID string `json:"containerId,omitempty"`
Description string `json:"description,omitempty"`
Attributes map[string][]string `json:"attributes,omitempty"`
}
Role is a role
type SetPasswordRequest ¶
type SetPasswordRequest struct {
Type string `json:"type,omitempty"`
Temporary bool `json:"temporary,omitempty"`
Password string `json:"value,omitempty"`
}
SetPasswordRequest sets a new password
type User ¶
type User struct {
ID string `json:"id,omitempty"`
CreatedTimestamp int64 `json:"createdTimestamp,omitempty"`
Username string `json:"username,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Totp bool `json:"totp,omitempty"`
EmailVerified bool `json:"emailVerified,omitempty"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
Email string `json:"email,omitempty"`
FederationLink string `json:"federationLink,omitempty"`
Attributes map[string][]string `json:"attributes,omitempty"`
DisableableCredentialTypes []interface{} `json:"disableableCredentialTypes,omitempty"`
RequiredActions []interface{} `json:"requiredActions,omitempty"`
Access map[string]bool `json:"access,omitempty"`
}
User represents the Keycloak User Structure
type UserGroup ¶
type UserGroup struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
}
UserGroup is a UserGroup
type UserInfo ¶
type UserInfo struct {
Sub string `json:"sub,omitempty"`
EmailVerified bool `json:"email_verified,omitempty"`
Address interface{} `json:"address,omitempty"`
PreferredUsername string `json:"preferred_username,omitempty"`
Email string `json:"email,omitempty"`
}
UserInfo is returned by the userinfo endpoint