1391
return { metadata, discoveryUrl: pathToFetch, errors };
1392
}
1394
>
// Try fetching the OpenID Connect Discovery with path insertion.
1395
>
// For issuer URLs with path components, this inserts the well-known path
1396
>
// after the origin and before the path.
1397
>
const openidPathInsertionUrl = new URL(OPENID_CONNECT_DISCOVERY_PATH, authorizationServer).toString() + extraPath;
1398
>
metadata = await doFetch(openidPathInsertionUrl);
1399
>
if (metadata) {
1400
return { metadata, discoveryUrl: openidPathInsertionUrl, errors };
1401
}