Documentation
¶
Index ¶
- Constants
- Variables
- func CheckPassword(password, hash string) bool
- func HashPassword(password string) (string, error)
- func SignToken(token, secret string) string
- func VerifyToken(signedToken, secret string) (string, error)
- type Claims
- type OIDCConfig
- func (c *OIDCConfig) AuthURL() string
- func (c *OIDCConfig) AuthURLWithPKCE(state string, pkce *PKCEParams) string
- func (c *OIDCConfig) ExchangeCodeWithPKCE(ctx context.Context, code string, codeVerifier string) (*oauth2.Token, error)
- func (c *OIDCConfig) GetClaims(ctx context.Context, token string) (*Claims, error)
- func (c *OIDCConfig) VerifyToken(ctx context.Context, token string) error
- type PKCEParams
Constants ¶
View Source
const MemoryOnlyPrefix = "mem_"
MemoryOnlyPrefix is used to mark tokens that should only exist in memory
Variables ¶
Functions ¶
func CheckPassword ¶
func HashPassword ¶
func VerifyToken ¶
Types ¶
type OIDCConfig ¶
func NewOIDC ¶
func NewOIDC(ctx context.Context, cfg config.OIDCConfig) (*OIDCConfig, error)
func (*OIDCConfig) AuthURL ¶
func (c *OIDCConfig) AuthURL() string
func (*OIDCConfig) AuthURLWithPKCE ¶ added in v0.4.0
func (c *OIDCConfig) AuthURLWithPKCE(state string, pkce *PKCEParams) string
AuthURLWithPKCE generates an authorization URL with PKCE parameters
func (*OIDCConfig) ExchangeCodeWithPKCE ¶ added in v0.4.0
func (c *OIDCConfig) ExchangeCodeWithPKCE(ctx context.Context, code string, codeVerifier string) (*oauth2.Token, error)
ExchangeCodeWithPKCE exchanges authorization code for tokens using PKCE
func (*OIDCConfig) VerifyToken ¶
func (c *OIDCConfig) VerifyToken(ctx context.Context, token string) error
type PKCEParams ¶ added in v0.4.0
PKCEParams holds PKCE parameters for OAuth2 flow
func GeneratePKCEParams ¶ added in v0.4.0
func GeneratePKCEParams() (*PKCEParams, error)
GeneratePKCEParams generates PKCE code verifier and challenge
Click to show internal directories.
Click to hide internal directories.