Classes: AuthenticationHelper

AuthenticationHelper


new AuthenticationHelper(config)

Parameters:
Name Type Description
config Object

The configuration for the OpenID provider

Properties
Name Type Description
configuration_endpoint string

The url to the configuration endpoint of the OpenID provider

client_id string

The OpenID client ID.

client_secret string

The OpenID client secret.

callbackRoute string

The route that the OpenID provider will redirect to once authentication is completed

scopes Array.<string>

The scopes to use in the authentication request to the OpenID provider

Source:

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
req

The express request object

res

The express response object

Source:

createRoutes(app)

Create routes on an express instance to handle authentication

Parameters:
Name Type Description
app

The express() app

Source:

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
res

The express response object

returnUrl

The url to return to

Source: