Documentation
¶
Index ¶
- Constants
- func DeleteAuthnCookie(response http.ResponseWriter)
- func GetAuthnCookie(request *http.Request) (*http.Cookie, error)
- func NewAuthnAPIController(logger log.Logger, s api.InternalApiServicer) api.Router
- func NewAuthnService(log logging.Logger, credentials credentials.CredentialsService, ...) api.InternalApiServicer
- func WithLoginSessionFromRequest(l log.Logger, w http.ResponseWriter, r *http.Request, run func(LoginSession))
- type Config
- type LoginSession
- type Middleware
Constants ¶
const LoginSessionContextKey contextKey = "login-session"
LoginSessionContextKey is the context key for the Login Session
Variables ¶
This section is empty.
Functions ¶
func DeleteAuthnCookie ¶
func DeleteAuthnCookie(response http.ResponseWriter)
func NewAuthnAPIController ¶
NewAuthnAPIController creates a default api controller
func NewAuthnService ¶
func NewAuthnService( log logging.Logger, credentials credentials.CredentialsService, identities identities.Service, token session.SessionService, invites api.InvitesApiServicer, landingURL string, ) api.InternalApiServicer
NewAuthnService - Creates a default service that handles the registration and login
func WithLoginSessionFromRequest ¶
func WithLoginSessionFromRequest(l log.Logger, w http.ResponseWriter, r *http.Request, run func(LoginSession))
WithLoginSessionFromRequest - Pulls the Login Session out of the context of a request if its not available returns an error response on `w`.
Types ¶
type Config ¶
type Config struct {
LandingURL string
Keys webkeys.WebKeysConfig
}
type LoginSession ¶
type LoginSession struct {
State string `json:"state"` // CSRF state token used during login
// Set during logging in everytime and used to look up credentials
Issuer *string `json:"issuer"` // Issuer attribute of the login
// IP Address of the login
IP string `json:"ip"`
// Scope of what this token is allow to do.
Scopes []string `'json:"scp"`
// standard JWT claims like expirations etc...
jwe.Claims
// Store whatever we can get from the OIDC provider if the invite code isn't empty
api.Register
}
LoginSession is the values of the JWT coming in from the Authentication services.
func LoginSessionFromRequest ¶
func LoginSessionFromRequest(r *http.Request) (*LoginSession, error)
LoginSessionFromRequest - Pulls the Login Session out of the context of a request
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
Middleware - Handles authenticating a request came from the authn services
func NewMiddleware ¶
func NewMiddleware(log logging.Logger, time stime.TimeService, jweService jwe.JWEService) (*Middleware, error)
NewMiddleware - Generates a default AuthnMiddleware for use with authenticating a request came from the authn services
func (*Middleware) FromRequest ¶
func (s *Middleware) FromRequest(r *http.Request) (*LoginSession, error)
FromRequest - Pulls out authenticationd details from the Request and calls Parse.