Get userinfo given_name

tommi123
New Community Member

Hi guys,

 

We've been using login with PayPal functionality for our app in live environment for some time and we used profile information to fill the registration for users. We match first name and last name based on PayPal's given_name and family_name as described here https://developer.paypal.com/docs/api/identity/#openidconnect_userinfo

 

We discovered that we no longer receive given_name and family_name in response to GET userprofile request.

I checked scopes and my app settings and it doesn't seem to be changed. I'm adding all scopes described here: https://developer.paypal.com/docs/integration/direct/identity/attributes/

I'm able to receive other data, such as email, name, address of phone_number

 

Steps we use:

  1. Redirect user to https://www.sandbox.paypal.com/signin/authorize?client_id={my_sandbox_client_id}K&response_type=code...
  2. Make a POST request to /v1/identity/openidconnect/tokenservice 
    curl -X POST https://api.sandbox.paypal.com/v1/identity/openidconnect/tokenservice \              
      -H 'Authorization: Basic {base64 client_id:secret' \                                                                                                               
     -d 'grant_type=authorization_code&code={code_received_in_previous_step}'
  3. Make a GET request to /v1/identity/openidconnect/userinfo
    curl -v -X GET "https://api.sandbox.paypal.com/v1/identity/openidconnect/userinfo?schema=openid" \
    -H "Content-Type:application/json" \
    -H "Authorization: Bearer {code_received_in_previous_step}"

After that I receive JSON with address, language, verified, phone_number, locale, zoneinfo, email_verified, name, email, user_id fields, but there's no given_name and family_name fields.

 

Were there any changes in this API that I'm not aware of? I tried looking for it, but it's not described in any doc or on any forum I searched.

I'd appreciate any help.

 

Thanks,

Maciej

Login to Me Too
14 REPLIES 14

alexia13
Contributor
Contributor

Same here. It is still not working.

Login to Me Too

tarest
Contributor
Contributor

It works in django-allauth - I obtain:

 

{"user_id": "https://www.paypal.com/webapps/auth/identity/user/...", "name": "Firstname Lastname"}

 

so not only user_id but also name (and other information if I have right to obtain them).

Maybe try some other URLs?

Login to Me Too

alexia13
Contributor
Contributor

Yes, but then the API only retrieves the full name. So getting only the given_name (or first name) is still not possible.

Login to Me Too

narennaik
Contributor
Contributor

I have the same problem... can someone please provide a solution here

Login to Me Too

tsango
Contributor
Contributor

I am getting this issue also. No full name or email but I get address info

 

When calling 

 
All the options scope options are ticked in the app.
Login to Me Too

Haven't Found your Answer?

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