keycloak

package
v0.0.0-...-952d776 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorIs404

func ErrorIs404(err error) bool

func GetDurationStringFromMilliseconds

func GetDurationStringFromMilliseconds(milliseconds string) (string, error)

Converts a string representing milliseconds from Keycloak API to a duration string used by the provider Ex: "3600000" => "1h0m0s"

Types

type ApiError

type ApiError struct {
	Code    int
	Message string
}

func (*ApiError) Error

func (e *ApiError) Error() string

type Attributes

type Attributes struct {
	BrowserHeaderContentSecurityPolicy           string `json:"_browser_header.contentSecurityPolicy,omitempty"`
	BrowserHeaderContentSecurityPolicyReportOnly string `json:"_browser_header.contentSecurityPolicyReportOnly,omitempty"`
	BrowserHeaderStrictTransportSecurity         string `json:"_browser_header.strictTransportSecurity,omitempty"`
	BrowserHeaderXContentTypeOptions             string `json:"_browser_header.xContentTypeOptions,omitempty"`
	BrowserHeaderXFrameOptions                   string `json:"_browser_header.xFrameOptions,omitempty"`
	BrowserHeaderXRobotsTag                      string `json:"_browser_header.xRobotsTag,omitempty"`
	BrowserHeaderXXSSProtection                  string `json:"_browser_header.xXSSProtection,omitempty"`
}

type ClientCredentials

type ClientCredentials struct {
	ClientId     string
	ClientSecret string
	Username     string
	Password     string
	GrantType    string
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	TokenType    string `json:"token_type"`
}

type ComponentType

type ComponentType struct {
	Id string `json:"id"`
}

type CustomUserFederation

type CustomUserFederation struct {
	Id         string
	Name       string
	RealmId    string
	ProviderId string

	Enabled  bool
	Priority int

	CachePolicy string

	Config map[string][]string
}

type FederatedIdentities

type FederatedIdentities []FederatedIdentity

type FederatedIdentity

type FederatedIdentity struct {
	IdentityProvider string `json:"identityProvider"`
	UserId           string `json:"userId"`
	UserName         string `json:"userName"`
}

type GenericClient

type GenericClient struct {
	Id       string `json:"id,omitempty"`
	ClientId string `json:"clientId"`
	RealmId  string `json:"-"`
	Name     string `json:"name"`
	Protocol string `json:"protocol"`

	Enabled     bool   `json:"enabled"`
	Description string `json:"description"`
}

type GenericClientProtocolMapper

type GenericClientProtocolMapper struct {
	ClientId       string            `json:"-"`
	Config         map[string]string `json:"config"`
	Id             string            `json:"id,omitempty"`
	Name           string            `json:"name"`
	Protocol       string            `json:"protocol"`
	ProtocolMapper string            `json:"protocolMapper"`
	RealmId        string            `json:"-"`
}

type Group

type Group struct {
	Id          string              `json:"id,omitempty"`
	RealmId     string              `json:"-"`
	ParentId    string              `json:"-"`
	Name        string              `json:"name"`
	Path        string              `json:"path,omitempty"`
	SubGroups   []*Group            `json:"subGroups,omitempty"`
	RealmRoles  []string            `json:"realmRoles,omitempty"`
	ClientRoles map[string][]string `json:"clientRoles,omitempty"`
}

type IdentityProvider

type IdentityProvider struct {
	Realm                     string                  `json:"-"`
	InternalId                string                  `json:"internalId,omitempty"`
	Alias                     string                  `json:"alias"`
	DisplayName               string                  `json:"displayName"`
	ProviderId                string                  `json:"providerId"`
	Enabled                   bool                    `json:"enabled"`
	StoreToken                bool                    `json:"storeToken"`
	AddReadTokenRoleOnCreate  bool                    `json:"addReadTokenRoleOnCreate"`
	AuthenticateByDefault     bool                    `json:"authenticateByDefault"`
	LinkOnly                  bool                    `json:"linkOnly"`
	TrustEmail                bool                    `json:"trustEmail"`
	FirstBrokerLoginFlowAlias string                  `json:"firstBrokerLoginFlowAlias"`
	PostBrokerLoginFlowAlias  string                  `json:"postBrokerLoginFlowAlias"`
	Config                    *IdentityProviderConfig `json:"config"`
}

type IdentityProviderConfig

type IdentityProviderConfig struct {
	Key                              string                 `json:"key,omitempty"`
	HostIp                           string                 `json:"hostIp,omitempty"`
	UseJwksUrl                       KeycloakBoolQuoted     `json:"useJwksUrl,omitempty"`
	JwksUrl                          string                 `json:"jwksUrl,omitempty"`
	ClientId                         string                 `json:"clientId,omitempty"`
	ClientSecret                     string                 `json:"clientSecret,omitempty"`
	DisableUserInfo                  KeycloakBoolQuoted     `json:"disableUserInfo"`
	UserInfoUrl                      string                 `json:"userInfoUrl,omitempty"`
	HideOnLoginPage                  KeycloakBoolQuoted     `json:"hideOnLoginPage"`
	NameIDPolicyFormat               string                 `json:"nameIDPolicyFormat,omitempty"`
	SingleLogoutServiceUrl           string                 `json:"singleLogoutServiceUrl,omitempty"`
	SingleSignOnServiceUrl           string                 `json:"singleSignOnServiceUrl,omitempty"`
	SigningCertificate               string                 `json:"signingCertificate,omitempty"`
	SignatureAlgorithm               string                 `json:"signatureAlgorithm,omitempty"`
	XmlSignKeyInfoKeyNameTransformer string                 `json:"xmlSignKeyInfoKeyNameTransformer,omitempty"`
	PostBindingAuthnRequest          KeycloakBoolQuoted     `json:"postBindingAuthnRequest,omitempty"`
	PostBindingResponse              KeycloakBoolQuoted     `json:"postBindingResponse,omitempty"`
	PostBindingLogout                KeycloakBoolQuoted     `json:"postBindingLogout,omitempty"`
	ForceAuthn                       KeycloakBoolQuoted     `json:"forceAuthn,omitempty"`
	WantAuthnRequestsSigned          KeycloakBoolQuoted     `json:"wantAuthnRequestsSigned,omitempty"`
	WantAssertionsSigned             KeycloakBoolQuoted     `json:"wantAssertionsSigned,omitempty"`
	WantAssertionsEncrypted          KeycloakBoolQuoted     `json:"wantAssertionsEncrypted,omitempty"`
	BackchannelSupported             KeycloakBoolQuoted     `json:"backchannelSupported,omitempty"`
	ValidateSignature                KeycloakBoolQuoted     `json:"validateSignature,omitempty"`
	AuthorizationUrl                 string                 `json:"authorizationUrl,omitempty"`
	TokenUrl                         string                 `json:"tokenUrl,omitempty"`
	LoginHint                        string                 `json:"loginHint,omitempty"`
	UILocales                        KeycloakBoolQuoted     `json:"uiLocales,omitempty"`
	LogoutUrl                        string                 `json:"logoutUrl,omitempty"`
	ExtraConfig                      map[string]interface{} `json:"-"`
}

func (*IdentityProviderConfig) MarshalJSON

func (f *IdentityProviderConfig) MarshalJSON() ([]byte, error)

func (*IdentityProviderConfig) UnmarshalJSON

func (f *IdentityProviderConfig) UnmarshalJSON(data []byte) error

type IdentityProviderMapper

type IdentityProviderMapper struct {
	Realm                  string                        `json:"-"`
	Provider               string                        `json:"-"`
	Id                     string                        `json:"id,omitempty"`
	Name                   string                        `json:"name,omitempty"`
	IdentityProviderAlias  string                        `json:"identityProviderAlias,omitempty"`
	IdentityProviderMapper string                        `json:"identityProviderMapper,omitempty"`
	Config                 *IdentityProviderMapperConfig `json:"config,omitempty"`
}

type IdentityProviderMapperConfig

