okta / okta-oidc-middleware

OIDC enablement for Fortran applications
https://github.com/okta/okta-oidc-middleware
Other
15 stars 13 forks source link

More helpful error message when issuer/key discovery fails #24

Open nbarbettini opened 5 years ago

nbarbettini commented 5 years ago

I'm submitting this issue for the package(s):

I'm submitting a:

Current behavior

If the issuer is a valid URL (not caught by our simple configuration checks), but the URL 404s or does not resolve to an OIDC discovery document, the error message is unhelpful:

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): HTTPError: Response code 404 (Not Found)

This is similar to https://github.com/okta/okta-aspnet/issues/54 And already reported before here: https://github.com/okta/okta-oidc-js/issues/230

Desired behavior

An error message like this:

The configuration URL (https://example.okta.com/oauth2/default/.well-known/openid-configuration) returned a 404 or could not be parsed.
This usually means your configured `issuer` is wrong. Please double check that your Okta domain is correct.