3
3
4
4
class GetToken (AuthenticationBase ):
5
5
6
- """oauth /token related endpoints
6
+ """Oauth /token related endpoints
7
7
8
8
Args:
9
9
domain (str): Your auth0 domain (e.g: username.auth0.com)
@@ -19,6 +19,22 @@ def authorization_code(self, client_id, client_secret, code,
19
19
This is the OAuth 2.0 grant that regular web apps utilize in order
20
20
to access an API. Use this endpoint to exchange an Authorization Code
21
21
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
22
38
"""
23
39
24
40
return self .post (
@@ -41,6 +57,19 @@ def client_credentials(self, client_id, client_secret, audience,
41
57
order to access an API. Use this endpoint to directly request
42
58
an access_token by using the Client Credentials (a Client Id and
43
59
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
44
73
"""
45
74
46
75
return self .post (
@@ -65,6 +94,30 @@ def login(self, client_id, client_secret, username, password, scope, realm
65
94
(browser). This information is later on sent to the client and Auth0.
66
95
It is therefore imperative that the client is absolutely trusted with
67
96
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
68
121
"""
69
122
70
123
return self .post (
0 commit comments