I’m trying to get around these topics and I found really great tutorials on your forums.
The one tutorial that is exactly how I want to implement my authentication scheme is :
Use React and Spring Boot to Build a Simple CRUD App
The only distinction is that I use spring webflux and angular. I get stuck because my RequestCache bean is overwritten by springsecuritywebflux. Thus I’m redirected to the default (/) on :8080 instead of :4200
You can try modifying your Angular app so it redirects to http://localhost:8080/login/oauth2/code/okta instead of just /login or /private. That way, Spring Security will redirect back to the referrer automatically (which will be http://localhost:4200 in your case).
When I use another link that is protected and that I log in, I am referred back to say : http://localhost:8080/private instead of http://localhost:4200/home. I do the redirection in an Authenticated Guard in Angular with location.href.
I’m a bit at lost here. I could use some host trick to make it work, but your solution seemed perfect for development