Hey guys, I have a rest application backend and two clients (frontend phonegap and web).
I'd like to know if is it possible to authenticate the user by facebook and gmail account according my arquitechture.
But I don't know if it works with rest services and neither how can I do that.
For example, in the link above, has a code as below:
//###### First step
//Create an instance of SocialAuthConfgi object
SocialAuthConfig config = SocialAuthConfig.getDefault();
//load configuration. By default load the configuration from oauth_consumer.properties.
//You can also pass input stream, properties object or properties file name.
config.load();
//Create an instance of SocialAuthManager and set config
SocialAuthManager manager = new SocialAuthManager();
manager.setSocialAuthConfig(config);
//URL of YOUR application which will be called after authentication
// get Provider URL to which you should redirect for authentication.
// id can have values "facebook", "twitter", "yahoo" etc. or the OpenID URL
String url = manager.getAuthenticationUrl(id, successUrl);
// Store in session
session.setAttribute("authManager", manager);
//#### Second step
// get the auth provider manager from session
SocialAuthManager manager = (SocialAuthManager)session.getAttribute("authManager");
// call connect method of manager which returns the provider object.
// Pass request parameter map while calling connect method.
Map<String, String> paramsMap = SocialAuthUtil.getRequestParametersMap(request);
AuthProvider provider = manager.connect(paramsMap);
// get profile
Profile p = provider.getUserProfile();
// you can obtain profile information
System.out.println(p.getFirstName());
// OR also obtain list of contacts
List<Contact> contactsList = provider.getContactList();
As you can see, in the first step I have the code: session.setAttribute("authManager", manager);
and in the second step: SocialAuthManager manager = (SocialAuthManager)session.getAttribute("authManager");
Question: There are another way to do the task above without http sessions?
Any example?
Thanks in advance.