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

Missing request token cookie when using azure provider #436

Open
BorisAng opened this issue Sep 25, 2019 · 0 comments
Open

Missing request token cookie when using azure provider #436

BorisAng opened this issue Sep 25, 2019 · 0 comments
Labels
support Questions, discussions, and general support

Comments

@BorisAng
Copy link

BorisAng commented Sep 25, 2019

We have set azure as our provider when using bell as authentication strategy.

After registering the server strategy with server.auth.strategy we run our server. Then on front-end load, we tell the application to navigate to our login (i.e. /sso) route which uses the auth strategy registered above.

We expect to either not be authenticated or return the credentials, however, we are being thrown a CORS error. When we click on the URL which we were redirected from, we get another error stating Authentication failed due to: Missing custom request token cookie.

Now, as far as we understood this basically means that the temporary cookie which bell saves between redirects did not survive the OAuth flow. Somebody suggested that this would usually be a compatibility problem between our browser and the cookie settings we are using. We tried to fix it by setting isSameSite: 'Lax' in the settings of our strategy that uses bell. We also tried using different browsers (IE, Chrome, Firefox), however, neither of these solutions worked.

This is how the strategy looks like and we also have CORS enabled on our routes:

    provider: 'azure',
    config: {
      tenant: config.tenant,
    },
    ttl: 1000 * 60 * 60 * 24,
    password: config.password,
    clientId: config.clientId,
    clientSecret: config.clientSecret, 
    // isHttpOnly: true,
    isSecure: false, // Should be set to true (which is the default) in production
    // forceHttps: true,
    isSameSite: 'Lax',
    providerParams: {
      response_type: 'code'
    },
    scope: ['openid', 'offline_access', 'profile', 'User.Read']
  }) 

Is there a way in which we can make our server work with azure provider ?

@hueniverse hueniverse added the support Questions, discussions, and general support label Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions, discussions, and general support
Projects
None yet
Development

No branches or pull requests

2 participants