I'm getting started using angular-oauth2-oidc with Angular 9, and using the Angular Live Development Server and authenticating with IBM Cloud Identity. I need to proxy requests to that backend and am able to configure the discovery endpoint for proxying: this is the dev server proxy config:
{
context: ['/v1.0/endpoint/default'],
target: 'https://prepiam.ice.ibmcloud.com',
secure: false,
changeOrigin: true,
logLevel: 'debug'
},
and this is the 'issuer' endpoint that the package uses:
export const authConfig: AuthConfig = {
issuer: '/v1.0/endpoint/default',
.......
This works great - the request is proxied and I get back the discovery document. But at this point the package uses the endpoints it got back in the document, such as
"jwks_uri": "https://prepiam.ice.ibmcloud.com/v1.0/endpoint/default/jwks",
It uses the full URL and I can't figure out how to configure a proxy rule for that. I guess I see two possibilities:
- somehow proxy complete URLs in the dev server and later in nginx when this work is actually deployed
- somehow modify the urls that the package is using, as I did with the 'issuer' endpoint above.
Any thoughts? Thanks for reading this!