coreos

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

package coreos provides a Provider for OpenID Connect (oidc), backed by the github.com/coreos/go-oidc/v3/oidc package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RefreshToken added in v0.2.5

func RefreshToken(ctx context.Context, config *oauth2.Config, refreshToken string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

Types

type OIDC

type OIDC struct {
	Issuer       string
	ClientID     string
	ClientSecret string
	JWT          goath.JWT
	Scopes       []string
	HTTPClient   *http.Client // will use http.DefaultClient if let nil
	// contains filtered or unexported fields
}

OIDC implements a Provider for the OpenID Connect flow. The unexported fields have a correct default value (hence no New method needed).

func (*OIDC) AuthCodeURL

func (o *OIDC) AuthCodeURL(state string) (string, string, error)

AuthCodeURL returns the Auth-URL to redirect the user to

func (*OIDC) EndSessionURL added in v0.2.4

func (o *OIDC) EndSessionURL() (url.URL, error)

func (*OIDC) Exchange

func (o *OIDC) Exchange(code, verifier string) (token *oauth2.Token, unmarshalUser func(interface{}) error, err error)

Exchange exchanges the code and provides a way to unmarshal the user info

func (*OIDC) Refresh added in v0.2.0

func (o *OIDC) Refresh(refreshToken string) (token *oauth2.Token, unmarshalUser func(interface{}) error, err error)

func (*OIDC) SetRedirectURL

func (o *OIDC) SetRedirectURL(url string)

SetRedirectURL sets the local callback URL.

Jump to

Keyboard shortcuts

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