Documentation
¶
Overview ¶
oidc contains the app-specific methods related to auth via Open ID Connect (OIDC)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator interface {
// AuthCodeURL returns the URL to redirect to in order to initiate the OIDC authentication process
AuthCodeURL(ctx context.Context, w http.ResponseWriter, returnURL string) (string, error)
// Verify performs the necessary verification and processing of the OIDC callback request.
// It populates 'claims' with the ID Token's claims and returns:
// - the URL to redirect to following successful authentication
// - the 'sid' value from the session_state query parameter
Verify(ctx context.Context, w http.ResponseWriter, r *http.Request, claims any) (returnURL, oidcSID string, err error)
// LoginURL returns the URL to redirect to when an error occurs during the OIDC authentication process
LoginURL() string
}
type OIDC ¶
func New ¶
func New(s *securecookie.SecureCookie, issuerURL, clientID, clientSecret, redirectURL string) *OIDC
New returns a new OIDC Authenticator
func (*OIDC) AuthCodeURL ¶
func (o *OIDC) AuthCodeURL(ctx context.Context, w http.ResponseWriter, returnURL string) (string, error)
AuthCodeURL returns the URL to redirect to in order to initiate the OIDC authentication process
func (*OIDC) Verify ¶
func (o *OIDC) Verify(ctx context.Context, w http.ResponseWriter, r *http.Request, claims any) (returnURL, sid string, err error)
Verify performs the necessary verification and processing of the OIDC callback request. It populates 'claims' with the ID Token's claims and returns:
- the URL to redirect to following successful authentication
- the 'sid' value from the session_state query parameter
Click to show internal directories.
Click to hide internal directories.