Interface ResponseContext

The response authentication context found on the Express response when OpenID Connect auth middleware is added to your application.

app.use(auth());

app.get('/admin-login', (req, res) => {
res.oidc.login({ returnTo: '/admin' })
})

Hierarchy

  • ResponseContext

Properties

Properties

callback: ((opts?) => Promise<void>)

Type declaration

    • (opts?): Promise<void>
    • Provided by default via the /callback route. Call this to override or have other callback routes with

      app.get('/callback', (req, res) => {
      res.oidc.callback({ redirectUri: 'https://example.com/callback' });
      });

      Parameters

      Returns Promise<void>

login: ((opts?) => Promise<void>)

Type declaration

    • (opts?): Promise<void>
    • Provided by default via the /login route. Call this to override or have other login routes with custom authorizationParams or returnTo

      app.get('/admin-login', (req, res) => {
      res.oidc.login({
      returnTo: '/admin',
      authorizationParams: {
      scope: 'openid profile email admin:user',
      }
      });
      });

      Parameters

      Returns Promise<void>

logout: ((opts?) => Promise<void>)

Type declaration

    • (opts?): Promise<void>
    • Provided by default via the /logout route. Call this to override or have other logout routes with custom returnTo

      app.get('/admin-logout', (req, res) => {
      res.oidc.logout({ returnTo: '/admin-welcome' })
      });

      Parameters

      Returns Promise<void>