Spring Boot + Angular 4 + Social and Local Login - facebook

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?

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

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.

Related

Make own authorization page to access Google Apps

I hope you can direct me with my query.
I wish to create my own authentication method for users in my Google Apps for Work account. Currently I am using built in Google Authentication, however I wish to build my own authentication method in PHP, Phyton or .NET; language doesn't matter really. So I want users to go to the page I will create, then they will need to pass authentication and be logged to Google Apps.
I know SSO is the way to do it but after my research I found very little about how to achieve it with Google Apps. I mean there is tones of third party platforms like OneLogin etc but I would like to have something I build myself. Ideally I would like to have some examples of SSO which works with GAFW so I could figure out the rest myself. I read somewhere that building own SSO portal it's not a piece of cake and also found an article that you can create something based on oAuth2.0 instead. So tried research about oAuth2.0 but all documentation I found is about authenticating to the application that I build using Google Apps Credentials, where I want the opposite; to be able to access Google Apps using the app that I build.
Hope someone could direct me to some examples or documentation or explain the process of learning curve to get my head around this project of building SSO for GAFW.
If you want to write your own Auth system and become the Identity Provider (IdP), you need to use SAML as that is the only supported method for now.
Here are the step by step instructions

Web API FB OAuth? How would to go about implementing it in a SPA application?

Documentation on the net seems to be VERY scarce. The only option I can think of at the moment
is to have my SPA app break convention and to have the (initial) logged out page be different to the logged in one (eg my app).
My app is built using Durandal 2.0.0.
In one of my OAuth tests app's I've managed to implement this link successfully. But as Durandal does not work in the same way (Server-side controller, & razor views), I'm thoroughly confused in how to achieve what I want to.
I'd like to have my app remain a single page app. But I've got little to no experience with the OAuth SDK
My only requirement is that the user log into my app using his FB account.
I've had an initial stab at this using the FB java script API, and got it working, but after discussions with another developer this side, it doesn't seem like the purpose of the java script API is to facilitate secure application login's? As the way we had it, would allow any user to pass a valid fb userId, then he would be logged into our app. :/
How would I go about achieving this process flow in a Durandal/Web API Single Page App?
User logs in using fb ->
then on the server we get his fb userId ->
retrieve our internal appID
I'm not asking for a complete answer/for someone to do my work....
But any documentation to get me started/less confused would be greatly appreciated.
Here is a sample project which demonstrates how to use OAuth with Durandal and Web API:
DurandalAuth.
However there are some modifications in viewmodels needed, since router changed in Durandal 2.0.0.

How to integrate app with facebook?

I made a quiz app using wordpress using a quiz plugin so that, the work could be done easily. I do not have any knowledge about how to integrate that app that I've made with facebook. Right now I've just kept the app on my localhost.
Do I need to add some API's or something like that? I have not handled AJAX and all that before but I do have knowledge about php.
I think you should clarify a bit about how do you want your app integrate with Facebook:
1) You want your quiz application as an on-Facebook canvas page application (which seems to be the case here):
Register an application on Facebook. The guide here is fairly easy to follow.
Read the basics about canvas Facebook
Learn about OAuth 2.0 authentication with Facebook. This step is optional since there is a good PHP library for Facebook. But I think it will saves you time afterwards.
Use PHP SDK for Facebook.
2) You want to use your own website, just add "login with Facebook" function (to record high scores, for example):
You should check Facebook integration for website. It's not too different from the first case.
I just give you the starting place. If there's something that is not clear enough, feel free to drop a more detailed comment.

Facebook Login + Registration

I have looked through dev docs and and tutorials via google engine, but I am kinda lost plus I am no expert in logic or programming..
I am trying to combine with login and register on the page. If user have fb account, they can log in. and then have database store their information for shopping purpose. if not, they could register and again have database store their info.
How to combine them using PHP SDK? Also I notice that I couldn't use Javascript SDK for login and register (do I need to create two apps for login and register?)
Insight will be appreciated. thank you very much
If you are talking about the "Registration Plugin" then I've written a tutorial about this:
How To: Use Facebook Registration Plugin As Your Registration System

Creating Facebook App

Im new to facebook applications. I recently created a webapp that consisted of html & php. But recently Ive decided that integrating my webapp within facebook would be useful. Any tips on where to start? Ive looked over developers.facebook.com and im confused. It appears they are in the process of updating. Ive come across a few guides but there from a few years ago. This app will run completely within facebook and im probably gonna have to rewrite all the code. Any guides or suggestions?
Thanks!
You didn't specify the programming language you're using but if you're developing asp, start by looking into Facebook c# sdk here: http://facebooksdk.codeplex.com/
If you're using any other language (i.e. php), try looking into respective software dev. kits (i.e. facebook php sdk). They will facilitate your job in comparison to starting raw development all by yourself.
Tim, if you want to get into the business of working with Facebook, you need to know right away that they are always in the process of updating. That being said, you should learn some Facebook terminology so you can do more research and figure out what you want to do.
Applications that run within the Facebook interface are called Canvas Apps. Your application is hosted on your own server, and Facebook simply adds an iframe in their UI that points to your app's URL.
Another way to go to create a webapp that uses your own design, but still utilizes a single sign-on system from Facebook. This used to be called a Connect App but now they don't really have a name for it. Basically, you can use Facebook's authorization system to pull Facebook user data into your own database, which basically eliminates the need for a registration page. The authorization system prompts the user to allow your app to get specific data about them - once they authorize it, your app has access to do whatever the user gave it permission to do.
The best document to wrap your brain around is about authentication: http://developers.facebook.com/docs/authentication/
Give that a whirl, and good luck!