Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typescript defs new config #46

Merged
merged 4 commits into from
Jan 7, 2020
Merged

Add typescript defs new config #46

merged 4 commits into from
Jan 7, 2020

Conversation

joshcanhelp
Copy link
Contributor

@joshcanhelp joshcanhelp commented Jan 3, 2020

Description

  • Update TypeScript definitions
  • Update configuration docs
  • Update config.js order

References

Closes #44

Testing

Manually tested config definitions in local application:

import { ConfigParams, SessionCookieConfigParams } from "./express-openid-connect";

const appSessionCookieConfig: SessionCookieConfigParams = {
  sameSite: 'Lax'
};

const oidcConfig: ConfigParams = {
  appSessionCookie: appSessionCookieConfig,
  appSessionDuration: 234567890,
  appSessionName: 'banana',
  appSessionSecret: [ process.env.APP_SESSION_SECRET ],
  auth0Logout: false,
  authorizationParams: {
    response_type: 'code',
    scope: 'openid profile email'
  },
  baseURL: process.env.BASE_URL,
  clientID: process.env.CLIENT_ID,
  clientSecret: process.env.CLIENT_SECRET,
  clockTolerance: 60,
  errorOnRequiredAuth: false,
  getUser: (req, config) => {
    if (!req[config.appSessionName] || !req[config.appSessionName].claims) {
      return null;
    }
    return req[config.appSessionName].claims;
  },
  handleCallback: async (req, res, next) => next(),
  httpOptions: {},
  identityClaimFilter: ['aud', 'iss', 'iat', 'exp', 'azp', 'auth_time'],
  idpLogout: true,
  idTokenAlg: 'RS256',
  issuerBaseURL: process.env.ISSUER_BASE_URL,
  legacySameSiteCookie: true,
  loginPath: '/login',
  logoutPath: '/logout',
  redirectUriPath: '/callback',
  required: false,
  routes: true
};

app.use(auth(oidcConfig));

@joshcanhelp joshcanhelp added this to the v0.6.0 milestone Jan 3, 2020
@@ -5,14 +5,14 @@ const getUser = require('./hooks/getUser');
const handleCallback = require('./hooks/handleCallback');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just rearranging in this file.

@joshcanhelp joshcanhelp requested a review from a team January 3, 2020 23:29
API.md Outdated Show resolved Hide resolved
index.d.ts Show resolved Hide resolved
@joshcanhelp joshcanhelp requested a review from lbalmaceda January 6, 2020 21:57
@joshcanhelp joshcanhelp mentioned this pull request Jan 6, 2020
1 task
@joshcanhelp joshcanhelp merged commit d7ebc7a into auth0:master Jan 7, 2020
@taschmidt
Copy link

Why is appSessionSecret required in this new typedef when it can pulled from APP_SESSION_SECRET?

@joshcanhelp joshcanhelp deleted the add-typescript-defs-new-config branch January 16, 2020 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"legacySameSiteCookie" for auth config params is not yet available in the typings file.
3 participants