fix: add comment for clarification and require full scheme

Signed-off-by: Alex Krantz <alex@krantz.dev>
This commit is contained in:
Alex Krantz
2021-10-12 10:28:42 -07:00
parent 9322e632e9
commit e2039ef99a
@@ -275,8 +275,11 @@ export const createOktaProvider = (
const audience = envConfig.getString('audience');
const callbackUrl = `${globalConfig.baseUrl}/${providerId}/handler/frame`;
if (!audience.startsWith('https')) {
throw new Error("URL for 'audience' must start with 'https'.");
// This is a safe assumption as `passport-okta-oauth` uses the audience
// as the base for building the authorization, token, and user info URLs.
// https://github.com/fischerdan/passport-okta-oauth/blob/ea9ac42d/lib/passport-okta-oauth/oauth2.js#L12-L14
if (!audience.startsWith('https://')) {
throw new Error("URL for 'audience' must start with 'https://'.");
}
const catalogIdentityClient = new CatalogIdentityClient({