Documentation ¶
Index ¶
- type OIDCMockProvider
- func (o *OIDCMockProvider) IdpAuthURL(codeChallenge string) string
- func (o *OIDCMockProvider) RefreshTokens(ctx context.Context, refreshToken, clientAssertion string) (*oidc.Tokens[*oidc.IDTokenClaims], error)
- func (o *OIDCMockProvider) RetrieveTokens(ctx context.Context, code, codeVerifier string) (*oidc.Tokens[*oidc.IDTokenClaims], error)
- func (o *OIDCMockProvider) VerifyTokens(ctx context.Context, accessToken, idTokeb string) (bool, error)
- type OIDCProvider
- func (o *OIDCProvider) IdpAuthURL(codeChallenge string) string
- func (o *OIDCProvider) RefreshTokens(ctx context.Context, refreshToken, clientAssertion string) (*oidc.Tokens[*oidc.IDTokenClaims], error)
- func (o *OIDCProvider) RetrieveTokens(ctx context.Context, code, codeVerifier string) (*oidc.Tokens[*oidc.IDTokenClaims], error)
- func (o *OIDCProvider) VerifyTokens(ctx context.Context, accessToken, idToken string) (bool, error)
- type UnimplementedAuthProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OIDCMockProvider ¶
type OIDCMockProvider struct {
UnimplementedAuthProvider
}
func NewOIDCMockProvider ¶
func NewOIDCMockProvider(clientID, clientSecret, redirectURI, issuer string, scopes []string) (*OIDCMockProvider, error)
NewOIDCProvider creates a new oidc provider
func (*OIDCMockProvider) IdpAuthURL ¶
func (o *OIDCMockProvider) IdpAuthURL(codeChallenge string) string
IdpAuthURL returns the url to redirect the user for authentication
func (*OIDCMockProvider) RefreshTokens ¶
func (o *OIDCMockProvider) RefreshTokens(ctx context.Context, refreshToken, clientAssertion string) (*oidc.Tokens[*oidc.IDTokenClaims], error)
RefreshTokens refreshes the tokens and returns them clientAssertion is the client assertion jwt (tokens.AccessToken)
func (*OIDCMockProvider) RetrieveTokens ¶ added in v0.1.2
func (o *OIDCMockProvider) RetrieveTokens(ctx context.Context, code, codeVerifier string) (*oidc.Tokens[*oidc.IDTokenClaims], error)
RetrieveTokens retrieves the tokens from the idp callback redirect and returns them `code` is the `code` query parameter from the idp callback redirect
func (*OIDCMockProvider) VerifyTokens ¶
type OIDCProvider ¶
type OIDCProvider struct { UnimplementedAuthProvider // contains filtered or unexported fields }
func NewOIDCProvider ¶
func NewOIDCProvider(clientID, clientSecret, redirectURI, issuer string, scopes []string) (*OIDCProvider, error)
NewOIDCProvider creates a new oidc provider
func (*OIDCProvider) IdpAuthURL ¶
func (o *OIDCProvider) IdpAuthURL(codeChallenge string) string
IdpAuthURL returns the url to redirect the user for authentication
func (*OIDCProvider) RefreshTokens ¶
func (o *OIDCProvider) RefreshTokens(ctx context.Context, refreshToken, clientAssertion string) (*oidc.Tokens[*oidc.IDTokenClaims], error)
RefreshTokens refreshes the tokens and returns them clientAssertion is the client assertion jwt (tokens.AccessToken)
func (*OIDCProvider) RetrieveTokens ¶ added in v0.1.2
func (o *OIDCProvider) RetrieveTokens(ctx context.Context, code, codeVerifier string) (*oidc.Tokens[*oidc.IDTokenClaims], error)
RetrieveTokens retrieves the tokens from the idp callback redirect and returns them `code` is the `code` query parameter from the idp callback redirect
func (*OIDCProvider) VerifyTokens ¶
type UnimplementedAuthProvider ¶
type UnimplementedAuthProvider interface { IdpAuthURL(codeChallenge string) string RetrieveTokens(ctx context.Context, code, codeVerifier string) (*oidc.Tokens[*oidc.IDTokenClaims], error) RefreshTokens(ctx context.Context, refreshToken, clientAssertion string) (*oidc.Tokens[*oidc.IDTokenClaims], error) VerifyTokens(ctx context.Context, accessToken, idToken string) (bool, error) }
Create auth provicer interface