azureoidc

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package azureoidc implements a client for Azure OIDC Authorization Code Flow with PKCE (Proof Key for Code Exchange).

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
}

Authenticator defines the interface for authenticating users via OpenID Connect.

type OIDC

type OIDC struct {
	loader.Loader
	// contains filtered or unexported fields
}

OIDC implements the Authenticator interface for OpenID Connect authentication.

func New

func New(cookieClient *internalcookie.Client, 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

Directories

Path Synopsis
Package loader contains interfaces for safely accessing an OIDC Provider.
Package loader contains interfaces for safely accessing an OIDC Provider.

Jump to

Keyboard shortcuts

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