requests / requests-oauthlib

OAuthlib support for Python-Requests!
https://requests-oauthlib.readthedocs.org/
ISC License
1.72k stars 424 forks source link

Add Spotify OAuth 2 Tutorial #471

Closed odysseusmax closed 2 years ago

jtroussard commented 2 years ago

Was able to confirm that this tutorial results in a successful implementation of library:

(venv) C:\Users\user\Projects\OSS\Requests\tests\PR\471\requests-oauthlib>py pr471test.py
Please go here and authorize:  https://accounts.spotify.com/authorize?response_type=code&client_id=0c92d4fb86bc4308949fb5792b9b6c94&redirect_uri=https%3A%2F%2Fdeveloperslifefor.me&scope=user-read-email+playlist-read-collaborative&state=jVYV74oPihAKbRmvpClBkWsEBNeU7e

Paste the full redirect URL here: https://developerslifefor.me/?code=AQD9km20NryEv_cbH0rDqS94fkUNM1qM9t5zqp07GlwgG9qFVRIysf1Tw5ay1oK4133_RYxbUIapxjz5fNqgR8_bJbhw-U-A6gOrd7WFg2FGbhjLQnlvNn-W1ast5oG_UIvYgoFXM1cESTkczFs_R5Wld1IHJkNO2wZFm0r87g3Jf1_5NsT-BLvjesW2UOu86Eme68oZZtN67PoKVFfx_kznASxRRcKd1Ny1D9uF&state=jVYV74oPihAKbRmvpClBkWsEBNeU7e
{
  "access_token": "<a token was generated>",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "<was refreshed>",
  "scope": [
    "playlist-read-collaborative",
    "user-read-email"
  ],
  "expires_at": 1640893008.4426012
}

{
  "display_name": "sparrow",
  "email": "test-email@test-email.com",
  "external_urls": {
    "spotify": "https://open.spotify.com/user/3146thgffp5ujf7sbgqeia32chue"
  },
  "followers": {
    "href": null,
    "total": 0
  },
  "href": "https://api.spotify.com/v1/users/3146thgffp5ujf7sbgqeia32chue",
  "id": "3146thgffp5ujf7sbgqeia32chue",
  "images": [],
  "type": "user",
  "uri": "spotify:user:3146thgffp5ujf7sbgqeia32chue"
}
coveralls commented 2 years ago

Coverage Status

Coverage remained the same at 90.239% when pulling 88d58ddf2c2ffcda2dcb78bba5687edbb8eaa803 on odysseusmax:patch-1 into 2944df6de5872aa12974dda541f156efeaff37e1 on requests:master.