services

package
v0.0.0-...-dede1a6 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuth2OIDCService

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

OAuth2OIDCService defines the OAuth2 OIDC Service struct.

func (*OAuth2OIDCService) Claims

func (osvc *OAuth2OIDCService) Claims(ctx context.Context, code string) (models.Tokens, error)

Claims creates claims tokens based on the auth code returned from the OIDC provider.

func (*OAuth2OIDCService) Create

Create a new JWT token based on Custom Claims models.

func (*OAuth2OIDCService) Decode

func (osvc *OAuth2OIDCService) Decode(tokenString string) (models.UserInfo, error)

Decode validates the token and returns the claims.

func (*OAuth2OIDCService) GetOIDCProviderURL

func (osvc *OAuth2OIDCService) GetOIDCProviderURL() (string, error)

GetOIDCProviderURL gets OIDC provider URL from the OAuth2 configuration.

func (*OAuth2OIDCService) IsFlowSecure

func (osvc *OAuth2OIDCService) IsFlowSecure(state string, token models.Tokens) (bool, error)

IsFlowSecure ensures the flow is secure and then, returns a JWT token.

type OIDCService

type OIDCService interface {
	GetOIDCProviderURL() (string, error)
	Claims(ctx context.Context, code string) (models.Tokens, error)
	IsFlowSecure(state string, token models.Tokens) (bool, error)
	Create(cc models.CustomClaims) (models.CustomClaims, error)
	Decode(tokenString string) (models.UserInfo, error)
}

OIDCService defines a interface for OIDC Service.

func NewOAuth2OIDCService

func NewOAuth2OIDCService(logger logging.Logger,
	configuration configurations.OIDCServiceConfiguration,
	client clients.OIDCClient,
	sessionStorage *storages.SessionStorage) OIDCService

NewOAuth2OIDCService creates a new OAuth2 OIDC Service struct.

Jump to

Keyboard shortcuts

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