What's the difference between v1/identity/oauth2/userinfo and v1/identity/openidconnect/userinfo ?

markwatson
Contributor
Contributor

I'm looking into an issue where we're not always getting the name when we sign in with PayPal connect. We're currently using the Ruby GEM, which calls out to v1/identity/openidconnect/userinfo once the user is authenticated. We usually get a response like:

 

 

 

{
    "customer_id": 12345,
    "remote_ip": "123.456.25.13",
    "type": "userinfo",
    "timestamp": 1572999790,
    "raw_data": {
        "user_id": "https://www.paypal.com/webapps/auth/identity/user/SOME_CODE",
        "name": "First Last",
        "email": "an_email_address",
        "email_verified": true,
        "verified": true,
        "payer_id": "FAKE1D"
    }
}

 

 

 

But sometimes we get a response like this:

 

 

 

{
    "customer_id": 12345,
    "remote_ip": "123.456.25.13",
    "type": "userinfo",
    "timestamp": 1572999790,
    "raw_data": {
        "user_id": "https://www.paypal.com/webapps/auth/identity/user/SOME_CODE",
        "payer_id": "FAKE1D"
    }
}

 

 

 

Since we need the user's name, we started looking into other options. We found this URL: v1/identity/oauth2/userinfo, which is supposed to return name, given_name, and family_name:https://developer.paypal.com/docs/api/identity/v1/#userinfo

 

However, it looks like the Ruby GEM doesn't use that endpoint. My question is: What is the difference between these two paths, and is there one we should be using? Also, is there something we're doing wrong, or is it just expected that the name won't always come back in the user info request?

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.