cypress-nextjs-auth0 icon indicating copy to clipboard operation
cypress-nextjs-auth0 copied to clipboard

[Feature] Support for Auth0 Organizations

Open user7of4 opened this issue 2 years ago • 0 comments

Feature Request

Auth0 also provides logins to Organizations. Add cypress env var 'auth0OrganizationId'. The login() command will login to an organization if 'auth0OrganizationId' env var is set to an Auth0 organization id.

Basic example

Assign organization id env var to organization param. This is 'getUserTokens' command in 'get-user-tokens.js'.

auth.client.loginWithDefaultDirectory(
  {
    organization: Cypress.env('auth0OrganizationId'), // <-- add organization id
    username,
    password,
    audience: Cypress.env('auth0Audience'),
    scope: Cypress.env('auth0Scope'),
    client_secret: Cypress.env('auth0ClientSecret'), // eslint-disable-line @typescript-eslint/camelcase
  },

Motivation

Login to Organizations can be tested.

user7of4 avatar Jun 03 '22 21:06 user7of4