auth-backend: throw error if OIDC IdP does not have a userinfo endpoint
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-auth-backend': patch
|
||||
---
|
||||
|
||||
Use a more informative error message if the configured OIDC identity provider does not provide a `userinfo_endpoint` in its metadata.
|
||||
@@ -157,6 +157,11 @@ export class OidcAuthProvider implements OAuthHandlers {
|
||||
userinfo: UserinfoResponse,
|
||||
done: PassportDoneCallback<AuthResult, PrivateInfo>,
|
||||
) => {
|
||||
if (typeof done !== 'function') {
|
||||
throw new Error(
|
||||
'OIDC IdP must provide a userinfo_endpoint in the metadata response',
|
||||
);
|
||||
}
|
||||
done(
|
||||
undefined,
|
||||
{ tokenset, userinfo },
|
||||
|
||||
Reference in New Issue
Block a user