@@ -13,11 +13,11 @@ def __init__(self, domain):
13
13
self .domain = domain
14
14
15
15
def authorization_code (self , client_id , client_secret , code ,
16
- grant_type = 'authorization_code' , redirect_uri ):
16
+ redirect_uri , grant_type = 'authorization_code' ):
17
17
"""Authorization code grant
18
-
19
- This is the OAuth 2.0 grant that regular web apps utilize in order
20
- to access an API. Use this endpoint to exchange an Authorization Code
18
+
19
+ This is the OAuth 2.0 grant that regular web apps utilize in order
20
+ to access an API. Use this endpoint to exchange an Authorization Code
21
21
for a Token.
22
22
23
23
Args:
@@ -27,10 +27,10 @@ def authorization_code(self, client_id, client_secret, code,
27
27
client_id (str): your application's client Id
28
28
29
29
client_secret (str): you application's client Secret
30
-
30
+
31
31
code (str): The Authorization Code received from the /authorize Calls
32
32
33
- redirect_uri (srt, optional): This is required only if it was set at
33
+ redirect_uri (srt, optional): This is required only if it was set at
34
34
the GET /authorize endpoint. The values must match
35
35
36
36
Returns:
@@ -50,12 +50,12 @@ def authorization_code(self, client_id, client_secret, code,
50
50
)
51
51
52
52
def client_credentials (self , client_id , client_secret , audience ,
53
- grant_type = 'client_credentials' ):
53
+ grant_type = 'client_credentials' ):
54
54
"""Client credentials grant
55
-
56
- This is the OAuth 2.0 grant that server processes utilize in
57
- order to access an API. Use this endpoint to directly request
58
- an access_token by using the Client Credentials (a Client Id and
55
+
56
+ This is the OAuth 2.0 grant that server processes utilize in
57
+ order to access an API. Use this endpoint to directly request
58
+ an access_token by using the Client Credentials (a Client Id and
59
59
a Client Secret).
60
60
61
61
Args:
@@ -65,7 +65,7 @@ def client_credentials(self, client_id, client_secret, audience,
65
65
client_id (str): your application's client Id
66
66
67
67
client_secret (str): you application's client Secret
68
-
68
+
69
69
audience (str): The unique identifier of the target API you want to access.
70
70
71
71
Returns:
@@ -81,18 +81,18 @@ def client_credentials(self, client_id, client_secret, audience,
81
81
'grant_type' : grant_type ,
82
82
},
83
83
headers = {'Content-Type' : 'application/json' }
84
- )
84
+ )
85
85
86
- def login (self , client_id , client_secret , username , password , scope , realm
87
- audience , grant_type = 'http://auth0.com/oauth/grant-type/password-realm' ):
86
+ def login (self , client_id , client_secret , username , password , scope , realm ,
87
+ audience , grant_type = 'http://auth0.com/oauth/grant-type/password-realm' ):
88
88
"""Calls oauth/token endpoint with password-realm grant type
89
89
90
90
91
- This is the OAuth 2.0 grant that highly trusted apps utilize in order
92
- to access an API. In this flow the end-user is asked to fill in credentials
93
- (username/password) typically using an interactive form in the user-agent
94
- (browser). This information is later on sent to the client and Auth0.
95
- It is therefore imperative that the client is absolutely trusted with
91
+ This is the OAuth 2.0 grant that highly trusted apps utilize in order
92
+ to access an API. In this flow the end-user is asked to fill in credentials
93
+ (username/password) typically using an interactive form in the user-agent
94
+ (browser). This information is later on sent to the client and Auth0.
95
+ It is therefore imperative that the client is absolutely trusted with
96
96
this information.
97
97
98
98
Args:
@@ -102,20 +102,19 @@ def login(self, client_id, client_secret, username, password, scope, realm
102
102
client_id (str): your application's client Id
103
103
104
104
client_secret (str): you application's client Secret
105
-
105
+
106
106
audience (str): The unique identifier of the target API you want to access.
107
107
108
108
username (str): Resource owner's identifier
109
109
110
110
password (str): resource owner's Secret
111
-
112
- scope(srt): String value of the different scopes the client is asking for.
111
+
112
+ scope(srt): String value of the different scopes the client is asking for.
113
113
Multiple scopes are separated with whitespace.
114
114
115
- realm (str): String value of the realm the user belongs.
115
+ realm (str): String value of the realm the user belongs.
116
116
Set this if you want to add realm support at this grant.
117
117
118
-
119
118
Returns:
120
119
access_token, id_token
121
120
"""
@@ -134,4 +133,3 @@ def login(self, client_id, client_secret, username, password, scope, realm
134
133
},
135
134
headers = {'Content-Type' : 'application/json' }
136
135
)
137
-
0 commit comments