Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

Nowadays a trend is running like to register a user via his social login id.
For my purpose I am using paypal user.
Concept is a user come and click on login and redirects to payapl site after authentication and other verification i get its unique id whatever and then I register to my database.
This gives an ease for enduser and application developer too.

After registering the application on paypal i got
app id:XXXXX
secret key:YYYYY

There are several steps that payal has given.
1. Let the user to login and authenticate by payal and developer get the "code".
2. Use this "code" to get the accesstoken.
3. Finally use this accesstoken to get user info his name and id

that we can use for our user registration.

I have completed the 1st step. i.e. got the "code"

string url = https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize?client_id=" + payPalClientID+"&response_type=code&scope=profile+email+https%3A%2F%2Furi.paypal.com%2Fservices%2Fpaypalattributes"+ "&redirect_uri=" + payPalReturnUrl;

Response.Redirect(url);


but I couldn't pass over the 2nd step and get the error
{"error_description":"client id or secret is null","error":"invalid_client"}

<pre lang="xml">var url = @"https://api.sandbox.paypal.com/v1/identity/openidconnect/tokenservice \-u XXXXXX \-d grant_type=authorization_code&code=" + code + "&redirect_uri=http://localhost:111111/RedirectPage.aspx";


WebClient webClient = new WebClient();
                Stream stream = webClient.OpenRead(url);
                string b;
                using (StreamReader br = new StreamReader(stream))
                {
                    b = br.ReadToEnd();
                }



Please guide me in the right way, I am not sure where I am lacking.

Click here for Payapl
Thanks
Posted
Updated 1-Dec-13 23:43pm
v2
Comments
OriginalGriff 2-Dec-13 6:08am    
I would suggest that Facebook or Google+ would be better login IDs to use: if any site started asking for my PayPal login before I could access it I wouldn't be back...
FB and G+ are not primarily considered as financial systems with hooks into the user's bank account: PayPal is.
Manish Kumar Namdev 2-Dec-13 7:35am    
Thanks, but I actually need to make it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900