Merge pull request #7141 from backstage/rugvip/not-done

auth-backend: throw error if OIDC IdP does not have a userinfo endpoint
This commit is contained in:
Patrik Oldsberg
2021-09-10 17:18:54 +02:00
committed by GitHub
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -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 },