Creates an OIDC Provider based on the provided configuration and parameters.
The provider will be cached and returned on subsequent calls.
Cookie and JWT keys will be stored in an internal storage so they can be re-used over multiple threads.
Necessary claims for Solid OIDC interactions will be added.
Routes will be updated based on the
configureErrors function below, we configure the
renderError function of the provider configuration.
This function is called by the OIDC provider library to render errors,
but only does this if the accept header is HTML.
Otherwise, it just returns the error object iself as a JSON object.
In this function we override the
to make the above code think HTML is always requested there.
This way we have full control over error representation as configured in
We still check the accept headers ourselves so there still is content negotiation on the output,
the client will not simply always receive HTML.
Should this part of the OIDC library code ever change, our function will break, at which point behaviour will simply revert to what it was before.
Adds the necessary claims the to id and access tokens based on the Solid OIDC spec.
Pipes library errors to the provided ErrorHandler and ResponseWriter.
Sets up all the IDP routes relative to the IDP path.
Creates a Provider by building a Configuration using all the stored parameters.
Creates the route string as required by the
In case base URL is
this would result in
Generates a cookie secret to be used for cookie signing. The key will be cached so subsequent calls return the same key.
Generates a JWKS using a single JWK. The JWKS will be cached so subsequent calls return the same key.
Gets a provider from the factory. Multiple calls to this function should return providers that produce the same results. This is mostly relevant for signing keys.
Creates a configuration by copying the internal configuration and adding the adapter, default audience and jwks/cookie keys.
Checks if the given token is an access token. The AccessToken interface is not exported so we have to access it like this.