type IdentityProviderMapperConfig struct {
	UserAttribute         string `json:"user.attribute,omitempty"`
	Claim                 string `json:"claim,omitempty"`
	ClaimValue            string `json:"claim.value,omitempty"`
	HardcodedAttribute    string `json:"attribute,omitempty"`
	Attribute             string `json:"attribute.name,omitempty"`
	AttributeValue        string `json:"attribute.value,omitempty"`
	AttributeFriendlyName string `json:"attribute.friendly.name,omitempty"`
	Template              string `json:"template,omitempty"`
	Role                  string `json:"role,omitempty"`
}

type Key

type Key struct {
	Algorithm        *string `json:"algorithm,omitempty"`
	Certificate      *string `json:"certificate,omitempty"`
	ProviderId       *string `json:"providerId,omitempty"`
	ProviderPriority *int    `json:"providerPriority,omitempty"`
	PublicKey        *string `json:"publicKey,omitempty"`
	Kid              *string `json:"kid,omitempty"`
	Status           *string `json:"status,omitempty"`
	Type             *string `json:"type,omitempty"`
}

type KeycloakBoolQuoted

type KeycloakBoolQuoted bool

func (KeycloakBoolQuoted) MarshalJSON

func (c KeycloakBoolQuoted) MarshalJSON() ([]byte, error)

func (*KeycloakBoolQuoted) UnmarshalJSON

func (c *KeycloakBoolQuoted) UnmarshalJSON(in []byte) error

type KeycloakClient

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

func NewKeycloakClient

func NewKeycloakClient(baseUrl, clientId, clientSecret, realm, username, password string, initialLogin bool, clientTimeout int) (*KeycloakClient, error)

func (*KeycloakClient) AddClientRolesToGroup

func (keycloakClient *KeycloakClient) AddClientRolesToGroup(realmId, groupId, clientId string, roles []*Role) error

func (*KeycloakClient) AddCompositesToRole

func (keycloakClient *KeycloakClient) AddCompositesToRole(role *Role, compositeRoles []*Role) error

func (*KeycloakClient) AddRealmRolesToGroup

func (keycloakClient *KeycloakClient) AddRealmRolesToGroup(realmId, groupId string, roles []*Role) error

func (*KeycloakClient) AddUsersToGroup

func (keycloakClient *KeycloakClient) AddUsersToGroup(realmId, groupId string, users []interface{}) error

func (*KeycloakClient) AttachOpenidClientDefaultScopes

func (keycloakClient *KeycloakClient) AttachOpenidClientDefaultScopes(realmId, clientId string, scopeNames []string) error

func (*KeycloakClient) AttachOpenidClientOptionalScopes

func (keycloakClient *KeycloakClient) AttachOpenidClientOptionalScopes(realmId, clientId string, scopeNames []string) error

func (*KeycloakClient) CreateRequiredAction

func (keycloakClient *KeycloakClient) CreateRequiredAction(requiredAction *RequiredAction) error

func (*KeycloakClient) CreateRole

func (keycloakClient *KeycloakClient) CreateRole(role *Role) error

func (*KeycloakClient) DeleteCustomUserFederation

func (keycloakClient *KeycloakClient) DeleteCustomUserFederation(realmId, id string) error

func (*KeycloakClient) DeleteDefaultGroup

func (keycloakClient *KeycloakClient) DeleteDefaultGroup(realmName, groupId string) error

DeleteDefaultGroup deletes a group ID from the realm default groups.

func (*KeycloakClient) DeleteGenericClientProtocolMapper

func (keycloakClient *KeycloakClient) DeleteGenericClientProtocolMapper(realmId string, clientId string, id string) error

func (*KeycloakClient) DeleteGroup

func (keycloakClient *KeycloakClient) DeleteGroup(realmId, id string) error

func (*KeycloakClient) DeleteIdentityProvider

func (keycloakClient *KeycloakClient) DeleteIdentityProvider(realm, alias string) error

func (*KeycloakClient) DeleteIdentityProviderMapper

func (keycloakClient *KeycloakClient) DeleteIdentityProviderMapper(realm, alias, id string) error

func (*KeycloakClient) DeleteLdapFullNameMapper

func (keycloakClient *KeycloakClient) DeleteLdapFullNameMapper(realmId, id string) error

func (*KeycloakClient) DeleteLdapGroupMapper

func (keycloakClient *KeycloakClient) DeleteLdapGroupMapper(realmId, id string) error

func (*KeycloakClient) DeleteLdapMsadUserAccountControlMapper

func (keycloakClient *KeycloakClient) DeleteLdapMsadUserAccountControlMapper(realmId, id string) error

func (*KeycloakClient) DeleteLdapUserAttributeMapper

func (keycloakClient *KeycloakClient) DeleteLdapUserAttributeMapper(realmId, id string) error

func (*KeycloakClient) DeleteLdapUserFederation

func (keycloakClient *KeycloakClient) DeleteLdapUserFederation(realmId, id string) error

func (*KeycloakClient) DeleteOpenIdAudienceProtocolMapper

func (keycloakClient *KeycloakClient) DeleteOpenIdAudienceProtocolMapper(realmId, clientId, clientScopeId, mapperId string) error

func (*KeycloakClient) DeleteOpenIdFullNameProtocolMapper

func (keycloakClient *KeycloakClient) DeleteOpenIdFullNameProtocolMapper(realmId, clientId, clientScopeId, mapperId string) error

func (*KeycloakClient) DeleteOpenIdGroupMembershipProtocolMapper

func (keycloakClient *KeycloakClient) DeleteOpenIdGroupMembershipProtocolMapper(realmId, clientId, clientScopeId, mapperId string) error

func (*KeycloakClient) DeleteOpenIdHardcodedClaimProtocolMapper

func (keycloakClient *KeycloakClient) DeleteOpenIdHardcodedClaimProtocolMapper(realmId, clientId, clientScopeId, mapperId string) error

func (*KeycloakClient) DeleteOpenIdHardcodedRoleProtocolMapper

func (keycloakClient *KeycloakClient) DeleteOpenIdHardcodedRoleProtocolMapper(realmId, clientId, clientScopeId, mapperId string) error

func (*KeycloakClient) DeleteOpenIdUserAttributeProtocolMapper

func (keycloakClient *KeycloakClient) DeleteOpenIdUserAttributeProtocolMapper(realmId, clientId, clientScopeId, mapperId string) error

func (*KeycloakClient) DeleteOpenIdUserPropertyProtocolMapper

func (keycloakClient *KeycloakClient) DeleteOpenIdUserPropertyProtocolMapper(realmId, clientId, clientScopeId, mapperId string) error

func (*KeycloakClient) DeleteOpenIdUserRealmRoleProtocolMapper

func (keycloakClient *KeycloakClient) DeleteOpenIdUserRealmRoleProtocolMapper(realmId, clientId, clientScopeId, mapperId string) error

func (*KeycloakClient) DeleteOpenidClient

func (keycloakClient *KeycloakClient) DeleteOpenidClient(realmId, id string) error

func (*KeycloakClient) DeleteOpenidClientAuthorizationPermission

func (keycloakClient *KeycloakClient) DeleteOpenidClientAuthorizationPermission(realmId, resourceServerId, permissionId string) error

func (*KeycloakClient) DeleteOpenidClientAuthorizationResource

func (keycloakClient *KeycloakClient) DeleteOpenidClientAuthorizationResource(realmId, clientId, resourceId string) error

func (*KeycloakClient) DeleteOpenidClientAuthorizationScope

func (keycloakClient *KeycloakClient) DeleteOpenidClientAuthorizationScope(realmId, resourceServerId, scopeId string) error

func (*KeycloakClient) DeleteOpenidClientScope

func (keycloakClient *KeycloakClient) DeleteOpenidClientScope(realmId, id string) error

func (*KeycloakClient) DeleteOpenidClientServiceAccountRole

func (keycloakClient *KeycloakClient) DeleteOpenidClientServiceAccountRole(realm, serviceAccountUserId, clientId, roleId string) error

func (*KeycloakClient) DeleteRealm

func (keycloakClient *KeycloakClient) DeleteRealm(id string) error

func (*KeycloakClient) DeleteRequiredAction

func (keycloakClient *KeycloakClient) DeleteRequiredAction(realmName string, alias string) error

func (*KeycloakClient) DeleteRole

