Helper for deriving an openIdProviderUrl from an app origin: returns the URL of the OpenID
Connect discovery document served at /.well-known/openid-configuration on origin
(defaulting to the current page's origin), with any leading bim. subdomain stripped — for legacy
reasons the identity provider always lives on the bare host (e.g. https://foo.xyz) even when the
application is served from https://bim.foo.xyz. Any path on origin is discarded; see
canonicalizeOrigin.
Use this when the IdP is co-hosted with the app (or its backend) and you would rather discover it
from the page/backend origin than hardcode a provider host. The reverse proxy / gateway in front of
the application is expected to serve this document (e.g. by proxying it from the actual identity
provider). The endpoints inside the document may point at any origin — the discovery document is the
sole source of truth for where the IDP actually lives.
@throws
if origin is omitted outside a browser, where window.location.origin is
unavailable — pass an explicit origin in that case.
Helper for deriving an
openIdProviderUrlfrom an app origin: returns the URL of the OpenID Connect discovery document served at/.well-known/openid-configurationon origin (defaulting to the current page's origin), with any leadingbim.subdomain stripped — for legacy reasons the identity provider always lives on the bare host (e.g.https://foo.xyz) even when the application is served fromhttps://bim.foo.xyz. Any path on origin is discarded; see canonicalizeOrigin.Use this when the IdP is co-hosted with the app (or its backend) and you would rather discover it from the page/backend origin than hardcode a provider host. The reverse proxy / gateway in front of the application is expected to serve this document (e.g. by proxying it from the actual identity provider). The endpoints inside the document may point at any origin — the discovery document is the sole source of truth for where the IDP actually lives.
if origin is omitted outside a browser, where
window.location.originis unavailable — pass an explicit origin in that case.