hydra

package
v2.2.0-rc2+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptLogout

func AcceptLogout(ctx context.Context, challenge string, accessToken string, refreshToken string) error

func CreateAuthCode

func CreateAuthCode(ctx context.Context, consent *auth.ID, clientID, redirectURI string) (string, error)

func CreateConsent

func CreateConsent(ctx context.Context, loginChallenge string) (*auth.ID, error)

func CreateLogin

func CreateLogin(ctx context.Context, clientID string, scopes, audiences []string) (*auth.ID, error)

func CreateLogout

func CreateLogout(ctx context.Context, url, subject, sessionID string) (*auth.ID, error)

func Exchange

func Exchange(ctx context.Context, code string) (*oauth2.Token, error)

func GetLogin

func GetLogin(ctx context.Context, challenge string) (*auth.GetLoginResponse, error)

func PasswordCredentialsToken

func PasswordCredentialsToken(ctx context.Context, username, password string) (*oauth2.Token, error)

Types

type ConsentResponse

type ConsentResponse struct {
	Challenge                    string   `json:"challenge"`
	Skip                         bool     `json:"skip"`
	Subject                      string   `json:"subject"`
	RequestedScope               []string `json:"requested_scope"`
	RequestedAccessTokenAudience []string `json:"requested_access_token_audience"`
}

type LogoutResponse

type LogoutResponse struct {
	RequestURL  string `json:"request_url"`
	RPInitiated bool   `json:"rp_initiated"`
	SID         string `json:"sid"`
	Subject     string `json:"subject"`
}

type RedirectResponse

type RedirectResponse struct {
	RedirectTo string `json:"redirect_to"`
}

func AcceptConsent

func AcceptConsent(ctx context.Context, challenge string, scopes, audiences []string, accessToken, idToken map[string]string) (*RedirectResponse, error)

func AcceptLogin

func AcceptLogin(ctx context.Context, challenge string, subject string) (*RedirectResponse, error)

type TokenResponse

type TokenResponse struct {
	IDToken      string `json:"id_token"`
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	ExpiresIn    int64  `json:"expires_in"`
}

func Refresh

func Refresh(ctx context.Context, refreshToken string) (*TokenResponse, error)

Jump to

Keyboard shortcuts

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