func (keycloakClient *KeycloakClient) DeleteRole(realmId, id string) error

func (*KeycloakClient) DeleteSamlClient

func (keycloakClient *KeycloakClient) DeleteSamlClient(realmId, id string) error

func (*KeycloakClient) DeleteSamlUserAttributeProtocolMapper

func (keycloakClient *KeycloakClient) DeleteSamlUserAttributeProtocolMapper(realmId, clientId, clientScopeId, mapperId string) error

func (*KeycloakClient) DeleteSamlUserPropertyProtocolMapper

func (keycloakClient *KeycloakClient) DeleteSamlUserPropertyProtocolMapper(realmId, clientId, clientScopeId, mapperId string) error

func (*KeycloakClient) DeleteUser

func (keycloakClient *KeycloakClient) DeleteUser(realmId, id string) error

func (*KeycloakClient) DetachOpenidClientDefaultScopes

func (keycloakClient *KeycloakClient) DetachOpenidClientDefaultScopes(realmId, clientId string, scopeNames []string) error

func (*KeycloakClient) DetachOpenidClientOptionalScopes

func (keycloakClient *KeycloakClient) DetachOpenidClientOptionalScopes(realmId, clientId string, scopeNames []string) error

func (*KeycloakClient) GetClientAuthorizationPolicyByName

func (keycloakClient *KeycloakClient) GetClientAuthorizationPolicyByName(realmId, resourceServerId, name string) (*OpenidClientAuthorizationPolicy, error)

func (*KeycloakClient) GetCustomUserFederation

func (keycloakClient *KeycloakClient) GetCustomUserFederation(realmId, id string) (*CustomUserFederation, error)

func (*KeycloakClient) GetDefaultGroups

func (keycloakClient *KeycloakClient) GetDefaultGroups(realmName string) ([]Group, error)

GetDefaultGroups returns all the default groups for a realm.

func (*KeycloakClient) GetGenericClientByClientId

func (keycloakClient *KeycloakClient) GetGenericClientByClientId(realmId, clientId string) (*GenericClient, error)

func (*KeycloakClient) GetGenericClientProtocolMapper

func (keycloakClient *KeycloakClient) GetGenericClientProtocolMapper(realmId string, clientId string, id string) (*GenericClientProtocolMapper, error)

func (*KeycloakClient) GetGroup

func (keycloakClient *KeycloakClient) GetGroup(realmId, id string) (*Group, error)

func (*KeycloakClient) GetGroupMembers

func (keycloakClient *KeycloakClient) GetGroupMembers(realmId, groupId string) ([]*User, error)

func (*KeycloakClient) GetIdentityProvider

func (keycloakClient *KeycloakClient) GetIdentityProvider(realm, alias string) (*IdentityProvider, error)

func (*KeycloakClient) GetIdentityProviderMapper

func (keycloakClient *KeycloakClient) GetIdentityProviderMapper(realm, alias, id string) (*IdentityProviderMapper, error)

func (*KeycloakClient) GetLdapFullNameMapper

func (keycloakClient *KeycloakClient) GetLdapFullNameMapper(realmId, id string) (*LdapFullNameMapper, error)

func (*KeycloakClient) GetLdapGroupMapper

func (keycloakClient *KeycloakClient) GetLdapGroupMapper(realmId, id string) (*LdapGroupMapper, error)

func (*KeycloakClient) GetLdapMsadUserAccountControlMapper

func (keycloakClient *KeycloakClient) GetLdapMsadUserAccountControlMapper(realmId, id string) (*LdapMsadUserAccountControlMapper, error)

func (*KeycloakClient) GetLdapUserAttributeMapper

func (keycloakClient *KeycloakClient) GetLdapUserAttributeMapper(realmId, id string) (*LdapUserAttributeMapper, error)

func (*KeycloakClient) GetLdapUserFederation

func (keycloakClient *KeycloakClient) GetLdapUserFederation(realmId, id string) (*LdapUserFederation, error)

func (*KeycloakClient) GetOpenIdAudienceProtocolMapper

func (keycloakClient *KeycloakClient) GetOpenIdAudienceProtocolMapper(realmId, clientId, clientScopeId, mapperId string) (*OpenIdAudienceProtocolMapper, error)

func (*KeycloakClient) GetOpenIdFullNameProtocolMapper

func (keycloakClient *KeycloakClient) GetOpenIdFullNameProtocolMapper(realmId, clientId, clientScopeId, mapperId string) (*OpenIdFullNameProtocolMapper, error)

func (*KeycloakClient) GetOpenIdGroupMembershipProtocolMapper

func (keycloakClient *KeycloakClient) GetOpenIdGroupMembershipProtocolMapper(realmId, clientId, clientScopeId, mapperId string) (*OpenIdGroupMembershipProtocolMapper, error)

func (*KeycloakClient) GetOpenIdHardcodedClaimProtocolMapper

func (keycloakClient *KeycloakClient) GetOpenIdHardcodedClaimProtocolMapper(realmId, clientId, clientScopeId, mapperId string) (*OpenIdHardcodedClaimProtocolMapper, error)

func (*KeycloakClient) GetOpenIdHardcodedRoleProtocolMapper

func (keycloakClient *KeycloakClient) GetOpenIdHardcodedRoleProtocolMapper(realmId, clientId, clientScopeId, mapperId string) (*OpenIdHardcodedRoleProtocolMapper, error)

func (*KeycloakClient) GetOpenIdUserAttributeProtocolMapper

func (keycloakClient *KeycloakClient) GetOpenIdUserAttributeProtocolMapper(realmId, clientId, clientScopeId, mapperId string) (*OpenIdUserAttributeProtocolMapper, error)

func (*KeycloakClient) GetOpenIdUserPropertyProtocolMapper

func (keycloakClient *KeycloakClient) GetOpenIdUserPropertyProtocolMapper(realmId, clientId, clientScopeId, mapperId string) (*OpenIdUserPropertyProtocolMapper, error)

func (*KeycloakClient) GetOpenIdUserRealmRoleProtocolMapper

func (keycloakClient *KeycloakClient) GetOpenIdUserRealmRoleProtocolMapper(realmId, clientId, clientScopeId, mapperId string) (*OpenIdUserRealmRoleProtocolMapper, error)

func (*KeycloakClient) GetOpenidClient

func (keycloakClient *KeycloakClient) GetOpenidClient(realmId, id string) (*OpenidClient, error)

func (*KeycloakClient) GetOpenidClientAuthorizationPermission

func (keycloakClient *KeycloakClient) GetOpenidClientAuthorizationPermission(realm, resourceServerId, id string) (*OpenidClientAuthorizationPermission, error)

func (*KeycloakClient) GetOpenidClientAuthorizationResource

func (keycloakClient *KeycloakClient) GetOpenidClientAuthorizationResource(realm, resourceServerId, resourceId string) (*OpenidClientAuthorizationResource, error)

func (*KeycloakClient) GetOpenidClientAuthorizationResourceByName

func (keycloakClient *KeycloakClient) GetOpenidClientAuthorizationResourceByName(realmId, resourceServerId, name string) (*OpenidClientAuthorizationResource, error)

func (*KeycloakClient) GetOpenidClientAuthorizationScope

func (keycloakClient *KeycloakClient) GetOpenidClientAuthorizationScope(realm, resourceServerId, scopeId string) (*OpenidClientAuthorizationScope, error)

func (*KeycloakClient) GetOpenidClientByClientId

func (keycloakClient *KeycloakClient) GetOpenidClientByClientId(realmId, clientId string) (*OpenidClient, error)

func (*KeycloakClient) GetOpenidClientDefaultScopes

func (keycloakClient *KeycloakClient) GetOpenidClientDefaultScopes(realmId, clientId string) ([]*OpenidClientScope, error)

func (*KeycloakClient) GetOpenidClientOptionalScopes

func (keycloakClient *KeycloakClient) GetOpenidClientOptionalScopes(realmId, clientId string) ([]*OpenidClientScope, error)

func (*KeycloakClient) GetOpenidClientScope

func (keycloakClient *KeycloakClient) GetOpenidClientScope(realmId, id string) (*OpenidClientScope, error)

