gopenidclient package

import "code.pfad.fr/gopenidclient"

package gopenidclient is an attempt to provide nice OAuth2 / OpenID Connect (OIDC) interface.

OAuth2 integration is provided in the "static" package. An OpenID Connect (OIDC) provider backed by github.com/coreos/go-oidc/v3/oidc is available under code.pfad.fr/gopenidclient/coreos.

Index

type Assertion

Assertion allows the usage of client_assertion instead of client_secret for better security. The code.pfad.fr/gopenidclient/coreos provider supports it. See code.pfad.fr/gopenidclient/assertion.RS256 for an implementation based on RSA+SHA256.

type CallbackResult

CallbackResult is returned at the end of the login flow

type CookieManager

func (CookieManager) Clear

func (CookieManager) GetState

GetState gets the state cookie (which stores the intended URL of the user before authentication).

func (CookieManager) SetState

SetState sets the state cookie (which stores the intended URL of the user before authentication).

type ExchangeHandler

ExchangeHandler implements the exchange-code flow (including PKCE challenge).

func (ExchangeHandler) HandleCallback

HandleCallback should be called after the user logged in at the provider.

func (ExchangeHandler) RedirectToAuthCodeURL

RedirectToAuthCodeURL should be called to redirect the user to the provider for login.

type Provider

Provider is an interface suitable for OAuth2 and OIDC flows.

Source Files

cookie.go exchange.go provider.go

Directories

Path Synopsis
assertion package assertion authenticate OpenID Connect clients using [private_key_jwt] (private/public certificates instead of a shared secret), via OAuth 2.0 assertions specified in [RFC 7521].
common package common gather methods used by the provider implementation
coreos package coreos provides a Provider for OpenID Connect (code.pfad.fr/gopenidclient), backed by the github.com/coreos/go-oidc/v3/oidc package.
refresh package refresh uses the refresh-token as a remember token (stored encrypted in a dedicated cookie).
static package static uses golang.org/x/oauth2 to implement a Provider for the OAuth2 flow with a static config.

Forge

https://codeberg.org/pfad.fr/gopenidclient

git clone
https://codeberg.org/pfad.fr/gopenidclient.git
git@codeberg.org:pfad.fr/gopenidclient.git