title: sharing the principal object received from an oauth2 provider between spring and angular
body: <p>I have stumbled upon a problem with Spring Security and Angular. </p>
  
  <p>On my BE (Spring Boot application), there are defined OAuth2 providers, such as Google, GitHub and Facebook.</p>
  
  <p>My BE works fine with this providers, since I can authenticate on the desired providers. </p>
  
  <p>The problem is when I try to send the principal object to the FE (Angular 6 application). </p>
  
  <p>I get undefined value when i try to subscribe the value from the rest endpoint. 
  I assume this is due to the Spring Servlet creating a new thread for the login request. 
  I am doing my login request from the Angular app.</p>
  
  <p>I did watch dozens of tutorials and rad so many articles, but I just can't find the answer. If it's possible for you to share some code on how it is done, or give me a link, since for sure I am making a silly mistake and can't seem to find the answer here.</p>
  
  <p>Thanks for understanding, have a good day. 
  :)</p>