client

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOriginRequestUrl

func GetOriginRequestUrl(request *http.Request) string

Types

type AccessToken

type AccessToken struct {
	Token     string `json:"token"`
	Scope     string `json:"scope"`
	ExpiresAt int64  `json:"expiresAt"`
}

type LogtoClient

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

func NewLogtoClient

func NewLogtoClient(config *LogtoConfig, storage Storage) *LogtoClient

func (*LogtoClient) GetAccessToken

func (logtoClient *LogtoClient) GetAccessToken(resource string) (AccessToken, error)

func (*LogtoClient) GetIdToken

func (LogtoClient *LogtoClient) GetIdToken() string

func (*LogtoClient) GetIdTokenClaims

func (logtoClient *LogtoClient) GetIdTokenClaims() (core.IdTokenClaims, error)

func (*LogtoClient) GetRefreshToken

func (logtoClient *LogtoClient) GetRefreshToken() string

func (*LogtoClient) HandleSignInCallback

func (logtoClient *LogtoClient) HandleSignInCallback(request *http.Request) error

func (*LogtoClient) IsAuthenticated

func (logtoClient *LogtoClient) IsAuthenticated() bool

func (*LogtoClient) SaveAccessToken

func (logtoClient *LogtoClient) SaveAccessToken(key string, accessToken AccessToken)

func (*LogtoClient) SetIdToken

func (logtoClient *LogtoClient) SetIdToken(idToken string)

func (*LogtoClient) SetRefreshToken

func (logtoClient *LogtoClient) SetRefreshToken(refreshToken string)

func (*LogtoClient) SignIn

func (logtoClient *LogtoClient) SignIn(redirectUri string) (string, error)

func (*LogtoClient) SignOut

func (logtoClient *LogtoClient) SignOut(postLogoutRedirectUri string) (string, error)

type LogtoConfig

type LogtoConfig struct {
	Endpoint  string
	AppId     string
	AppSecret string
	Scopes    []string
	Resources []string
	Prompt    string
	// TODO: Find a way to make this value default to true
	PersistAccessToken bool
}

type SignInContext

type SignInContext struct {
	RedirectUri   string
	CodeVerifier  string
	CodeChallenge string
	State         string
}

type Storage

type Storage interface {
	GetItem(key string) string
	SetItem(key, value string)
}

Jump to

Keyboard shortcuts

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