Documentation ¶
Index ¶
- type Config
- type Provider
- func (p *Provider) AuthorizeHandler(rw http.ResponseWriter, req *http.Request)
- func (p *Provider) AuthorizeResponse(rw http.ResponseWriter, req *http.Request, ar *payload.AuthenticationRequest, ...)
- func (p *Provider) ErrorPage(rw http.ResponseWriter, code int, title string, message string)
- func (p *Provider) Found(rw http.ResponseWriter, uri *url.URL, params interface{}, asFragment bool)
- func (p *Provider) GetAccessTokenClaimsFromRequest(req *http.Request) (*konnect.AccessTokenClaims, error)
- func (p *Provider) JwksHandler(rw http.ResponseWriter, req *http.Request)
- func (p *Provider) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (p *Provider) SetSigningKey(id string, key crypto.Signer, signingMethod jwt.SigningMethod) error
- func (p *Provider) TokenHandler(rw http.ResponseWriter, req *http.Request)
- func (p *Provider) UserInfoHandler(rw http.ResponseWriter, req *http.Request)
- func (p *Provider) WellKnownHandler(rw http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Config *config.Config IssuerIdentifier string WellKnownPath string JwksPath string AuthorizationPath string TokenPath string UserInfoPath string IdentityManager identity.Manager CodeManager code.Manager }
Config defines a Provider's configuration settings.
type Provider ¶
type Provider struct { Config *Config // contains filtered or unexported fields }
Provider defines an OIDC provider with the handlers for the OIDC endpoints.
func NewProvider ¶
NewProvider returns a new Provider.
func (*Provider) AuthorizeHandler ¶
func (p *Provider) AuthorizeHandler(rw http.ResponseWriter, req *http.Request)
AuthorizeHandler implements the HTTP authorization endpoint for OpenID Connect 1.0 as specified at http://openid.net/specs/openid-connect-core-1_0.html#ImplicitAuthorizationEndpoint
Currently AuthorizeHandler implements only the Implicit Flow as specified at http://openid.net/specs/openid-connect-core-1_0.html#ImplicitFlowAuth
func (*Provider) AuthorizeResponse ¶
func (p *Provider) AuthorizeResponse(rw http.ResponseWriter, req *http.Request, ar *payload.AuthenticationRequest, auth identity.AuthRecord, err error)
AuthorizeResponse writes the result according to the provided parameters to the provided http.ResponseWriter.
func (*Provider) Found ¶
Found writes a HTTP 302 to the provided ResponseWriter with the appropriate Location header creates from the other parameters.
func (*Provider) GetAccessTokenClaimsFromRequest ¶
func (p *Provider) GetAccessTokenClaimsFromRequest(req *http.Request) (*konnect.AccessTokenClaims, error)
GetAccessTokenClaimsFromRequest reads incoming request, validates the access token and returns the validated claims.
func (*Provider) JwksHandler ¶
func (p *Provider) JwksHandler(rw http.ResponseWriter, req *http.Request)
JwksHandler implements the HTTP provider JWKS endpoint for OpenID provider metadata used with OpenID Connect Discovery 1.0 as specified at https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
func (*Provider) ServeHTTP ¶
func (p *Provider) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServerHTTP implements the http.HandlerFunc interface.
func (*Provider) SetSigningKey ¶
func (p *Provider) SetSigningKey(id string, key crypto.Signer, signingMethod jwt.SigningMethod) error
SetSigningKey sets the provided signer as key for token signing and uses the provided id as key id. The public key of the provided signer is also added as validation key with the same id.
func (*Provider) TokenHandler ¶
func (p *Provider) TokenHandler(rw http.ResponseWriter, req *http.Request)
TokenHandler implements the HTTP token endpoint for OpenID Connect 1.0 as specified at http://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint
func (*Provider) UserInfoHandler ¶
func (p *Provider) UserInfoHandler(rw http.ResponseWriter, req *http.Request)
UserInfoHandler implements the HTTP userinfo endpoint for OpenID Connect 1.0 as specified at https://openid.net/specs/openid-connect-core-1_0.html#UserInfo
func (*Provider) WellKnownHandler ¶
func (p *Provider) WellKnownHandler(rw http.ResponseWriter, req *http.Request)
WellKnownHandler implements the HTTP provider configuration endpoint for OpenID Connect 1.0 as specified at https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig