auth

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JwtContext

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

func NewJwtContext

func NewJwtContext(realmUrl string) *JwtContext

func (*JwtContext) ExchangeToken deprecated

func (c *JwtContext) ExchangeToken(ctx context.Context, token string, fromClient string, toClient string) (*oauth2.Token, error)

Deprecated: Use specialized GetTokenFromLiteralAccessToken and RefreshToken funcs instead

func (*JwtContext) ExchangeTokenWithConfig deprecated

func (c *JwtContext) ExchangeTokenWithConfig(ctx context.Context, token string, toClient string, oauthConfig oauth2.Config) (*oauth2.Token, error)

Deprecated: Use specialized GetTokenFromLiteralAccessToken and RefreshToken funcs instead

func (*JwtContext) GetToken

func (c *JwtContext) GetToken(ctx context.Context, client string, username string, pwd string) (*oauth2.Token, error)

func (*JwtContext) GetTokenFromLiteralAccessToken

func (c *JwtContext) GetTokenFromLiteralAccessToken(ctx context.Context, literalAccessToken, clientId string, withOfflineRefresh bool) (*oauth2.Token, error)

func (*JwtContext) GetTokenFromLiteralAccessTokenWithConfig

func (c *JwtContext) GetTokenFromLiteralAccessTokenWithConfig(ctx context.Context, literalAccessToken string, withOfflineRefresh bool, oauthConfig oauth2.Config) (*oauth2.Token, error)

func (*JwtContext) OAuthConfig

func (c *JwtContext) OAuthConfig(ctx context.Context, clientId string, clientSecret string) (*oauth2.Config, error)

func (*JwtContext) OAuthEndpoint

func (c *JwtContext) OAuthEndpoint(ctx context.Context) (*oauth2.Endpoint, error)

func (*JwtContext) RefreshToken

func (c *JwtContext) RefreshToken(ctx context.Context, refreshToken string, client string) (*oauth2.Token, error)

func (*JwtContext) RefreshTokenWithConfig

func (c *JwtContext) RefreshTokenWithConfig(ctx context.Context, refreshToken string, oauthConfig oauth2.Config) (*oauth2.Token, error)

func (*JwtContext) Sourcify

func (c *JwtContext) Sourcify(ctx context.Context, token *oauth2.Token, client string) (oauth2.TokenSource, error)

func (*JwtContext) VerifyToken

func (c *JwtContext) VerifyToken(ctx context.Context, token string, clientId string) (*KeycloakToken, error)

func (*JwtContext) VerifyTokenWithConfig

func (c *JwtContext) VerifyTokenWithConfig(ctx context.Context, token string, config oidc.Config) (*KeycloakToken, error)

type KeycloakToken

type KeycloakToken struct {
	*oidc.IDToken
}

func (*KeycloakToken) ClientRoles

func (t *KeycloakToken) ClientRoles(clientId string) ([]string, error)

Jump to

Keyboard shortcuts

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