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

Cognito: different app client for localhost redirect #7

Open
fdietze opened this issue Oct 29, 2021 · 1 comment
Open

Cognito: different app client for localhost redirect #7

fdietze opened this issue Oct 29, 2021 · 1 comment

Comments

@fdietze
Copy link
Member

fdietze commented Oct 29, 2021

@maxpschonder

@FloWi
Copy link

FloWi commented Oct 29, 2021

here is the cdk code that @maxpschonder helped me set up

const enduserClient = pool.addClient('enduser-pool-client', {
  idTokenValidity: cdk.Duration.days(1),
  accessTokenValidity: cdk.Duration.days(1),
  refreshTokenValidity: cdk.Duration.days(180),
  authFlows: {
    userPassword: true,
    userSrp: true,
  },
  generateSecret: false,
  preventUserExistenceErrors: true,
  readAttributes: new cognito.ClientAttributes().withStandardAttributes({
    fullname: true,
    email: true,
    preferredUsername: true,
  }),
  oAuth: {
    callbackUrls: [`https://enduser.${props.environment}.your-domain.xyz/`],
    logoutUrls: [`https://enduser.${props.environment}.your-domain.xyz/`],
    scopes: [
      cognito.OAuthScope.EMAIL,
      cognito.OAuthScope.OPENID,
      cognito.OAuthScope.PROFILE,
      cognito.OAuthScope.COGNITO_ADMIN,
    ],
  },
})

const devClient = pool.addClient('enduser-pool-dev-client', {
  idTokenValidity: cdk.Duration.days(1),
  accessTokenValidity: cdk.Duration.days(1),
  refreshTokenValidity: cdk.Duration.days(30),
  authFlows: {
    userPassword: true,
    adminUserPassword: true,
  },
  generateSecret: false,
  preventUserExistenceErrors: true,
  readAttributes: new cognito.ClientAttributes().withStandardAttributes({
    fullname: true,
    email: true,
    preferredUsername: true,
  }),
  oAuth: {
    callbackUrls: ['http://localhost:9000/'],
    logoutUrls: ['http://localhost:9000/'],
    scopes: [
      cognito.OAuthScope.EMAIL,
      cognito.OAuthScope.OPENID,
      cognito.OAuthScope.PROFILE,
      cognito.OAuthScope.COGNITO_ADMIN,
    ],
  },
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants