Documentation ¶
Index ¶
- func NewInMemoryAuthnSessionManager() goidc.AuthnSessionManager
- func NewInMemoryClientManager() goidc.ClientManager
- func NewInMemoryGrantSessionManager() goidc.GrantSessionManager
- func NewMongoDBAuthnSessionManager(database *mongo.Database) goidc.AuthnSessionManager
- func NewMongoDBClientManager(database *mongo.Database) goidc.ClientManager
- func NewMongoDBGrantSessionManager(database *mongo.Database) goidc.GrantSessionManager
- type Provider
- func (p *Provider) AddClient(client *goidc.Client)
- func (p *Provider) AddPolicy(policy goidc.AuthnPolicy)
- func (p *Provider) AddUserInfoSignatureKeyIDs(userInfoSignatureKeyIDs ...string)
- func (p *Provider) EnableAuthorizationDetailsParameter(types ...string)
- func (p *Provider) EnableBasicSecretClientAuthn()
- func (p *Provider) EnableClaimsParameter()
- func (p *Provider) EnableClientSecretJWTAuthn(assertionLifetimeSecs int, signatureAlgorithms ...jose.SignatureAlgorithm)
- func (p *Provider) EnableDemonstrationProofOfPossesion(dpopLifetimeSecs int, dpopSigningAlgorithms ...jose.SignatureAlgorithm)
- func (p *Provider) EnableDynamicClientRegistration(dcrPlugin goidc.DCRPluginFunc, shouldRotateTokens bool)
- func (p *Provider) EnableImplicitGrantType()
- func (p *Provider) EnableIssuerResponseParameter()
- func (p *Provider) EnableJWTSecuredAuthorizationRequestEncryption(keyEncryptionIDs []string, ...)
- func (p *Provider) EnableJWTSecuredAuthorizationRequests(jarLifetimeSecs int, jarAlgorithms ...jose.SignatureAlgorithm)
- func (p *Provider) EnableJWTSecuredAuthorizationResponseMode(jarmLifetimeSecs int, defaultJARMSignatureKeyID string, ...)
- func (p *Provider) EnableJWTSecuredAuthorizationResponseModeEncryption(keyEncryptionAlgorithms []jose.KeyAlgorithm, ...)
- func (p *Provider) EnableMTLS(mtlsHost string)
- func (p *Provider) EnableNoneClientAuthn()
- func (p *Provider) EnablePrivateKeyJWTClientAuthn(assertionLifetimeSecs int, signatureAlgorithms ...jose.SignatureAlgorithm)
- func (p *Provider) EnableProofKeyForCodeExchange(codeChallengeMethods ...goidc.CodeChallengeMethod)
- func (p *Provider) EnablePushedAuthorizationRequests(parLifetimeSecs int)
- func (p *Provider) EnableRefreshTokenGrantType(refreshTokenLifetimeSecs int, shouldRotateTokens bool)
- func (p *Provider) EnableSecretPostClientAuthn()
- func (p *Provider) EnableSelfSignedTLSClientAuthn()
- func (p *Provider) EnableTLSBoundTokens()
- func (p *Provider) EnableTLSClientAuthn()
- func (p *Provider) EnableTokenIntrospection(clientAuthnMethods ...goidc.ClientAuthnType)
- func (p *Provider) EnableUserInfoEncryption(keyEncryptionAlgorithms []jose.KeyAlgorithm, ...)
- func (p *Provider) Handler() http.Handler
- func (p *Provider) RequireDemonstrationProofOfPossesion(dpopLifetimeSecs int, dpopSigningAlgorithms ...jose.SignatureAlgorithm)
- func (p *Provider) RequireJWTSecuredAuthorizationRequests(jarLifetimeSecs int, jarAlgorithms ...jose.SignatureAlgorithm)
- func (p *Provider) RequireOpenIDScope()
- func (p *Provider) RequireProofKeyForCodeExchange(codeChallengeMethods ...goidc.CodeChallengeMethod)
- func (p *Provider) RequirePushedAuthorizationRequests(parLifetimeSecs int)
- func (p *Provider) RequireSenderConstrainedTokens()
- func (p *Provider) Run(address string, middlewares ...api.WrapHandlerFunc) error
- func (p *Provider) RunTLS(config TLSOptions, middlewares ...api.WrapHandlerFunc) error
- func (p *Provider) SetAuthenticationSessionTimeout(timeoutSecs int)
- func (p *Provider) SetAuthorizeErrorPlugin(plugin goidc.AuthorizeErrorPluginFunc)
- func (p *Provider) SetClaimTypesSupported(types ...goidc.ClaimType)
- func (p *Provider) SetDisplayValuesSupported(values ...goidc.DisplayValue)
- func (p *Provider) SetIDTokenLifetime(idTokenLifetimeSecs int)
- func (p *Provider) SetProfileFAPI2()
- func (p *Provider) SetScopes(scopes ...goidc.Scope)
- func (p *Provider) SetSupportedAuthenticationContextReferences(acrValues ...goidc.AuthenticationContextReference)
- func (p *Provider) SetSupportedUserClaims(claims ...string)
- func (p *Provider) SetTokenOptions(getTokenOpts goidc.TokenOptionsFunc)
- type TLSOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInMemoryAuthnSessionManager ¶
func NewInMemoryAuthnSessionManager() goidc.AuthnSessionManager
func NewInMemoryClientManager ¶
func NewInMemoryClientManager() goidc.ClientManager
func NewInMemoryGrantSessionManager ¶
func NewInMemoryGrantSessionManager() goidc.GrantSessionManager
func NewMongoDBAuthnSessionManager ¶
func NewMongoDBAuthnSessionManager(database *mongo.Database) goidc.AuthnSessionManager
func NewMongoDBClientManager ¶
func NewMongoDBClientManager(database *mongo.Database) goidc.ClientManager
func NewMongoDBGrantSessionManager ¶
func NewMongoDBGrantSessionManager(database *mongo.Database) goidc.GrantSessionManager
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func New ¶
func New( host string, clientManager goidc.ClientManager, authnSessionManager goidc.AuthnSessionManager, grantSessionManager goidc.GrantSessionManager, privateJWKS jose.JSONWebKeySet, defaultTokenKeyID string, defaultIDTokenKeyID string, ) *Provider
TODO: Make it smaller.
func (*Provider) AddPolicy ¶
func (p *Provider) AddPolicy(policy goidc.AuthnPolicy)
AddPolicy adds an authentication policy that will be evaluated at runtime and then executed if selected.
func (*Provider) AddUserInfoSignatureKeyIDs ¶
AddUserInfoSignatureKeyIDs makes more keys available to sign the user info endpoint response and ID tokens. There should be at most one per algorithm, in other words, there shouldn't be two key IDs that point to two keys that have the same algorithm. This is because clients can choose signing keys per algorithm, e.g. a client can choose the key to sign its ID tokens with the attribute "id_token_signed_response_alg".
func (*Provider) EnableAuthorizationDetailsParameter ¶
func (*Provider) EnableBasicSecretClientAuthn ¶
func (p *Provider) EnableBasicSecretClientAuthn()
func (*Provider) EnableClaimsParameter ¶
func (p *Provider) EnableClaimsParameter()
func (*Provider) EnableClientSecretJWTAuthn ¶
func (*Provider) EnableDemonstrationProofOfPossesion ¶
func (*Provider) EnableDynamicClientRegistration ¶
func (p *Provider) EnableDynamicClientRegistration( dcrPlugin goidc.DCRPluginFunc, shouldRotateTokens bool, )
EnableDynamicClientRegistration allows clients to be registered dynamically. The dcrPlugin is executed during registration and update of the client to perform custom validations (e.g. validate a custom property) or set default values (set the default scopes).
func (*Provider) EnableImplicitGrantType ¶
func (p *Provider) EnableImplicitGrantType()
EnableImplicitGrantType allows the implicit grant type and the associated response types.
func (*Provider) EnableIssuerResponseParameter ¶
func (p *Provider) EnableIssuerResponseParameter()
func (*Provider) EnableJWTSecuredAuthorizationRequestEncryption ¶
func (*Provider) EnableJWTSecuredAuthorizationRequests ¶
func (*Provider) EnableJWTSecuredAuthorizationResponseMode ¶
func (p *Provider) EnableJWTSecuredAuthorizationResponseMode( jarmLifetimeSecs int, defaultJARMSignatureKeyID string, jarmSignatureKeyIDs ...string, )
EnableJWTSecuredAuthorizationResponseMode makes available JARM and the associated response modes.
func (*Provider) EnableJWTSecuredAuthorizationResponseModeEncryption ¶
func (p *Provider) EnableJWTSecuredAuthorizationResponseModeEncryption( keyEncryptionAlgorithms []jose.KeyAlgorithm, contentEncryptionAlgorithms []jose.ContentEncryption, )
func (*Provider) EnableMTLS ¶
func (*Provider) EnableNoneClientAuthn ¶
func (p *Provider) EnableNoneClientAuthn()
func (*Provider) EnablePrivateKeyJWTClientAuthn ¶
func (*Provider) EnableProofKeyForCodeExchange ¶
func (p *Provider) EnableProofKeyForCodeExchange( codeChallengeMethods ...goidc.CodeChallengeMethod, )
EnableProofKeyForCodeExchange makes PKCE available to clients.
func (*Provider) EnablePushedAuthorizationRequests ¶
EnablePushedAuthorizationRequests allows authorization flows to start at the /par endpoint.
func (*Provider) EnableRefreshTokenGrantType ¶
func (p *Provider) EnableRefreshTokenGrantType( refreshTokenLifetimeSecs int, shouldRotateTokens bool, )
EnableRefreshTokenGrantType makes available the refresh token grant. If set to true, shouldRotateTokens will cause a new refresh token to be issued each time one is used. The one used during the request then becomes invalid.
func (*Provider) EnableSecretPostClientAuthn ¶
func (p *Provider) EnableSecretPostClientAuthn()
func (*Provider) EnableSelfSignedTLSClientAuthn ¶
func (p *Provider) EnableSelfSignedTLSClientAuthn()
func (*Provider) EnableTLSBoundTokens ¶
func (p *Provider) EnableTLSBoundTokens()
func (*Provider) EnableTLSClientAuthn ¶
func (p *Provider) EnableTLSClientAuthn()
func (*Provider) EnableTokenIntrospection ¶
func (p *Provider) EnableTokenIntrospection( clientAuthnMethods ...goidc.ClientAuthnType, )
func (*Provider) EnableUserInfoEncryption ¶
func (p *Provider) EnableUserInfoEncryption( keyEncryptionAlgorithms []jose.KeyAlgorithm, contentEncryptionAlgorithms []jose.ContentEncryption, )
EnableUserInfoEncryption allows encryption of ID tokens and of the user info endpoint response.
func (*Provider) RequireDemonstrationProofOfPossesion ¶
func (*Provider) RequireJWTSecuredAuthorizationRequests ¶
func (p *Provider) RequireJWTSecuredAuthorizationRequests( jarLifetimeSecs int, jarAlgorithms ...jose.SignatureAlgorithm, )
RequireJWTSecuredAuthorizationRequests makes JAR required.
func (*Provider) RequireOpenIDScope ¶
func (p *Provider) RequireOpenIDScope()
RequireOpenIDScope forces the openid scope in all requests.
func (*Provider) RequireProofKeyForCodeExchange ¶
func (p *Provider) RequireProofKeyForCodeExchange( codeChallengeMethods ...goidc.CodeChallengeMethod, )
RequireProofKeyForCodeExchange makes PCKE required.
func (*Provider) RequirePushedAuthorizationRequests ¶
RequirePushedAuthorizationRequests forces authorization flows to start at the /par endpoint.
func (*Provider) RequireSenderConstrainedTokens ¶
func (p *Provider) RequireSenderConstrainedTokens()
RequireSenderConstrainedTokens will make at least one sender constraining mechanism (TLS or DPoP) be required, in order to issue an access token to a client.
func (*Provider) Run ¶
func (p *Provider) Run( address string, middlewares ...api.WrapHandlerFunc, ) error
func (*Provider) RunTLS ¶
func (p *Provider) RunTLS( config TLSOptions, middlewares ...api.WrapHandlerFunc, ) error
func (*Provider) SetAuthenticationSessionTimeout ¶
SetAuthenticationSessionTimeout sets the user authentication session lifetime.
func (*Provider) SetAuthorizeErrorPlugin ¶
func (p *Provider) SetAuthorizeErrorPlugin(plugin goidc.AuthorizeErrorPluginFunc)
SetAuthorizeErrorPlugin defines a handler to be executed when the authorization request results in error, but the error can't be redirected. This can be used to display a page with the error. The default behavior is to display a JSON with the error information to the user.
func (*Provider) SetClaimTypesSupported ¶
func (*Provider) SetDisplayValuesSupported ¶
func (p *Provider) SetDisplayValuesSupported(values ...goidc.DisplayValue)
func (*Provider) SetIDTokenLifetime ¶
func (*Provider) SetProfileFAPI2 ¶
func (p *Provider) SetProfileFAPI2()
SetProfileFAPI2 defines the OpenID Provider profile as FAPI 2.0. The server will only be able to run if it is configured respecting the FAPI 2.0 profile. This will also change some of the behavior of the server during runtime to be compliant with the FAPI 2.0.
func (*Provider) SetSupportedAuthenticationContextReferences ¶
func (p *Provider) SetSupportedAuthenticationContextReferences( acrValues ...goidc.AuthenticationContextReference, )
func (*Provider) SetSupportedUserClaims ¶
func (*Provider) SetTokenOptions ¶
func (p *Provider) SetTokenOptions(getTokenOpts goidc.TokenOptionsFunc)
SetTokenOptions defines how access tokens are issued.