You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
thanks for your great opensource work: socialauth
here is my problem:
i’m trying socialauth project to login via hotmail account, everything ok
before return back from hotmail
i can see the parameters hotmail has passed to my url
but when invoke this code (below)
Profile p = provider.verifyResponse(request);
i get an exception , the stack is:
java.lang.NullPointerException
at org.brickred.socialauth.provider.HotmailImpl.verifyResponse(HotmailImpl.java:96)
at org.apache.jsp.test.openid_jsp._jspService(openid_jsp.java:61)
why this exception happy, can you give me some suggestions ?
my website http://www.oschina.net is now using jopenid , but it only support
gmail and yahoo, if socialauth passed my test, it’s perfect !
BTW: i try your demo http://opensource.brickred.com/socialauthdemo/
login ok,but nothing display in the success page.
Winter Lau
ld@oschina.net
Original issue reported on code.google.com by oschina....@gmail.com on 10 Nov 2010 at 8:44
The text was updated successfully, but these errors were encountered:
Hi
It seems you are not getting provider object from session in return action.
Please have a look the code given below:-
Suppose in first java action you are writing this code:-
AuthProvider provider = AuthProviderFactory.getInstance(“hotmail”);
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
}
I am attaching my struts action files also for your reference. In struts action I am using form bean to store provider object in session. But in above example I am setting provider in session directly. So if you are not using struts you can use above code.
OR you can go through the following link for complete understanding of struts
demo.
http://code.google.com/p/socialauth/wiki/StrutsSample
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 10 Nov 2010 at 12:52
Original issue reported on code.google.com by
oschina....@gmail.com
on 10 Nov 2010 at 8:44The text was updated successfully, but these errors were encountered: