c0debrain / socialauth

Automatically exported from code.google.com/p/socialauth
0 stars 0 forks source link

Consider add state parameter when calling provider Oauth URL #339

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is not a bug but a feature request.
When making the call to the provider it is possible to send a 'state' parameter 
with application internal data that might be useful to the application upon 
receipt of the respons.
This is part of the Oauth: http://tools.ietf.org/html/rfc6749#section-4.1.1

My suggestion is to extend the getAuthenticationUrl method of SocialAuthManager 
to accept the state value as parameter.

Thanks
Yoav

Original issue reported on code.google.com by yoav...@gmail.com on 17 Apr 2014 at 11:19

GoogleCodeExporter commented 9 years ago
You can set the auth endpoints in properties file.

Please have a look into the following URL
https://github.com/3pillarlabs/socialauth/wiki/Sample-Properties

Here you can see, we can set the following end points
www.google.com.request_token_url
www.google.com.authentication_url
www.google.com.access_token_url

Same is valid for other providers too. For Oauth2 providers we need to set only 
two properties
graph.facebook.com.authentication_url= 
https://graph.facebook.com/oauth/authorize
graph.facebook.com.access_token_url=https://graph.facebook.com/oauth/access_toke
n

Regards
Tarun

Original comment by tarun.na...@3pillarglobal.com on 25 Apr 2014 at 9:50

GoogleCodeExporter commented 9 years ago
but what if i need to set the extra parameters in runtime?

Original comment by yoav...@gmail.com on 25 Apr 2014 at 11:30

GoogleCodeExporter commented 9 years ago
If you are creating the manager object at the same time then you can use the 
"addProviderConfig" method of SocialAuthConfig class.
You can manuly create OAuthConfig object and set it in SocialAuthConfig and 
pass SocialAuthConfig to the manager.

Original comment by tarun.na...@3pillarglobal.com on 28 Apr 2014 at 12:21

GoogleCodeExporter commented 9 years ago
And in SocialAuthConfig we also has one more method "load(final Properties 
properties)". You can manually create properties object with the key/values 
what you are setting in oauth_consumer.properties file.

Original comment by tarun.na...@3pillarglobal.com on 28 Apr 2014 at 12:23

GoogleCodeExporter commented 9 years ago
I'll try the load config approach
Thanks for the reply

Original comment by yoav...@gmail.com on 28 Apr 2014 at 12:27

GoogleCodeExporter commented 9 years ago
Closing this one. Hope it is working now.

Original comment by tarun.na...@3pillarglobal.com on 15 May 2014 at 4:21