Documentation
¶
Index ¶
- type Server
- func (s *Server) AccessToken(ctx context.Context, username, password string) (string, error)
- func (s *Server) AccessTokenWithScopes(ctx context.Context, username, password, scopes string) (string, error)
- func (s *Server) EnsureUser(ctx context.Context, username, password string, realmRoles []string) error
- func (s *Server) GetDiscoveryURL() string
- func (s *Server) GetIssuerURL() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
BaseURL string
IssuerURL string
DiscoveryURL string
TokenURL string
AdminURL string
Realm string
ClientID string
ClientSecret string
// contains filtered or unexported fields
}
Server exposes a running Keycloak test instance.
func StartKeycloak ¶
StartKeycloak starts a disposable Keycloak container with the memory-service realm imported.
func (*Server) AccessToken ¶
AccessToken gets an OIDC access token using password grant for a Keycloak realm user.
func (*Server) AccessTokenWithScopes ¶ added in v0.0.3
func (s *Server) AccessTokenWithScopes(ctx context.Context, username, password, scopes string) (string, error)
AccessTokenWithScopes gets an OIDC access token requesting only the given space-separated scopes. When scopes is empty the default Keycloak scopes are used.
func (*Server) EnsureUser ¶
func (*Server) GetDiscoveryURL ¶ added in v0.0.3
GetDiscoveryURL returns the discovery URL for OIDC provider configuration.
func (*Server) GetIssuerURL ¶ added in v0.0.3
GetIssuerURL returns the issuer URL used for OIDC token validation.
Click to show internal directories.
Click to hide internal directories.