oidc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthError

type AuthError struct {
	Err error
}

AuthError represents an authentication error.

func (AuthError) Error

func (e AuthError) Error() string

func (AuthError) Unwrap

func (e AuthError) Unwrap() error

type Verifier

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

Verifier holds all information needed to verify an access token offline.

func NewVerifier

func NewVerifier(issuer string, clientid string, audience string) (*Verifier, error)

NewVerifier returns a Verifier.

func (*Verifier) Auth

Auth extracts the token, validates it and returns the user information.

func (*Verifier) Callback

func (o *Verifier) Callback(w http.ResponseWriter, r *http.Request)

func (*Verifier) IsRequest

func (o *Verifier) IsRequest(r *http.Request) bool

IsRequest checks if the request is using OIDC authentication.

func (*Verifier) Login

func (o *Verifier) Login(w http.ResponseWriter, r *http.Request)

func (*Verifier) Logout

func (o *Verifier) Logout(w http.ResponseWriter, r *http.Request)

func (*Verifier) VerifyAccessToken

func (o *Verifier) VerifyAccessToken(ctx context.Context, token string) (*oidc.AccessTokenClaims, error)

VerifyAccessToken is a wrapper around op.VerifyAccessToken which avoids having to deal with Go generics elsewhere. It validates the access token (issuer, signature and expiration).

func (*Verifier) WriteHeaders

func (o *Verifier) WriteHeaders(w http.ResponseWriter) error

WriteHeaders writes the OIDC configuration as HTTP headers so the client can initatiate the device code flow.

Jump to

Keyboard shortcuts

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