I have followed this documentation to create a test app https://developer.okta.com/docs/guides/sign-into-spa-redirect/angular/main/
- I am able to see OKTA Sign in page
- After entering valid credentials it struck at http://localhost:4200/login/callback?code=xxxxxxxx&state=xxxxxxxxx
this.isAuthenticated$ = this._oktaStateService.authState$.pipe(
filter((s: AuthState) => !!s),
map((s: AuthState) => {
console.log(s);
return s.isAuthenticated ?? false}
)
);
is returning false always
I have added http://localhost:4200 as Trusted Origins
Did you add the callback route pointing to the
OktaCallbackComponent? See docs for handling the callback.You can also see an example Angular app using Okta redirect in this GitHub repo.