Documentation
¶
Overview ¶
Package auth provides a client to authenticate against a Keycloak server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeycloakClient ¶
type KeycloakClient struct {
// contains filtered or unexported fields
}
KeycloakClient can be used to authenticate against a Keycloak server.
func NewKeycloakClient ¶
func NewKeycloakClient(httpClient *http.Client, cfg KeycloakConfig) *KeycloakClient
NewKeycloakClient creates a new KeycloakClient.
func (*KeycloakClient) GetToken ¶
func (c *KeycloakClient) GetToken(ctx context.Context) (string, error)
GetToken retrieves a valid access token. The token is cached and refreshed before expiry. The token is obtained by `Resource owner password credentials grant` flow. Ref: https://www.keycloak.org/docs/latest/server_admin/index.html#_oidc-auth-flows-direct
Click to show internal directories.
Click to hide internal directories.