Documentation ¶
Index ¶
- Constants
- type Configuration
- type ElvID
- func (elvid *ElvID) AuthorizeRequest(r *http.Request, scope string) error
- func (elvid *ElvID) Configure(client libhttp.Client) error
- func (elvid *ElvID) ConnectToServer() error
- func (elvid *ElvID) GetJsonWebKeySetUri() string
- func (elvid ElvID) GetToken(user, secret string) (token *Token, err error)
- func (elvid ElvID) HasValidUserClientAccessToken(accessToken string) (isValid bool, err error)
- type IDManager
- type PublicKeySet
- type Token
Constants ¶
const ( DiscoveryEndpoint = "/.well-known/openid-configuration" JsonWebKeySetEndpoint = "/.well-known/openid-configuration/jwks" AuthorizationEndpoint = "/connect/authorize" TokenEndpoint = "/connect/token" UserInfoEndpoint = "/connect/userinfo" EndSessionEndpoint = "/connect/endsession" CheckSessionEndpoint = "/connect/checksession" RevocationEndpoint = "/connect/revocation" IntrospectionEndpoint = "/connect/introspect" DeviceAuthorizationEndpoint = "/connect/deviceauthorization" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Issuer string `json:"issuer"` JsonWebKeySetUri string `json:"jwks_uri"` // AuthorizationEndpoint string `json:"authorization_endpoint"` TokenEndPoint string `json:"token_endpoint"` // contains filtered or unexported fields }
Configuration contains the configuration information needed to do the initial setup and renewal of the ElvID service
type ElvID ¶
type ElvID struct { Configuration PublicKeySet }
ElvID holds the configurations and keys necessary to communicate with the ElvID service.
func (*ElvID) AuthorizeRequest ¶
AuthorizeRequest takes an incoming request on behalf of the service and extracts the token from the "Authorization" header. The token is then checked for authenticity, and then the claims of that token is verified against the provided scope.
func (*ElvID) ConnectToServer ¶
ConnectToServer performs necessary setup for connections to the external ElvID service
func (*ElvID) GetJsonWebKeySetUri ¶ added in v1.3.1
type IDManager ¶
type IDManager interface { GetToken(user, secret string) (token *Token, err error) AuthorizeRequest(r *http.Request, scope string) error HasValidUserClientAccessToken(accessToken string) (isValid bool, err error) GetJsonWebKeySetUri() string }
IDManager represents a service that is able to provide clients with authorization tokens with the GetToken function, and is capable of authorizing these incoming tokens for the server with the AuthorizeRequest function.
type PublicKeySet ¶
type PublicKeySet struct { Keys []struct { KeyID string `json:"kid"` Algorithm string `json:"alg"` X5C []string `json:"x5c"` } `json:"keys"` }
PublicKeySet (Public Key Set) stores a slice of public keys and their metadata
type Token ¶
type Token struct { AccessToken string `json:"access_token"` ExpiresAt int `json:"expires_at"` ExpiresIn int `json:"expires_in"` IdToken string `json:"id_token"` Profile string `json:"profile"` RefreshToken string `json:"refresh_token"` Scope string `json:"scope"` SessionState string `json:"session_state"` State string `json:"state"` TokenType string `json:"token_type"` }
Token exp
func (Token) AppendToRequest ¶
Append the raw token to the header of the provided request.