oidc-client icon indicating copy to clipboard operation
oidc-client copied to clipboard

Bearer error on user info proxied request to ADFS

Open hagenderouen opened this issue 2 years ago • 7 comments

Issue and Steps to Reproduce

Receiving Bearer error invalid token on user info endpoint proxied request to Microsoft ADFS.

Versions

@axa-fr-react-oidc v6.0.0-alpha1 node 14.20.0

Screenshots

Screenshot 2022-07-19 104459

Additional Details

Using proxy due to organization's CORS policy. Authority configuration snippet:

const AUTH_CONFIG: AuthorityConfiguration = {
  authorization_endpoint: `${CONFIG.OIDC_URL}/oauth2/authorize/`,
  token_endpoint: `./proxy/proxy.ashx?${CONFIG.OIDC_URL}/oauth2/token/`,
  userinfo_endpoint: `./proxy/proxy.ashx?${CONFIG.OIDC_URL}/userinfo`, // not working?
  end_session_endpoint: `${CONFIG.OIDC_URL}/oauth2/Logout`,
  revocation_endpoint: 'notimplented'
}
  • Installed packages:
  • @axa-fr-react-oidc

hagenderouen avatar Jul 19 '22 18:07 hagenderouen

Hi @hagenderouen , do you have the possibility to test whithout your reverse proxy? It may come from your reverse proxy that does not follow the authorization header.

guillaume-chervet avatar Jul 20 '22 12:07 guillaume-chervet

@guillaume-chervet Unfortunately, I cannot due to our organization's CORS policy. It works with @axa-fr/react-oidc-context v3.1.7 if that is helpful.

hagenderouen avatar Jul 20 '22 13:07 hagenderouen

It is a good news. Do you have the request details from the v3? It may missed something in v4 and more.

guillaume-chervet avatar Jul 20 '22 13:07 guillaume-chervet

I have added missing credential header on userinfo fetch. Does it fix something? In v6.0.0-alpha9

guillaume-chervet avatar Jul 20 '22 14:07 guillaume-chervet

@guillaume-chervet Excellent. Please give me some time to test this in our project.

hagenderouen avatar Jul 20 '22 19:07 hagenderouen

You may try the v6.0.0-beta2 instead of alpha9, I have fixed the fix :]

does it work for you?

guillaume-chervet avatar Jul 22 '22 14:07 guillaume-chervet

@guillaume-chervet This was de-prioritized in our project. I will test in future iterations. Thank you for your prompt action.

hagenderouen avatar Jul 22 '22 22:07 hagenderouen

Update. Receiving error: OidcServiceWorker.js:393 Uncaught Error: Domain ./proxy/proxy.ashx?https://login.tfs.tamu.edu/adfs/userinfo is not trusted, please add domain in TrustedDomains.js.

Installed packages: @axa-fr/react-oidc v6.9.2

hagenderouen avatar Nov 02 '22 20:11 hagenderouen

Hi @hagenderouen , with the use of service worker, you need to configure all used domain in trusteddomain.js. It is a security need.

guillaume-chervet avatar Nov 02 '22 21:11 guillaume-chervet