Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dbfe8c1

Browse files
Annybell VillarroelAnnybell Villarroel
Annybell Villarroel
authored and
Annybell Villarroel
committed
Update
1 parent 9cec53c commit dbfe8c1

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

auth0/v2/authentication/get_token.py

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class GetToken(AuthenticationBase):
55

6-
"""oauth/token related endpoints
6+
"""Oauth/token related endpoints
77
88
Args:
99
domain (str): Your auth0 domain (e.g: username.auth0.com)
@@ -19,6 +19,22 @@ def authorization_code(self, client_id, client_secret, code,
1919
This is the OAuth 2.0 grant that regular web apps utilize in order
2020
to access an API. Use this endpoint to exchange an Authorization Code
2121
for a Token.
22+
23+
Args:
24+
grant_type (str): Denotes the flow you're using. For authorization code
25+
use authorization_code
26+
27+
client_id (str): your application's client Id
28+
29+
client_secret (str): you application's client Secret
30+
31+
code (str): The Authorization Code received from the /authorize Calls
32+
33+
redirect_uri (srt, optional): This is required only if it was set at
34+
the GET /authorize endpoint. The values must match
35+
36+
Returns:
37+
access_token, id_token
2238
"""
2339

2440
return self.post(
@@ -41,6 +57,19 @@ def client_credentials(self, client_id, client_secret, audience,
4157
order to access an API. Use this endpoint to directly request
4258
an access_token by using the Client Credentials (a Client Id and
4359
a Client Secret).
60+
61+
Args:
62+
grant_type (str): Denotes the flow you're using. For client credentials
63+
use client_credentials
64+
65+
client_id (str): your application's client Id
66+
67+
client_secret (str): you application's client Secret
68+
69+
audience (str): The unique identifier of the target API you want to access.
70+
71+
Returns:
72+
access_token
4473
"""
4574

4675
return self.post(
@@ -65,6 +94,30 @@ def login(self, client_id, client_secret, username, password, scope, realm
6594
(browser). This information is later on sent to the client and Auth0.
6695
It is therefore imperative that the client is absolutely trusted with
6796
this information.
97+
98+
Args:
99+
grant_type (str): Denotes the flow you're using. For password realm
100+
use http://auth0.com/oauth/grant-type/password-realm
101+
102+
client_id (str): your application's client Id
103+
104+
client_secret (str): you application's client Secret
105+
106+
audience (str): The unique identifier of the target API you want to access.
107+
108+
username (str): Resource owner's identifier
109+
110+
password (str): resource owner's Secret
111+
112+
scope(srt): String value of the different scopes the client is asking for.
113+
Multiple scopes are separated with whitespace.
114+
115+
realm (str): String value of the realm the user belongs.
116+
Set this if you want to add realm support at this grant.
117+
118+
119+
Returns:
120+
access_token, id_token
68121
"""
69122

70123
return self.post(

auth0/v2/authentication/users.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def __init__(self, domain):
1515
def userinfo(self, access_token):
1616

1717
"""Returns the user information based on the Auth0 access token.
18+
This endpoint will work only if openid was granted as a scope for the access_token.
1819
1920
Args:
2021
access_token (str): Auth0 access token (obtained during login).

0 commit comments

Comments
 (0)