I'm trying to integrate oAuth2 oidc login in the Angular App. Here I'm facing an issue when I call authorize endpoint to get the authorization code, the page is redirecting to the new location where code gets refreshed and appears on URL. Now I'm unable to read that code from URL and continue with next steps to get token and do successful login.
step1: Calls below sample end point
location.href = https://ww.abc.com/authorize?client_id=abc123&response_type=code&scope=openid profile
step2: redirects to new location which has authorization _code
https://ww.xyz.com/myApp?code=abc123qwe
step3: Unable to execute next piece of code that fetchs code from url.
window.location.search.startsWith('?code=')
Would be very thankful if someone could help me with this.