1

I have configured my spring boot as below:

spring:
  security:
    oauth2:
      client:
        registration:
          myClient:
            client-name: name
            client-id: yyyyyy
            client-secret: xxxxx
            scope:
              - openid
              - profile
        provider:
          myClient:
            issuer-uri: some-issuer-uri

This OAuth2 code flow - works fine (if I'd like to use only Spring not both Spring & Angular). When I request for any resource (for ex. localhost:8080/api/user), Spring moves me to the login page of my issuer, after that, I will be redirected to Spring. Spring creates a new session and that how he recognize me during future requests.

How to deal with that in Angular? How the flow should looks after the user click login button on the frontend?

Some facts:

  1. Angular works on different port 4200. On production also it would be a separate microservice because it would work under nginx.
  2. I would like to have this OAuth2 code flow. I don't want to replace it for ex. by the implicit flow.

(I would have 2 microservices, I don't want to move Angular build folder into static folder of tomcat)

Thomas Banderas
  • 1,681
  • 1
  • 21
  • 43

0 Answers0