I've been struggling a lot lately to find decent solution which has authentication mechanism for server and client API's.
I put alot of effort trying to find working(!) code samples , but couldn't find any. The code from DotNetOpenAuth doesn't work for me - im using vs 2010 .net 4 webform
Anyway , I can't seems to find a solution which covers an overall API for all parameters/providers and it seems that I have to build it from scratch.
For example — ( google) : Every solution I've found provides only the info that the basic url is :
https://accounts.google.com/o/oauth2/auth
Also , i don't know if this usage is going to work since I've heard that the service is deprecated :
But this will never work alone , since I have to append URL parameters :
https://accounts.google.com/o/oauth2/auth?
scope=email%20profile&
state=%2Fprofile&
redirect_uri=https%3A%2F%2Foauth2-login-demo.appspot.com%2Foauthcallback&
response_type=token&
client_id=812741506391.apps.googleusercontent.com
Why do I have to build/encode it by myself ?
Now , I don't have a problem with the parameters filling , I have a problem with the fact that I can't find full API for both client (js) and server side (.net).
It seems that I have to build the url + encoded values by myself
Question
Is there any solution which will take as param my plain values , and will provide final valid URL ?
(both for C# and js/jq and for many providers )
If you do this request in Ajax with jQuery, you can use the "data" parameter to pass those values and jQuery will ensure that everything is kosher.
If the request is a POST, it will add it to the body or append it to the URL if it's a GET request.
See here: http://api.jquery.com/jquery.ajax/