Default implementation for passport authentication
Handler for access denied responses in the event that a user is not authorized to access a resource. This method can be overridden to provide a custom access denied handler
Creates a middleware for authentication purposes.
This method wraps
passport.authenticate to provide a middleware for authenticating users.
It also includes a check if the user is already authenticated. If the user is already
authenticated, it redirects back to the application, otherwise, it proceeds to authenticate
Strategy to be used by Passport's authenticate function
Creates a middleware for authentication purposes that will base on JWT tokens. This will send back a status of 200 with the token and user profile on successful authentcation, otherwise it sends a status of 401.
secret used to sign the JWT token
UserService custom implementation
UserRepository custom implementation
Initializes an Express application to use passport. Note: If the session options are not defined, session based authentication will not be used.
An express application
Session options to be used by express-session
Secret to be used for Passport's JWT strategy
Function which checks if the user requesting access to the resource is authenticated and authorized to access the resource. Returns a status of 401 if the user is not authenticated and returns a status of 403 if the user does not have the required role.
Role which the user needs in order to access this resource
Sets the url to return to after successful login. This method can be overridden to provide a custom URL to return to
Sets up the local strategy, serializer and deserializer to be used by Passport's cookie based authentication. Method can be overridden to provide custom passport setup
Sets up the JWT strategy, serializer and deserializer to be used by Passport's token based authentication. Method can be overridden to provide custom passport setup
Options used for Passport's JWT strategy
Generated using TypeDoc