Hi,
I have an angular 8 application and i have implemented Okta into my application using the example here. I am able to be redirected to Okta Login but when the redirect happens, the URL is :“http://localhost:4200/authorization-code/assets/scss/bootstrap.min.css” As you can see an excess “authorization-code” is added at the end. That fails as the redirect URL should just be http://localhost:4200. All resources are trying to be fetched from localhost:4200/authorization-code/main.js and all other files which fail.
My base-href :
Redirect URI : document.getElementsByTagName(‘base’)[0].href + ‘authorization-code/callback’,
Can you try hard-coding your redirect URI to http://localhost:4200? If that works, you should be able to use window.location.origin + '/authorization-code/callback'.
@mraible I tried hardcoding ‘http://localhost:4200/authorization-code/callback’ but got the same issue. I even tried setting the redirect URI manually by adding this “this.oktaAuth.setFromUri(‘http://localhost:4200/’);” in my app component but event this is ignored. I tried interceptor but those wont work as main.js cant be loaded.
Everyone, i was able to resolve this issue. It turned out to be Location Strategy in my route file. Apparently Okta call back route is not hashed and that makes sense. So if you removed Location Strategy in providers from the app.routing.ts, app loaded fine. Thanks guys.
@mraible, can you please help me out with similiar situation, my localhost is working as expected but when i delpoy code on PROD receiving error message.
Note: Code deployed on Apache HTTPD server
Login works as expected
redirect to OKTA login page
After signin from OKTA received below error message
Not Found
The requested URL /archivedb/implicit/callback was not found on this server.Error: Cannot match any routes. URL Segment: ‘implicit/callback’