-
Notifications
You must be signed in to change notification settings - Fork 91
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
[INJIMOB-2985] make authorization_servers optional and add fallback logic #1813
base: develop
Are you sure you want to change the base?
Conversation
3ba52c1
to
e1b6137
Compare
e1b6137
to
6f337f1
Compare
machines/Issuers/IssuersService.ts
Outdated
await CACHED_API.fetchIssuerAuthorizationServerMetadata(server); | ||
|
||
if ( | ||
(authorizationServersMetadata?.['grant_types_supported'] || ["authorization_code", "implicit"]).some(grant => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract ["authorization_code", "implicit"]
as constant outside for loop.
It looks complex to understand if condition. If we name it defaultGrantTypeSupported, it will be more readable.
machines/Issuers/IssuersService.ts
Outdated
return authorizationServerMetadata['authorization_endpoint']; | ||
|
||
throw new Error( | ||
OIDCErrors.AUTHORIZATION_ENDPOINT_DISCOVERY.GRANT_TYPE_NOT_SUPPORTED, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel, instead of giving GRANT_TYPE_NOT_SUPPORTED
we should have generic error like failed to fetch data.
Definite error should be used if we will get that error only.
…ogic Signed-off-by: Abhishek Paul <[email protected]>
…tadata Signed-off-by: Abhishek Paul <[email protected]>
Description
Issue ticket number and link