keycloak

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminClient

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

func NewAdminClient

func NewAdminClient(httpClient *http.Client, baseURL, realm string) *AdminClient

func (*AdminClient) AssignRealmRoleToUser added in v0.16.0

func (c *AdminClient) AssignRealmRoleToUser(ctx context.Context, userID string, role RoleInfo) error

func (*AdminClient) CreateOrUpdateRealm

func (c *AdminClient) CreateOrUpdateRealm(ctx context.Context, config RealmConfig) (created bool, err error)

func (*AdminClient) CreateServiceAccountClient added in v0.16.0

func (c *AdminClient) CreateServiceAccountClient(ctx context.Context, config ServiceAccountClientConfig) (*ClientInfo, error)

func (*AdminClient) DeleteRealm

func (c *AdminClient) DeleteRealm(ctx context.Context, realmName string) error

func (*AdminClient) GetClientByName

func (c *AdminClient) GetClientByName(ctx context.Context, clientName string) (*ClientInfo, error)

func (*AdminClient) GetClientSecret added in v0.16.0

func (c *AdminClient) GetClientSecret(ctx context.Context, clientUUID string) (string, error)

func (*AdminClient) GetRealmRole added in v0.16.0

func (c *AdminClient) GetRealmRole(ctx context.Context, roleName string) (*RoleInfo, error)

func (*AdminClient) GetServiceAccountUser added in v0.16.0

func (c *AdminClient) GetServiceAccountUser(ctx context.Context, clientUUID string) (*UserInfo, error)

func (*AdminClient) ListClients added in v0.16.0

func (c *AdminClient) ListClients(ctx context.Context) ([]ClientInfo, error)

func (*AdminClient) RefreshToken

func (c *AdminClient) RefreshToken(ctx context.Context, clientID string) (string, error)

func (*AdminClient) RegistrationEndpoint

func (c *AdminClient) RegistrationEndpoint() string

func (*AdminClient) TokenForRegistration

func (c *AdminClient) TokenForRegistration(ctx context.Context) (string, error)

type ClientInfo

type ClientInfo struct {
	ID       string `json:"id"`
	ClientID string `json:"clientId"`
	Name     string `json:"name"`
	Secret   string `json:"secret"`
}

type RealmConfig

type RealmConfig struct {
	Realm                       string      `json:"realm"`
	DisplayName                 string      `json:"displayName,omitempty"`
	Enabled                     bool        `json:"enabled"`
	LoginWithEmailAllowed       bool        `json:"loginWithEmailAllowed,omitempty"`
	RegistrationEmailAsUsername bool        `json:"registrationEmailAsUsername,omitempty"`
	RegistrationAllowed         bool        `json:"registrationAllowed,omitempty"`
	SSOSessionIdleTimeout       int         `json:"ssoSessionIdleTimeout,omitempty"`
	AccessTokenLifespan         int         `json:"accessTokenLifespan,omitempty"`
	SMTPServer                  *SMTPConfig `json:"smtpServer,omitempty"`
}

type RoleInfo added in v0.16.0

type RoleInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type SMTPConfig

type SMTPConfig struct {
	Host     string `json:"host,omitempty"`
	Port     string `json:"port,omitempty"`
	From     string `json:"from,omitempty"`
	SSL      bool   `json:"ssl,omitempty"`
	StartTLS bool   `json:"starttls,omitempty"`
	Auth     bool   `json:"auth,omitempty"`
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
}

type ServiceAccountClientConfig added in v0.16.0

type ServiceAccountClientConfig struct {
	ClientID               string `json:"clientId"`
	Name                   string `json:"name,omitempty"`
	Enabled                bool   `json:"enabled"`
	ServiceAccountsEnabled bool   `json:"serviceAccountsEnabled"`
	PublicClient           bool   `json:"publicClient"`
}

type UserInfo added in v0.16.0

type UserInfo struct {
	ID       string `json:"id"`
	Username string `json:"username"`
}

Jump to

Keyboard shortcuts

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