I'm trying to implement angular-oauth2-oidc Authentication in my angular app. On server side everything is configured correctly (also CORS).
My configuration looks like this:
this.oauthService.configure(authCodeFlowConfig);
this.oauthService.setStorage(localStorage);
this.oauthService.setupAutomaticSilentRefresh();
this.oauthService.tokenValidationHandler = new NullValidationHandler();
this.oauthService.loadDiscoveryDocumentAndTryLogin().then(() => {
console.log('Discovery document fetched successfully');
});
My URL looks like this:
https://some-identity-provider.com/OAuth/Authorize?client_id=xxxxxx&p=my_policy&redirect_uri=' + window.location.origin + '&scope=openid%20profile&response_type=id_token
This URL definitely works. When I open it directly in the browser, it correctly redirects me to the login page.
However, in my application, it tries to redirect me to the login page, but I'm getting a CORS error:
When I look at the parameters, it seems to append /.well-known/openid-configuration
to the last parameter.
Somehow it seems to mix up the URL and its query parameters...
Can anybody please help?