Implement OAuth 2.0 in Python using your Client Credentials

preview_player
Показать описание
Timestamps
0:00 Intro
0:15 OAuth 2.0 Workflow
0:57 Explaining the code
1:44 Authorization request
4:06 Making the main request

You will need:
- client ID
- client secret
- token url
- any scopes

The link to the example Python script is here:
Рекомендации по теме
Комментарии
Автор

Awesome video thanks a lot! Loved the diagram you draw, it helped me understand the workflow

teachyourselfcs
Автор

It helped me to understand how to do it. Your explanation is just awesome. Thanks buddy!

samcs
Автор

Hey thanks for the demo David. This helped me understand the workflow. I'd love to buy you a coffee and chat for a bit on how to use Oauth in my project

Nodeagent
Автор

Hi David,

the is nice video.

i am try to generate new access token basis on your code but getting below error. Can you please help me what is exactly its saying to do.

below is the error which i am getting.

{
"error": "invalid_scope",
"error_description": "Invalid scope: oapi",
"scope": "data-reports:write data-reports:read reports:read reports:write"
}
Traceback (most recent call last):

access_token =

KeyError: 'access_token'




basically below is the code where i am stuck

response = request("POST", url, auth=(CLIENT_ID, CLIENT_SECRET), data=data)
print(json.dumps(response.json(), indent=4))
access_token =
print(access_token.text)

ManojKumar-kgsh
Автор

Thank you for this video David!
This definitely makes doing OAuth Client Credentials in Python clearer to me.
Would you mind sharing the code?
(I can't see what's happening above line 58 regarding includes etc.)

silkogelman
Автор

Thank you for the video. One qiuestion, Can the OAuth server be the same as the Resource server? I don't see why not

danigonzalezj
Автор

Hey David, thanks for sharing. Is there way to cache the token and reuse until it expires?

mailtotheskn
Автор

Thanks for the vid!

Why do you say "bottle of water" in a british accent at 4:27 haha?!

viral