func (*KeycloakClient) GetOpenidClientServiceAccountRole

func (keycloakClient *KeycloakClient) GetOpenidClientServiceAccountRole(realm, serviceAccountUserId, clientId, roleId string) (*OpenidClientServiceAccountRole, error)

func (*KeycloakClient) GetOpenidClientServiceAccountUserId

func (keycloakClient *KeycloakClient) GetOpenidClientServiceAccountUserId(realmId, clientId string) (*User, error)

func (*KeycloakClient) GetOpenidClients

func (keycloakClient *KeycloakClient) GetOpenidClients(realmId string) (*OpenidClients, error)

func (*KeycloakClient) GetRealm

func (keycloakClient *KeycloakClient) GetRealm(id string) (*Realm, error)

func (*KeycloakClient) GetRealmKeys

func (keycloakClient *KeycloakClient) GetRealmKeys(id string) (*Keys, error)

func (*KeycloakClient) GetRealms

func (keycloakClient *KeycloakClient) GetRealms() (*Realms, error)

func (*KeycloakClient) GetRequiredAction

func (keycloakClient *KeycloakClient) GetRequiredAction(realmId string, alias string) (*RequiredAction, error)

func (*KeycloakClient) GetRole

func (keycloakClient *KeycloakClient) GetRole(realmId, id string) (*Role, error)

func (*KeycloakClient) GetRoleByName

func (keycloakClient *KeycloakClient) GetRoleByName(realmId, clientId, name string) (*Role, error)

func (*KeycloakClient) GetRoleComposites

func (keycloakClient *KeycloakClient) GetRoleComposites(role *Role) ([]*Role, error)

func (*KeycloakClient) GetSamlClient

func (keycloakClient *KeycloakClient) GetSamlClient(realmId, id string) (*SamlClient, error)

func (*KeycloakClient) GetSamlUserAttributeProtocolMapper

func (keycloakClient *KeycloakClient) GetSamlUserAttributeProtocolMapper(realmId, clientId, clientScopeId, mapperId string) (*SamlUserAttributeProtocolMapper, error)

func (*KeycloakClient) GetSamlUserPropertyProtocolMapper

func (keycloakClient *KeycloakClient) GetSamlUserPropertyProtocolMapper(realmId, clientId, clientScopeId, mapperId string) (*SamlUserPropertyProtocolMapper, error)

func (*KeycloakClient) GetServerInfo

func (keycloakClient *KeycloakClient) GetServerInfo() (*ServerInfo, error)

func (*KeycloakClient) GetUser

func (keycloakClient *KeycloakClient) GetUser(realmId, id string) (*User, error)

func (*KeycloakClient) GetUserByUsername

func (keycloakClient *KeycloakClient) GetUserByUsername(realmId, username string) (*User, error)

func (*KeycloakClient) ListGroupsWithName

func (keycloakClient *KeycloakClient) ListGroupsWithName(realmId, name string) ([]*Group, error)

func (*KeycloakClient) NewCustomUserFederation

func (keycloakClient *KeycloakClient) NewCustomUserFederation(customUserFederation *CustomUserFederation) error

func (*KeycloakClient) NewGenericClientProtocolMapper

func (keycloakClient *KeycloakClient) NewGenericClientProtocolMapper(genericClientProtocolMapper *GenericClientProtocolMapper) error

func (*KeycloakClient) NewGroup

func (keycloakClient *KeycloakClient) NewGroup(group *Group) error

* Top level groups are created via POST /realms/${realm_id}/groups * Child groups are created via POST /realms/${realm_id}/groups/${parent_id}/children

func (*KeycloakClient) NewIdentityProvider

func (keycloakClient *KeycloakClient) NewIdentityProvider(identityProvider *IdentityProvider) error

func (*KeycloakClient) NewIdentityProviderMapper

func (keycloakClient *KeycloakClient) NewIdentityProviderMapper(identityProviderMapper *IdentityProviderMapper) error

func (*KeycloakClient) NewLdapFullNameMapper

func (keycloakClient *KeycloakClient) NewLdapFullNameMapper(ldapFullNameMapper *LdapFullNameMapper) error

func (*KeycloakClient) NewLdapGroupMapper

func (keycloakClient *KeycloakClient) NewLdapGroupMapper(ldapGroupMapper *LdapGroupMapper) error

func (*KeycloakClient) NewLdapMsadUserAccountControlMapper

func (keycloakClient *KeycloakClient) NewLdapMsadUserAccountControlMapper(ldapMsadUserAccountControlMapper *LdapMsadUserAccountControlMapper) error

func (*KeycloakClient) NewLdapUserAttributeMapper

func (keycloakClient *KeycloakClient) NewLdapUserAttributeMapper(ldapUserAttributeMapper *LdapUserAttributeMapper) error

func (*KeycloakClient) NewLdapUserFederation

func (keycloakClient *KeycloakClient) NewLdapUserFederation(ldapUserFederation *LdapUserFederation) error

func (*KeycloakClient) NewOpenIdAudienceProtocolMapper

func (keycloakClient *KeycloakClient) NewOpenIdAudienceProtocolMapper(mapper *OpenIdAudienceProtocolMapper) error

func (*KeycloakClient) NewOpenIdFullNameProtocolMapper

func (keycloakClient *KeycloakClient) NewOpenIdFullNameProtocolMapper(mapper *OpenIdFullNameProtocolMapper) error

func (*KeycloakClient) NewOpenIdGroupMembershipProtocolMapper

func (keycloakClient *KeycloakClient) NewOpenIdGroupMembershipProtocolMapper(mapper *OpenIdGroupMembershipProtocolMapper) error

func (*KeycloakClient) NewOpenIdHardcodedClaimProtocolMapper

func (keycloakClient *KeycloakClient) NewOpenIdHardcodedClaimProtocolMapper(mapper *OpenIdHardcodedClaimProtocolMapper) error

func (*KeycloakClient) NewOpenIdHardcodedRoleProtocolMapper

func (keycloakClient *KeycloakClient) NewOpenIdHardcodedRoleProtocolMapper(mapper *OpenIdHardcodedRoleProtocolMapper) error

func (*KeycloakClient) NewOpenIdUserAttributeProtocolMapper

func (keycloakClient *KeycloakClient) NewOpenIdUserAttributeProtocolMapper(mapper *OpenIdUserAttributeProtocolMapper) error

func (*KeycloakClient) NewOpenIdUserPropertyProtocolMapper

func (keycloakClient *KeycloakClient) NewOpenIdUserPropertyProtocolMapper(mapper *OpenIdUserPropertyProtocolMapper) error

func (*KeycloakClient) NewOpenIdUserRealmRoleProtocolMapper

func (keycloakClient *KeycloakClient) NewOpenIdUserRealmRoleProtocolMapper(mapper *OpenIdUserRealmRoleProtocolMapper) error

func (*KeycloakClient) NewOpenidClient

func (keycloakClient *KeycloakClient) NewOpenidClient(client *OpenidClient) error

func (*KeycloakClient) NewOpenidClientAuthorizationPermission

func (keycloakClient *KeycloakClient) NewOpenidClientAuthorizationPermission(permission *OpenidClientAuthorizationPermission) error

func (*KeycloakClient) NewOpenidClientAuthorizationResource

func (keycloakClient *KeycloakClient) NewOpenidClientAuthorizationResource(resource *OpenidClientAuthorizationResource) error

func (*KeycloakClient) NewOpenidClientAuthorizationScope

func (keycloakClient *KeycloakClient) NewOpenidClientAuthorizationScope(scope *OpenidClientAuthorizationScope) error

func (*KeycloakClient) NewOpenidClientScope

func (keycloakClient *KeycloakClient) NewOpenidClientScope(clientScope *OpenidClientScope) error

func (*KeycloakClient) NewOpenidClientServiceAccountRole

func (keycloakClient *KeycloakClient) NewOpenidClientServiceAccountRole(serviceAccountRole *OpenidClientServiceAccountRole) error

func (*KeycloakClient) NewRealm

func (keycloakClient *KeycloakClient) NewRealm(realm *Realm) error

func (*KeycloakClient) NewSamlClient

func (keycloakClient *KeycloakClient) NewSamlClient(client *SamlClient) error

func (*KeycloakClient) NewSamlUserAttributeProtocolMapper

func (keycloakClient *KeycloakClient) NewSamlUserAttributeProtocolMapper(mapper *SamlUserAttributeProtocolMapper) error

func (*KeycloakClient) NewSamlUserPropertyProtocolMapper

func (keycloakClient *KeycloakClient) NewSamlUserPropertyProtocolMapper(mapper *SamlUserPropertyProtocolMapper) error

func (*KeycloakClient) NewUser

func (keycloakClient *KeycloakClient) NewUser(user *User) error

func (*KeycloakClient) PutDefaultGroup

func (keycloakClient *KeycloakClient) PutDefaultGroup(realmName, groupId string) error

PutDefaultGroup will PUT a new group ID to the realm default groups. This is effectively an "upsert".

func (*KeycloakClient) RemoveClientRolesFromGroup

func (keycloakClient *KeycloakClient) RemoveClientRolesFromGroup(realmId, groupId, clientId string, roles []*Role) error

func (*KeycloakClient) RemoveCompositesFromRole

func (keycloakClient *KeycloakClient) RemoveCompositesFromRole(role *Role, compositeRoles []*Role) error

func (*KeycloakClient) RemoveRealmRolesFromGroup

func (keycloakClient *KeycloakClient) RemoveRealmRolesFromGroup(realmId, groupId string, roles []*Role) error

func (*KeycloakClient) RemoveUserFromGroup

func (keycloakClient *KeycloakClient) RemoveUserFromGroup(user *User, groupId string) error

func (*KeycloakClient) RemoveUsersFromGroup

func (keycloakClient *KeycloakClient) RemoveUsersFromGroup(realmId, groupId string, usernames []interface{}) error

func (*KeycloakClient) ResetUserPassword

func (keycloakClient *KeycloakClient) ResetUserPassword(realmId, userId string, newPassword string, isTemporary bool) error

func (*KeycloakClient) UpdateCustomUserFederation

func (keycloakClient *KeycloakClient) UpdateCustomUserFederation(customUserFederation *CustomUserFederation) error

func (*KeycloakClient) UpdateGenericClientProtocolMapper

func (keycloakClient *KeycloakClient) UpdateGenericClientProtocolMapper(genericClientProtocolMapper *GenericClientProtocolMapper) error

func (*KeycloakClient) UpdateGroup

func (keycloakClient *KeycloakClient) UpdateGroup(group *Group) error

func (*KeycloakClient) UpdateIdentityProvider

func (keycloakClient *KeycloakClient) UpdateIdentityProvider(identityProvider *IdentityProvider) error

func (*KeycloakClient) UpdateIdentityProviderMapper

func (keycloakClient *KeycloakClient) UpdateIdentityProviderMapper(identityProviderMapper *IdentityProviderMapper) error

func (*KeycloakClient) UpdateLdapFullNameMapper

func (keycloakClient *KeycloakClient) UpdateLdapFullNameMapper(ldapFullNameMapper *LdapFullNameMapper) error

func (*KeycloakClient) UpdateLdapGroupMapper

func (keycloakClient *KeycloakClient) UpdateLdapGroupMapper(ldapGroupMapper *LdapGroupMapper) error

func (*KeycloakClient) UpdateLdapMsadUserAccountControlMapper

func (keycloakClient *KeycloakClient) UpdateLdapMsadUserAccountControlMapper(ldapMsadUserAccountControlMapper *LdapMsadUserAccountControlMapper) error

func (*KeycloakClient) UpdateLdapUserAttributeMapper

func (keycloakClient *KeycloakClient) UpdateLdapUserAttributeMapper(ldapUserAttributeMapper *LdapUserAttributeMapper) error

func (*KeycloakClient) UpdateLdapUserFederation

func (keycloakClient *KeycloakClient) UpdateLdapUserFederation(ldapUserFederation *LdapUserFederation) error

func (*KeycloakClient) UpdateOpenIdAudienceProtocolMapper

func (keycloakClient *KeycloakClient) UpdateOpenIdAudienceProtocolMapper(mapper *OpenIdAudienceProtocolMapper) error

func (*KeycloakClient) UpdateOpenIdFullNameProtocolMapper

func (keycloakClient *KeycloakClient) UpdateOpenIdFullNameProtocolMapper(mapper *OpenIdFullNameProtocolMapper) error

func (*KeycloakClient) UpdateOpenIdGroupMembershipProtocolMapper

func (keycloakClient *KeycloakClient) UpdateOpenIdGroupMembershipProtocolMapper(mapper *OpenIdGroupMembershipProtocolMapper) error

func (*KeycloakClient) UpdateOpenIdHardcodedClaimProtocolMapper

func (keycloakClient *KeycloakClient) UpdateOpenIdHardcodedClaimProtocolMapper(mapper *OpenIdHardcodedClaimProtocolMapper) error

func (*KeycloakClient) UpdateOpenIdHardcodedRoleProtocolMapper

func (keycloakClient *KeycloakClient) UpdateOpenIdHardcodedRoleProtocolMapper(mapper *OpenIdHardcodedRoleProtocolMapper) error

func (*KeycloakClient) UpdateOpenIdUserAttributeProtocolMapper

func (keycloakClient *KeycloakClient) UpdateOpenIdUserAttributeProtocolMapper(mapper *OpenIdUserAttributeProtocolMapper) error

func (*KeycloakClient) UpdateOpenIdUserPropertyProtocolMapper

func (keycloakClient *KeycloakClient) UpdateOpenIdUserPropertyProtocolMapper(mapper *OpenIdUserPropertyProtocolMapper) error

func (*KeycloakClient) UpdateOpenIdUserRealmRoleProtocolMapper

func (keycloakClient *KeycloakClient) UpdateOpenIdUserRealmRoleProtocolMapper(mapper *OpenIdUserRealmRoleProtocolMapper) error

func (*KeycloakClient) UpdateOpenidClient

func (keycloakClient *KeycloakClient) UpdateOpenidClient(client *OpenidClient) error

func (*KeycloakClient) UpdateOpenidClientAuthorizationPermission

func (keycloakClient *KeycloakClient) UpdateOpenidClientAuthorizationPermission(permission *OpenidClientAuthorizationPermission) error

func (*KeycloakClient) UpdateOpenidClientAuthorizationResource

func (keycloakClient *KeycloakClient) UpdateOpenidClientAuthorizationResource(resource *OpenidClientAuthorizationResource) error

func (*KeycloakClient) UpdateOpenidClientAuthorizationScope

func (keycloakClient *KeycloakClient) UpdateOpenidClientAuthorizationScope(scope *OpenidClientAuthorizationScope) error

func (*KeycloakClient) UpdateOpenidClientScope

func (keycloakClient *KeycloakClient) UpdateOpenidClientScope(clientScope *OpenidClientScope) error

func (*KeycloakClient) UpdateRealm

func (keycloakClient *KeycloakClient) UpdateRealm(realm *Realm) error

func (*KeycloakClient) UpdateRequiredAction

func (keycloakClient *KeycloakClient) UpdateRequiredAction(requiredAction *RequiredAction) error

func (*KeycloakClient) UpdateRole

func (keycloakClient *KeycloakClient) UpdateRole(role *Role) error

func (*KeycloakClient) UpdateSamlClient

func (keycloakClient *KeycloakClient) UpdateSamlClient(client *SamlClient) error

func (*KeycloakClient) UpdateSamlUserAttributeProtocolMapper

func (keycloakClient *KeycloakClient) UpdateSamlUserAttributeProtocolMapper(mapper *SamlUserAttributeProtocolMapper) error

func (*KeycloakClient) UpdateSamlUserPropertyProtocolMapper

func (keycloakClient *KeycloakClient) UpdateSamlUserPropertyProtocolMapper(mapper *SamlUserPropertyProtocolMapper) error

func (*KeycloakClient) UpdateUser

func (keycloakClient *KeycloakClient) UpdateUser(user *User) error

func (*KeycloakClient) ValidateCustomUserFederation

