Spring Boot + Angular 4 + Social and Local Login

让人想犯罪 __ 提交于 2019-12-08 11:28:19

问题


I have been searching for the best way to build an application using Angular 4 (client application running over apache2), Spring Boot (Rest Controller) and Social and Local login.

I am kinda new to all of this, and I've be looking around for about one month and still have not a good idea how to implement that! Couldnt find a good tutorial for the tecnologies mentioned above...

I need to be able to let the user login via system's own login and social login like facebook and google. Could someone please point at the right direction?

I am not sure if that I am on the right track... I thought that would be easy, but I feel very confuse and dont see how to integrate the response from spring with my angular application. And the login with social networks will not be direct with the angular application. The user will authenticate with facebook, for example, and when facebook redirect to spring, Ill retrieve the user associated to that social networks account and return that to my angular application. In the angular 4 application, Ill should be possible to invite friends and use some other social networks related features.

Here are some of the tutorials i've read: http://www.baeldung.com/angular-4-upgrade-for-spring-security-oauth/ https://spring.io/guides/tutorials/spring-boot-oauth2/#_social_login_click

Can someone help me, pointing to the right direction, or placing a good tutorial or anything that would help?


回答1:


I ended up by just using an angular module called ng-social-login. At the backend, I called 'https://graph.facebook.com/me' passing the token that came from frontend.

Thats all. Using spring social wasnt really a good idea at all




回答2:


I am not sure if you can use spring social with Angular4 as front end. you might want to explore direct call from backend server to facebook graph API with tokens. Easy way is to use Angular4 and Javascript SDK provided by facebook, G+, twitter.



来源:https://stackoverflow.com/questions/47188485/spring-boot-angular-4-social-and-local-login

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!