Documentation
¶
Overview ¶
Package oidc provides OpenID Connect integration for the auth module. It includes functionality for validating OIDC tokens and extracting user information.
Index ¶
- type Config
- type Service
- func (s *Service) Exchange(ctx context.Context, code string) (*oauth2.Token, error)
- func (s *Service) GetAuthURL(state string) string
- func (s *Service) GetUserInfo(ctx context.Context, token *oauth2.Token) (*oidc.UserInfo, error)
- func (s *Service) IsAdmin(roles []string) bool
- func (s *Service) ValidateToken(ctx context.Context, tokenString string) (*jwt.Claims, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// IssuerURL is the URL of the OIDC provider
IssuerURL string
// ClientID is the client ID for the OIDC provider
ClientID string
// ClientSecret is the client secret for the OIDC provider
ClientSecret string
// RedirectURL is the redirect URL for the OIDC provider
RedirectURL string
// Scopes are the OAuth2 scopes to request
Scopes []string
// AdminRoleName is the name of the admin role
AdminRoleName string
// Timeout is the timeout for OIDC operations
Timeout time.Duration
}
Config holds the configuration for OIDC integration.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles OIDC operations.
func NewService ¶
NewService creates a new OIDC service with the provided configuration and logger.
func (*Service) GetAuthURL ¶
GetAuthURL returns the URL for the OAuth2 authorization endpoint.
func (*Service) GetUserInfo ¶
GetUserInfo gets the user info from the OIDC provider.
Click to show internal directories.
Click to hide internal directories.