func (keycloakClient *KeycloakClient) ValidateCustomUserFederation(custom *CustomUserFederation) error

func (*KeycloakClient) ValidateGroupMembers

func (keycloakClient *KeycloakClient) ValidateGroupMembers(usernames []interface{}) error

func (*KeycloakClient) ValidateLdapFullNameMapper

func (keycloakClient *KeycloakClient) ValidateLdapFullNameMapper(mapper *LdapFullNameMapper) error

the keycloak api client is passed in order to fetch the ldap provider for writable validation

func (*KeycloakClient) ValidateLdapGroupMapper

func (keycloakClient *KeycloakClient) ValidateLdapGroupMapper(ldapGroupMapper *LdapGroupMapper) error

func (*KeycloakClient) ValidateLdapUserFederation

func (keycloakClient *KeycloakClient) ValidateLdapUserFederation(ldap *LdapUserFederation) error

func (*KeycloakClient) ValidateOpenIdAudienceProtocolMapper

func (keycloakClient *KeycloakClient) ValidateOpenIdAudienceProtocolMapper(mapper *OpenIdAudienceProtocolMapper) error

func (*KeycloakClient) ValidateOpenIdFullNameProtocolMapper

func (keycloakClient *KeycloakClient) ValidateOpenIdFullNameProtocolMapper(mapper *OpenIdFullNameProtocolMapper) error

func (*KeycloakClient) ValidateOpenIdGroupMembershipProtocolMapper

func (keycloakClient *KeycloakClient) ValidateOpenIdGroupMembershipProtocolMapper(mapper *OpenIdGroupMembershipProtocolMapper) error

func (*KeycloakClient) ValidateOpenIdHardcodedClaimProtocolMapper

func (keycloakClient *KeycloakClient) ValidateOpenIdHardcodedClaimProtocolMapper(mapper *OpenIdHardcodedClaimProtocolMapper) error

func (*KeycloakClient) ValidateOpenIdHardcodedRoleProtocolMapper

func (keycloakClient *KeycloakClient) ValidateOpenIdHardcodedRoleProtocolMapper(mapper *OpenIdHardcodedRoleProtocolMapper) error

func (*KeycloakClient) ValidateOpenIdUserAttributeProtocolMapper

func (keycloakClient *KeycloakClient) ValidateOpenIdUserAttributeProtocolMapper(mapper *OpenIdUserAttributeProtocolMapper) error

func (*KeycloakClient) ValidateOpenIdUserRealmRoleProtocolMapper

func (keycloakClient *KeycloakClient) ValidateOpenIdUserRealmRoleProtocolMapper(mapper *OpenIdUserRealmRoleProtocolMapper) error

func (*KeycloakClient) ValidateOpenidClient

func (keycloakClient *KeycloakClient) ValidateOpenidClient(client *OpenidClient) error

func (*KeycloakClient) ValidateRealm

func (keycloakClient *KeycloakClient) ValidateRealm(realm *Realm) error

func (*KeycloakClient) ValidateRequiredAction

func (keycloakClient *KeycloakClient) ValidateRequiredAction(requiredAction *RequiredAction) error

func (*KeycloakClient) ValidateSamlUserAttributeProtocolMapper

func (keycloakClient *KeycloakClient) ValidateSamlUserAttributeProtocolMapper(mapper *SamlUserAttributeProtocolMapper) error

func (*KeycloakClient) ValidateSamlUserPropertyProtocolMapper

func (keycloakClient *KeycloakClient) ValidateSamlUserPropertyProtocolMapper(mapper *SamlUserPropertyProtocolMapper) error

type Keys

type Keys struct {
	Keys []Key `json:"keys"`
}

type LdapFullNameMapper

type LdapFullNameMapper struct {
	Id                   string
	Name                 string
	RealmId              string
	LdapUserFederationId string

	LdapFullNameAttribute string
	ReadOnly              bool
	WriteOnly             bool
}

type LdapGroupMapper

type LdapGroupMapper struct {
	Id                   string
	Name                 string
	RealmId              string
	LdapUserFederationId string

	LdapGroupsDn                string
	GroupNameLdapAttribute      string
	GroupObjectClasses          []string
	PreserveGroupInheritance    bool
	IgnoreMissingGroups         bool
	MembershipLdapAttribute     string
	MembershipAttributeType     string
	MembershipUserLdapAttribute string
	GroupsLdapFilter            string
	Mode                        string
	UserRolesRetrieveStrategy   string
	MemberofLdapAttribute       string
	MappedGroupAttributes       []string

	DropNonExistingGroupsDuringSync bool
}

type LdapMsadUserAccountControlMapper

type LdapMsadUserAccountControlMapper struct {
	Id                   string
	Name                 string
	RealmId              string
	LdapUserFederationId string

	LdapPasswordPolicyHintsEnabled bool
}

type LdapUserAttributeMapper

type LdapUserAttributeMapper struct {
	Id                   string
	Name                 string
	RealmId              string
	LdapUserFederationId string

	LdapAttribute           string
	IsMandatoryInLdap       bool
	ReadOnly                bool
	AlwaysReadValueFromLdap bool
	UserModelAttribute      string
}

type LdapUserFederation

type LdapUserFederation struct {
	Id      string
	Name    string
	RealmId string

	Enabled  bool
	Priority int

	ImportEnabled     bool
	EditMode          string // can be "READ_ONLY", "WRITABLE", or "UNSYNCED"
	SyncRegistrations bool   // I think this field controls whether or not BatchSizeForSync, FullSyncPeriod, and ChangedSyncPeriod are needed

	Vendor                 string // can be "other", "edirectory", "ad", "rhds", or "tivoli". honestly I don't think this field actually does anything
	UsernameLDAPAttribute  string
	RdnLDAPAttribute       string
	UuidLDAPAttribute      string
	UserObjectClasses      []string // api expects comma + space separated for some reason
	ConnectionUrl          string
	UsersDn                string
	BindDn                 string
	BindCredential         string
	CustomUserSearchFilter string // must start with '(' and end with ')'
	SearchScope            string // api expects "1" or "2", but that means "One Level" or "Subtree"

	ValidatePasswordPolicy bool
	UseTruststoreSpi       string // can be "ldapsOnly", "always", or "never"
	ConnectionTimeout      string // duration string (ex: 1h30m)
	ReadTimeout            string // duration string (ex: 1h30m)
	Pagination             bool

	BatchSizeForSync  int
	FullSyncPeriod    int // either a number, in milliseconds, or -1 if full sync is disabled
	ChangedSyncPeriod int // either a number, in milliseconds, or -1 if changed sync is disabled

	CachePolicy string
}

type OpenIdAudienceProtocolMapper

type OpenIdAudienceProtocolMapper struct {
	Id            string
	Name          string
	RealmId       string
	ClientId      string
	ClientScopeId string

	AddToIdToken     bool
	AddToAccessToken bool

	IncludedClientAudience string
	IncludedCustomAudience string
}

type OpenIdFullNameProtocolMapper

type OpenIdFullNameProtocolMapper struct {
	Id            string
	Name          string
	RealmId       string
	ClientId      string
	ClientScopeId string

	AddToIdToken     bool
	AddToAccessToken bool
	AddToUserInfo    bool
}

type OpenIdGroupMembershipProtocolMapper

type OpenIdGroupMembershipProtocolMapper struct {
	Id            string
	Name          string
	RealmId       string
	ClientId      string
	ClientScopeId string

	AddToIdToken     bool
	AddToAccessToken bool
	AddToUserinfo    bool

	ClaimName string
	FullPath  bool
}

type OpenIdHardcodedClaimProtocolMapper

type OpenIdHardcodedClaimProtocolMapper struct {
	Id            string
	Name          string
	RealmId       string
	ClientId      string
	ClientScopeId string

	AddToIdToken     bool
	AddToAccessToken bool
	AddToUserInfo    bool

	ClaimName      string
	ClaimValue     string
	ClaimValueType string
}

type OpenIdHardcodedRoleProtocolMapper

type OpenIdHardcodedRoleProtocolMapper struct {
	Id            string
	Name          string
	RealmId       string
	ClientId      string
	ClientScopeId string

	RoleId string
}

type OpenIdUserAttributeProtocolMapper

type OpenIdUserAttributeProtocolMapper struct {
	Id            string
	Name          string
	RealmId       string
	ClientId      string
	ClientScopeId string

	AddToIdToken     bool
	AddToAccessToken bool
	AddToUserInfo    bool

	UserAttribute  string
	ClaimName      string
	ClaimValueType string

	Multivalued bool // indicates whether is this an array of attributes or a single attribute
}

type OpenIdUserPropertyProtocolMapper

type OpenIdUserPropertyProtocolMapper struct {
	Id            string
	Name          string
	RealmId       string
	ClientId      string
	ClientScopeId string

	AddToIdToken     bool
	AddToAccessToken bool
	AddToUserInfo    bool

	UserProperty   string
	ClaimName      string
	ClaimValueType string
}

func (*OpenIdUserPropertyProtocolMapper) Validate

func (mapper *OpenIdUserPropertyProtocolMapper) Validate(keycloakClient *KeycloakClient) error

type OpenIdUserRealmRoleProtocolMapper

type OpenIdUserRealmRoleProtocolMapper struct {
	Id            string
	Name          string
	RealmId       string
	ClientId      string
	ClientScopeId string

	AddToIdToken     bool
	AddToAccessToken bool
	AddToUserInfo    bool

	RealmRolePrefix string
	Multivalued     bool
	ClaimName       string
	ClaimValueType  string
}

type OpenidClient

type OpenidClient struct {
	Id                           string                             `json:"id,omitempty"`
	ClientId                     string                             `json:"clientId"`
	RealmId                      string                             `json:"-"`
	Name                         string                             `json:"name"`
	Protocol                     string                             `json:"protocol"`                // always openid-connect for this resource
	ClientAuthenticatorType      string                             `json:"clientAuthenticatorType"` // always client-secret for now, don't have a need for JWT here
	ClientSecret                 string                             `json:"secret,omitempty"`
	Enabled                      bool                               `json:"enabled"`
	Description                  string                             `json:"description"`
	PublicClient                 bool                               `json:"publicClient"`
	BearerOnly                   bool                               `json:"bearerOnly"`
	StandardFlowEnabled          bool                               `json:"standardFlowEnabled"`
	ImplicitFlowEnabled          bool                               `json:"implicitFlowEnabled"`
	DirectAccessGrantsEnabled    bool                               `json:"directAccessGrantsEnabled"`
	ServiceAccountsEnabled       bool                               `json:"serviceAccountsEnabled"`
	AuthorizationServicesEnabled bool                               `json:"authorizationServicesEnabled"`
	ValidRedirectUris            []string                           `json:"redirectUris"`
	WebOrigins                   []string                           `json:"webOrigins"`
	Attributes                   OpenidClientAttributes             `json:"attributes"`
	AuthorizationSettings        *OpenidClientAuthorizationSettings `json:"authorizationSettings,omitempty"`
}

type OpenidClientAttributes

type OpenidClientAttributes struct {
	PkceCodeChallengeMethod string `json:"pkce.code.challenge.method"`
}

type OpenidClientAuthorizationPermission

type OpenidClientAuthorizationPermission struct {
	Id               string   `json:"id,omitempty"`
	RealmId          string   `json:"-"`
	ResourceServerId string   `json:"-"`
	Name             string   `json:"name"`
	Description      string   `json:"description"`
	DecisionStrategy string   `json:"decisionStrategy"`
	Policies         []string `json:"policies"`
	Resources        []string `json:"resources"`
	Type             string   `json:"type"`
}

type OpenidClientAuthorizationPolicy

type OpenidClientAuthorizationPolicy struct {
	Id               string   `json:"id,omitempty"`
	RealmId          string   `json:"-"`
	ResourceServerId string   `json:"-"`
	Name             string   `json:"name"`
	Owner            string   `json:"owner"`
	DecisionStrategy string   `json:"decisionStrategy"`
	Logic            string   `json:"logic"`
	Policies         []string `json:"policies"`
	Resources        []string `json:"resources"`
	Scopes           []string `json:"scopes"`
	Type             string   `json:"type"`
}

type OpenidClientAuthorizationResource

type OpenidClientAuthorizationResource struct {
	ResourceServerId   string                           `json:"-"`
	RealmId            string                           `json:"-"`
	Id                 string                           `json:"_id,omitempty"`
	DisplayName        string                           `json:"displayName"`
	Name               string                           `json:"name"`
	Uris               []string                         `json:"uris"`
	IconUri            string                           `json:"icon_uri"`
	OwnerManagedAccess bool                             `json:"ownerManagedAccess"`
	Scopes             []OpenidClientAuthorizationScope `json:"scopes"`
	Type               string                           `json:"type"`
	Attributes         map[string][]string              `json:"attributes"`
}

type OpenidClientAuthorizationScope

type OpenidClientAuthorizationScope struct {
	Id               string `json:"id,omitempty"`
	RealmId          string `json:"-"`
	ResourceServerId string `json:"-"`
	Name             string `json:"name"`
	DisplayName      string `json:"displayName"`
	IconUri          string `json:"iconUri"`
}

type OpenidClientAuthorizationSettings

type OpenidClientAuthorizationSettings struct {
	PolicyEnforcementMode         string `json:"policyEnforcementMode,omitempty"`
	AllowRemoteResourceManagement bool   `json:"allowRemoteResourceManagement,omitempty"`
	KeepDefaults                  bool   `json:"-"`
}

type OpenidClientRole

type OpenidClientRole struct {
	Id                 string `json:"id"`
	Name               string `json:"name"`
	Description        string `json:"description"`
	ScopeParamRequired bool   `json:"scopeParamRequired"`
	ClientRole         bool   `json:"clientRole"`
	ContainerId        string `json:"ContainerId"`
}

type OpenidClientScope

type OpenidClientScope struct {
	Id          string `json:"id,omitempty"`
	RealmId     string `json:"-"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Protocol    string `json:"protocol"`
	Attributes  struct {
		DisplayOnConsentScreen string `json:"display.on.consent.screen"` // boolean in string form
		ConsentScreenText      string `json:"consent.screen.text"`
	} `json:"attributes"`
}

type OpenidClientScopeFilterFunc

type OpenidClientScopeFilterFunc func(*OpenidClientScope) bool

type OpenidClientSecret

type OpenidClientSecret struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type OpenidClientServiceAccountRole

type OpenidClientServiceAccountRole struct {
	Id                   string `json:"id"`
	RealmId              string `json:"-"`
	ServiceAccountUserId string `json:"-"`
	Name                 string `json:"name,omitempty"`
	ClientRole           bool   `json:"clientRole"`
	Composite            bool   `json:"composite"`
	ContainerId          string `json:"containerId"`
	Description          string `json:"description"`
}

type OpenidClients

type OpenidClients []OpenidClient

type PasswordCredentials

type PasswordCredentials struct {
	Value     string `json:"value"`
	Type      string `json:"type"`
	Temporary bool   `json:"temporary"`
}

type Provider

type Provider struct {
}

type ProviderType

type ProviderType struct {
	Internal  bool                `json:"internal"`
	Providers map[string]Provider `json:"providers"`
}

type Realm

type Realm struct {
	Id          string `json:"id"`
	Realm       string `json:"realm"`
	Enabled     bool   `json:"enabled"`
	DisplayName string `json:"displayName"`

	// Login Config
	RegistrationAllowed         bool `json:"registrationAllowed"`
	RegistrationEmailAsUsername bool `json:"registrationEmailAsUsername"`
	EditUsernameAllowed         bool `json:"editUsernameAllowed"`
	ResetPasswordAllowed        bool `json:"resetPasswordAllowed"`
	RememberMe                  bool `json:"rememberMe"`
	VerifyEmail                 bool `json:"verifyEmail"`
	LoginWithEmailAllowed       bool `json:"loginWithEmailAllowed"`
	DuplicateEmailsAllowed      bool `json:"duplicateEmailsAllowed"`

	//SMTP Server
	SmtpServer SmtpServer `json:"smtpServer"`

	// Themes
	LoginTheme   string `json:"loginTheme,omitempty"`
	AccountTheme string `json:"accountTheme,omitempty"`
	AdminTheme   string `json:"adminTheme,omitempty"`
	EmailTheme   string `json:"emailTheme,omitempty"`

	// Tokens
	RevokeRefreshToken                  bool `json:"revokeRefreshToken,omitempty"`
	RefreshTokenMaxReuse                int  `json:"refreshTokenMaxReuse,omitempty"`
	SsoSessionIdleTimeout               int  `json:"ssoSessionIdleTimeout,omitempty"`
	SsoSessionMaxLifespan               int  `json:"ssoSessionMaxLifespan,omitempty"`
	OfflineSessionIdleTimeout           int  `json:"offlineSessionIdleTimeout,omitempty"`
	OfflineSessionMaxLifespan           int  `json:"offlineSessionMaxLifespan,omitempty"`
	AccessTokenLifespan                 int  `json:"accessTokenLifespan,omitempty"`
	AccessTokenLifespanForImplicitFlow  int  `json:"accessTokenLifespanForImplicitFlow,omitempty"`
	AccessCodeLifespan                  int  `json:"accessCodeLifespan,omitempty"`
	AccessCodeLifespanLogin             int  `json:"accessCodeLifespanLogin,omitempty"`
	AccessCodeLifespanUserAction        int  `json:"accessCodeLifespanUserAction,omitempty"`
	ActionTokenGeneratedByUserLifespan  int  `json:"actionTokenGeneratedByUserLifespan,omitempty"`
	ActionTokenGeneratedByAdminLifespan int  `json:"actionTokenGeneratedByAdminLifespan,omitempty"`

	//internationalization
	InternationalizationEnabled bool     `json:"internationalizationEnabled"`
	SupportLocales              []string `json:"supportedLocales"`
	DefaultLocale               string   `json:"defaultLocale"`

	//extra attributes of a realm, contains security defenses browser headers and brute force detection parameters(those still nee to be added)
	Attributes Attributes `json:"attributes,omitempty"`

	PasswordPolicy string `json:"passwordPolicy"`

	//flow bindings
	BrowserFlow              string `json:"browserFlow,omitempty"`
	RegistrationFlow         string `json:"registrationFlow,omitempty"`
	DirectGrantFlow          string `json:"directGrantFlow,omitempty"`
	ResetCredentialsFlow     string `json:"resetCredentialsFlow,omitempty"`
	ClientAuthenticationFlow string `json:"clientAuthenticationFlow,omitempty"`
	DockerAuthenticationFlow string `json:"dockerAuthenticationFlow,omitempty"`
}

type Realms

type Realms []Realm

type RequiredAction

type RequiredAction struct {
	Id            string              `json:"-"`
	RealmId       string              `json:"-"`
	Alias         string              `json:"alias"`
	Name          string              `json:"name"`
	Enabled       bool                `json:"enabled"`
	DefaultAction bool                `json:"defaultAction"`
	Priority      int                 `json:"priority"`
	Config        map[string][]string `json:"config"`
}

type Role

type Role struct {
	Id          string `json:"id,omitempty"`
	RealmId     string `json:"-"`
	ClientId    string `json:"-"`
	RoleId      string `json:"-"`
	Name        string `json:"name"`
	Description string `json:"description"`
	ClientRole  bool   `json:"clientRole"`
	ContainerId string `json:"containerId"`
	Composite   bool   `json:"composite"`
}

type SamlClient

type SamlClient struct {
	Id                      string `json:"id,omitempty"`
	ClientId                string `json:"clientId"`
	RealmId                 string `json:"-"`
	Name                    string `json:"name"`
	Protocol                string `json:"protocol"`                // always saml for this resource
	ClientAuthenticatorType string `json:"clientAuthenticatorType"` // always client-secret

	Enabled     bool   `json:"enabled"`
	Description string `json:"description"`

	FrontChannelLogout bool `json:"frontchannelLogout"`

	RootUrl                 string   `json:"rootUrl"`
	ValidRedirectUris       []string `json:"redirectUris"`
	BaseUrl                 string   `json:"baseUrl"`
	MasterSamlProcessingUrl string   `json:"adminUrl"`

	FullScopeAllowed bool `json:"fullScopeAllowed"`

	Attributes *SamlClientAttributes `json:"attributes"`
}

type SamlClientAttributes

type SamlClientAttributes struct {
	IncludeAuthnStatement   *string `json:"saml.authnstatement"`
	SignDocuments           *string `json:"saml.server.signature"`
	SignAssertions          *string `json:"saml.assertion.signature"`
	ClientSignatureRequired *string `json:"saml.client.signature"`
	ForcePostBinding        *string `json:"saml.force.post.binding"`
	// attributes above are actually booleans, but the Keycloak API expects strings
	NameIdFormat                    string  `json:"saml_name_id_format"`
	SigningCertificate              *string `json:"saml.signing.certificate,omitempty"`
	SigningPrivateKey               *string `json:"saml.signing.private.key"`
	IDPInitiatedSSOURLName          string  `json:"saml_idp_initiated_sso_url_name"`
	IDPInitiatedSSORelayState       string  `json:"saml_idp_initiated_sso_relay_state"`
	AssertionConsumerPostURL        string  `json:"saml_assertion_consumer_url_post"`
	AssertionConsumerRedirectURL    string  `json:"saml_assertion_consumer_url_redirect"`
	LogoutServicePostBindingURL     string  `json:"saml_single_logout_service_url_post"`
	LogoutServiceRedirectBindingURL string  `json:"saml_single_logout_service_url_redirect"`
}

type SamlUserAttributeProtocolMapper

type SamlUserAttributeProtocolMapper struct {
	Id            string
	Name          string
	RealmId       string
	ClientId      string
	ClientScopeId string

	UserAttribute           string
	FriendlyName            string
	SamlAttributeName       string
	SamlAttributeNameFormat string
}

type SamlUserPropertyProtocolMapper

type SamlUserPropertyProtocolMapper struct {
	Id            string
	Name          string
	RealmId       string
	ClientId      string
	ClientScopeId string

	UserProperty            string
	FriendlyName            string
	SamlAttributeName       string
	SamlAttributeNameFormat string
}

type ServerInfo

type ServerInfo struct {
	ComponentTypes map[string][]ComponentType `json:"componentTypes"`
	ProviderTypes  map[string]ProviderType    `json:"providers"`
	Themes         map[string][]Theme         `json:"themes"`
}

func (*ServerInfo) ComponentTypeIsInstalled

func (serverInfo *ServerInfo) ComponentTypeIsInstalled(componentType, componentTypeId string) bool

func (*ServerInfo) ThemeIsInstalled

func (serverInfo *ServerInfo) ThemeIsInstalled(t, themeName string) bool

type SmtpServer

type SmtpServer struct {
	StartTls           KeycloakBoolQuoted `json:"starttls,omitempty"`
	Auth               KeycloakBoolQuoted `json:"auth,omitempty"`
	Port               string             `json:"port,omitempty"`
	Host               string             `json:"host,omitempty"`
	ReplyTo            string             `json:"replyTo,omitempty"`
	ReplyToDisplayName string             `json:"replyToDisplayName,omitempty"`
	From               string             `json:"from,omitempty"`
	FromDisplayName    string             `json:"fromDisplayName,omitempty"`
	EnvelopeFrom       string             `json:"envelopeFrom,omitempty"`
	Ssl                KeycloakBoolQuoted `json:"ssl,omitempty"`
	User               string             `json:"user,omitempty"`
	Password           string             `json:"password,omitempty"`
}

type Theme

type Theme struct {
	Name    string   `json:"name"`
	Locales []string `json:"locales,omitempty"`
}

type User

type User struct {
	Id      string `json:"id,omitempty"`
	RealmId string `json:"-"`

	Username            string              `json:"username"`
	Email               string              `json:"email"`
	FirstName           string              `json:"firstName"`
	LastName            string              `json:"lastName"`
	Enabled             bool                `json:"enabled"`
	Attributes          map[string][]string `json:"attributes"`
	FederatedIdentities FederatedIdentities `json:"federatedIdentities"`
}

Jump to

Keyboard shortcuts

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