I need to integrate social login to my webapplication. I use Spring Boot for my backend and Angular 2 as frontend technology. I followed this tutorial for setting up my project.
This works perfectly and Spring Boot is running on http:/localhost:8080 and Angular 2 on http:/localhost:4200. The reason for this, is that I use the Angular-cli for the live reload development server functionalities.
Because of Cross Origin policies the angular project needs to use a proxy. As mentioned in the previous tutorial you need to configure a proxy.conf.json file:
{
"/api": {
"target": "http://localhost:8080",
"secure": false
}
}
If you do this you can acces the Spring API as followed: http:/localhost:4200/api/users for example (every '/api' request will be forwarded to the Spring server).
All the above things are working perfectly. Now I need to use Oauth2 with google login. I tried many tutorials like this one but i can't seem to manage to work this out.
If i try to implement this and navigate to http:/localhost:8080 (from Spring Boot address) i get redirected to the google login page, however when try the same thing, for example http:/localhost:4200/api/authenticate i just always redirect to http:/localhost:4200/login immediatly without redirecting me to the login page.
I looked evrywhere online but can't seem to find this particular problem. Can anybody help me to understand or what i'm doing wrong, maybe someone has example code that would be great!