new AuthenticationHelper(config)
Parameters:
| Name | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | The configuration for the OpenID provider Properties
|
Methods
-
<static> redirectToLogin(req, res)
-
Will redirect to the login endpoint with a generated token. This function should be called when authentication is required but not present.
Parameters:
Name Type Description reqThe express request object
resThe express response object
-
createRoutes(app)
-
Create routes on an express instance to handle authentication
Parameters:
Name Type Description appThe express() app
-
returnToUrl(res, returnUrl)
-
Redirects an express request back to an endpoint. Will do some checks to prevent ending up in redirect loops.
Parameters:
Name Type Description resThe express response object
returnUrlThe url to return to