Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not able to authenticate in facebook using socialauth #27

Closed
GoogleCodeExporter opened this issue Apr 25, 2015 · 3 comments
Closed

not able to authenticate in facebook using socialauth #27

GoogleCodeExporter opened this issue Apr 25, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

https://apps.facebook.com/oauth/authenticate?client_id=109414925795385&display=p
age&redirect_uri=https://imag.apere.com/socialAuthSuccessAction.do&scope=publish
_stream,email,user_birthday,user_location

This is the url I am able to generate for facebook application.


apps.facebook.com.consumer_key =109414925795385
apps.facebook.com.consumer_secret =4e924dfd58ea84122ca0af1b1a171822

whats wrong with this

any suggestion is highly appreciated..


Original issue reported on code.google.com by pat.srid...@gmail.com on 25 Nov 2010 at 1:05

@GoogleCodeExporter
Copy link
Author

Hi

Please confirm you are saving provider object in session in first action and 
use the same object from session in success action.

Suppose in first java action you are writing this code:-

AuthProvider provider = AuthProviderFactory.getInstance(“facebook”);
String returnToUrl = 
"http://opensource.brickred.com/socialauthdemo/socialAuthSuccessAction.do"; 
(Change it with your return URL)
            HttpSession session = request.getSession();
            Session.setAttribute(“provider”,provider);
            String url = provider.getLoginRedirectURL(returnToUrl);
            //..your code to forward it to url.

In success action get the provider from session:-


HttpSession session = request.getSession();
AuthProvider provider = null;
            If(Session.getAttribute(“provider”)!=null){
                  provider = (AuthProvider)session.getAttribute(“provider”);
}
if (provider != null) {
Profile profile = provider.verifyResponse(request);
//….rest of code
            }

OR you can go through the following link for complete understanding of struts 
demo.
http://code.google.com/p/socialauth/wiki/StrutsSample

In Struts sample we are saving provider object in a form bean which has session 
scope and in success action we are using the same provider from that form bean.


I hope it will help you to resolve your problem. If you are still facing same 
issue , please send me your complete code of these actions.

Regards
Tarun

Original comment by tar...@brickred.com on 26 Nov 2010 at 10:15

@GoogleCodeExporter
Copy link
Author

Issue 28 has been merged into this issue.

Original comment by abhinavm...@gtempaccount.com on 27 Nov 2010 at 9:47

@GoogleCodeExporter
Copy link
Author

Original comment by tsg.bric...@gmail.com on 6 Dec 2010 at 3:14

  • Changed state: Done
  • Added labels: Type-Task
  • Removed labels: Type-Defect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant