Open onerandomgig opened 8 years ago
Thanks Prashanth,
Looks good to me. Could you please send a pull request ?
Warm regards Abhinav
On Sat, Nov 28, 2015 at 9:14 AM, onerandomgig notifications@github.com wrote:
Hi,
My server implementation is completely stateless (I am using Dropwizard). I am unable to login to Twitter because of this.
For Facebook, I am able to do this by recreating the accessGrant and then connecting the AuthProvider.
accessGrant = lAuthManager.createAccessGrant(providerId, authorizationCode, lRedirectUrl); AuthProvider provider = lAuthManager.connect(accessGrant);
Where, providerId = facebook authorizationCode = access token from facebook lRedirectUrl = the url to redirect to after successful authentication
However, for twitter, this doesnt work. I have to recreate the accessGrant using the params map
accessGrant = lAuthManager.createAccessGrant(providerId, lParams, lRedirectUrl);
Where, providerId = twitter lParams = Parameter map consisting of requestToken (oauth_token) and oauth_verifier lRedirectUrl = callback URL
It looks like OAuth1 implementation is stateful and requires SocialAuthManager to be persisted to the session.
I created a Stateless implementation of OAuth1 here - https://github.com/onerandomgig/socialauth/blob/master/socialauth/src/main/java/org/brickred/socialauth/oauthstrategy/StatelessOAuth1.java
and updated the TwitterImpl to use this instead,
I have tested it and it works as expected. Could you please let me know if this works and can be integrated into the main branch.
I have also updated the FacebookImpl to use the latest FB API version - 2.5
Thanks Prashanth
— Reply to this email directly or view it on GitHub https://github.com/3pillarlabs/socialauth/issues/68.
Hi,
My server implementation is completely stateless (I am using Dropwizard). I am unable to login to Twitter because of this.
For Facebook, I am able to do this by recreating the accessGrant and then connecting the AuthProvider.
accessGrant = lAuthManager.createAccessGrant(providerId, authorizationCode, lRedirectUrl); AuthProvider provider = lAuthManager.connect(accessGrant);
Where, providerId = facebook authorizationCode = access token from facebook lRedirectUrl = the url to redirect to after successful authentication
However, for twitter, this doesnt work. I have to recreate the accessGrant using the params map
accessGrant = lAuthManager.createAccessGrant(providerId, lParams, lRedirectUrl);
Where, providerId = twitter lParams = Parameter map consisting of requestToken (oauth_token) and oauth_verifier lRedirectUrl = callback URL
It looks like OAuth1 implementation is stateful and requires SocialAuthManager to be persisted to the session.
I created a Stateless implementation of OAuth1 here - https://github.com/onerandomgig/socialauth/blob/master/socialauth/src/main/java/org/brickred/socialauth/oauthstrategy/StatelessOAuth1.java
and updated the TwitterImpl to use this instead, https://github.com/onerandomgig/socialauth/blob/master/socialauth/src/main/java/org/brickred/socialauth/provider/TwitterImpl.java
I have tested it and it works as expected. Could you please let me know if this works and can be integrated into the main branch.
I have also updated the FacebookImpl to use the latest FB API version - 2.5 https://github.com/onerandomgig/socialauth/blob/master/socialauth/src/main/java/org/brickred/socialauth/provider/FacebookImpl.java
Thanks Prashanth