Last active
August 2, 2019 09:19
-
-
Save xcommerce-gists/4007896 to your computer and use it in GitHub Desktop.
PayPalAccessOpenIDConnectOAuth.cURL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://api.paypal.com/v1/identity/openidconnect/tokenservice \ | |
-u "<your_app_id>:<your_app_secret>" \ | |
-d "client_id=&grant_type=authorization_code&code=<code>&redirect_uri=<urlencoded_return_url>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP/1.1 200 OK | |
Content-Type: application/json | |
Cache-Control: no-store | |
Pragma: no-cache | |
{ "access_token": "ElAV32hkKGlMT4H86HJK94f54HKDLZdf", "token_type": "Bearer", "refresh_token": | |
"ExLOxBtZp8JJHDHD9495HDHHDHFHFJHF", "expires_in": 900, "id_token": | |
"eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zZXJ2ZXIuZXhhbXBsZS5jb20iLCJ1c2VyX2lkIjoiMjQ4Mjg5NzYxMDAxIiwiYXVkIjoiczZCaGRSa3F0MyIsIm5vbmNlIjoibi0wUzZftKVpFuc1pGaVsyZsOtkT32E4c6MDHeCvIDlR5ESC0ct8BLvGJDB5954MjCR4_X2GAEHonKw4NF8wTmUFvhslYXmjRNFs21Byjn3jNb7lSa3MBfVsw" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize? | |
client_id=<your_app_id>&response_type=code&scope=<scope>&redirect_uri=<return_url_provided_at_app_creation>&state=<state>&nonce=<nonce> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl "https://api.paypal.com/v1/identity/openidconnect/userinfo?schema=openid&access_token=<your_access_token>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET https://api.paypal.com/v1/identity/openidconnect/userinfo?schema=openid HTTP/1.1 | |
Authorization: Bearer _your-value_ | |
HTTP/1.1 200 OK | |
Content-Type: application/json | |
{ "user_id": "https://www.paypal.com/webapps/auth/server/64ghr894040044", "name": "Jane Doe" | |
"given_name": "Jane", "family_name": "Doe", "email": "[email protected]", } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/endsession?id_token=<your_id_token>&state=<the_state_you passed_earlier>&redirect_uri=<your_return_url>&logout=true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://api.paypal.com/v1/identity/openidconnect/tokenservice \ | |
-u "<client_id>:<your_app_secret>" \ | |
-d "client_id=&grant_type=refresh_token&refresh_token=<your_refresh_token>&scope=<your_scopes>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP/1.1 200 OK | |
Content-Type: application/json | |
Cache-Control: no-store | |
Pragma: no-cache | |
{ "access_token": "E7AV32hkKGlMT37595LZet", "token_type": "Bearer", "expires_in": 28800} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -d "access_token=<your_id_token>" https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/checkid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment