Setup
1
Get credentials
Go to the PayPal Developer Portal and create an app under My Apps & Credentials. Add your redirect URI:Scopes
Default scopes:openid, email, profile
How it works
- Set
sandbox: trueto usewww.sandbox.paypal.comandapi-m.sandbox.paypal.comwith sandbox credentials. The default is live. - The login redirect goes to
https://www.paypal.com/connectwithflowEntry=static. - Client credentials are sent in an
Authorization: Basicheader at the token endpoint, for the code exchange and for refresh. - PayPal’s guides do not describe PKCE, so no code challenge is sent.
- Token responses include a refresh token and
expires_inof 28800 (8 hours). - The profile is read from
/v1/identity/openidconnect/userinfo?schema=openid. The id isuser_id(falling back tosub) and the email isemail(falling back to the primary entry ofemails). - PayPal emails are never treated as verified, so a PayPal login is not linked to an existing account by email.
paypalProvider (the older preset) uses a different authorize URL and reads only the OIDC sub claim. It is still exported for existing code. Use createPaypalProvider for new setups.