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

With a custom domain, JWKs aren't being fetched from the correct domain #790

Closed
drobin03 opened this issue Apr 30, 2020 · 1 comment · Fixed by #792
Closed

With a custom domain, JWKs aren't being fetched from the correct domain #790

drobin03 opened this issue Apr 30, 2020 · 1 comment · Fixed by #792
Milestone

Comments

@drobin03
Copy link
Contributor

Description

** Disclaimer ** I am on a project with a closed (to me) Auth0 configuration, so I might be off base here.

We have a custom domain configured in Auth0. The problem is, the main Auth0 domain returns a 404 from '.auth0.com/.well-known/jwks.json', whereas on the custom domain, that endpoint exists and returns correctly. Unfortunately, the WP_Auth0_Api_Get_Jwks::call method appears to always fetch from the main domain, rather than the custom domain, so the login is broken.

I suspect that in a custom domain setup, this call should be made against the custom domain, rather than the main Auth0 domain.

Reproduction

I have these settings:

define('AUTH0_ENV_DOMAIN', 'xxx');
define('AUTH0_ENV_CUSTOM_DOMAIN', 'xxx');
define('AUTH0_ENV_CLIENT_ID', 'xxx');
define('AUTH0_ENV_CLIENT_SECRET', 'xxxx');
define('AUTH0_ENV_CLIENT_SIGNING_ALGORITHM', 'RS256');
define('AUTH0_ENV_REQUIRES_VERIFIED_EMAIL', 0);
define('AUTH0_ENV_AUTO_PROVISIONING', 1);
define('AUTH0_ENV_AUTO_LOGIN', 0);

This is a consistent issue in my setup.

Interestingly, when I set 'AUTH0_ENV_DOMAIN' to the custom domain, my login works properly. However this seems like it goes against the instructions, so I don't have confidence in that solution long-term.

Environment

  • Plugin version 4.0.0
  • Wordpress version 5.4.1
@joshcanhelp
Copy link
Contributor

@drobin03 - Appreciate the detailed report here, this helped figure out the root cause. You are correct, the call for the JWKS does not take into account custom domains. I'll put through a PR for that right now.

@joshcanhelp joshcanhelp added the bug label May 4, 2020
@joshcanhelp joshcanhelp added this to the 4.1.0 milestone May 4, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants