oidc

package
v0.0.0-...-4b98c26 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessToken

func AccessToken(c echo.Context) error

AccessToken delivers an access_token and a refresh_token if the client gives a valid token for OIDC.

func FindLoginDomain

func FindLoginDomain(host string) (string, bool)

FindLoginDomain returns the context name for which the login domain matches the host.

func Login

func Login(c echo.Context) error

Login checks that the OpenID Connect has been successful and logs in the user.

func LoginDomainHandler

func LoginDomainHandler(c echo.Context, contextName string) error

LoginDomainHandler is the handler for the requests on the login domain. It shows a page with a login button (that can start the OIDC dance).

func Redirect

func Redirect(c echo.Context) error

Redirect is the route after the Identity Provider has redirected the user to the stack. The redirection is made to a generic domain, like oauthcallback.cozy.localhost and the association with an instance is made via a call to the UserInfo endpoint. It redirects to the cozy instance to login the user.

func Routes

func Routes(router *echo.Group)

Routes setup routing for OpenID Connect routes. Careful, the normal middlewares NeedInstance and LoadSession are not applied to this group in web/routing

func Start

func Start(c echo.Context) error

Start is the route to start the OpenID Connect dance.

Types

type Config

type Config struct {
	AllowOAuthToken     bool
	AllowCustomInstance bool
	ClientID            string
	ClientSecret        string
	Scope               string
	RedirectURI         string
	AuthorizeURL        string
	TokenURL            string
	UserInfoURL         string
	UserInfoField       string
	UserInfoPrefix      string
	UserInfoSuffix      string
	IDTokenKeyURL       string
}

Config is the config to log in a user with an OpenID Connect identity provider.

Jump to

Keyboard shortcuts

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