1+ from __future__ import annotations
2+
3+ from typing import Any
4+
15from .base import AuthenticationBase
2- from .client_authentication import add_client_authentication
36
47
58class GetToken (AuthenticationBase ):
@@ -12,10 +15,10 @@ class GetToken(AuthenticationBase):
1215
1316 def authorization_code (
1417 self ,
15- code ,
16- redirect_uri ,
17- grant_type = "authorization_code" ,
18- ):
18+ code : str ,
19+ redirect_uri : str | None ,
20+ grant_type : str = "authorization_code" ,
21+ ) -> Any :
1922 """Authorization code grant
2023
2124 This is the OAuth 2.0 grant that regular web apps utilize in order
@@ -47,11 +50,11 @@ def authorization_code(
4750
4851 def authorization_code_pkce (
4952 self ,
50- code_verifier ,
51- code ,
52- redirect_uri ,
53- grant_type = "authorization_code" ,
54- ):
53+ code_verifier : str ,
54+ code : str ,
55+ redirect_uri : str | None ,
56+ grant_type : str = "authorization_code" ,
57+ ) -> Any :
5558 """Authorization code pkce grant
5659
5760 This is the OAuth 2.0 grant that mobile apps utilize in order to access an API.
@@ -86,9 +89,9 @@ def authorization_code_pkce(
8689
8790 def client_credentials (
8891 self ,
89- audience ,
90- grant_type = "client_credentials" ,
91- ):
92+ audience : str ,
93+ grant_type : str = "client_credentials" ,
94+ ) -> Any :
9295 """Client credentials grant
9396
9497 This is the OAuth 2.0 grant that server processes utilize in
@@ -116,13 +119,13 @@ def client_credentials(
116119
117120 def login (
118121 self ,
119- username ,
120- password ,
121- scope = None ,
122- realm = None ,
123- audience = None ,
124- grant_type = "http://auth0.com/oauth/grant-type/password-realm" ,
125- ):
122+ username : str ,
123+ password : str ,
124+ scope : str | None = None ,
125+ realm : str | None = None ,
126+ audience : str | None = None ,
127+ grant_type : str = "http://auth0.com/oauth/grant-type/password-realm" ,
128+ ) -> Any :
126129 """Calls /oauth/token endpoint with password-realm grant type
127130
128131
@@ -168,10 +171,10 @@ def login(
168171
169172 def refresh_token (
170173 self ,
171- refresh_token ,
172- scope = "" ,
173- grant_type = "refresh_token" ,
174- ):
174+ refresh_token : str ,
175+ scope : str = "" ,
176+ grant_type : str = "refresh_token" ,
177+ ) -> Any :
175178 """Calls /oauth/token endpoint with refresh token grant type
176179
177180 Use this endpoint to refresh an access token, using the refresh token you got during authorization.
@@ -199,7 +202,9 @@ def refresh_token(
199202 },
200203 )
201204
202- def passwordless_login (self , username , otp , realm , scope , audience ):
205+ def passwordless_login (
206+ self , username : str , otp : str , realm : str , scope : str , audience : str
207+ ) -> Any :
203208 """Calls /oauth/token endpoint with http://auth0.com/oauth/grant-type/passwordless/otp grant type
204209
205210 Once the verification code was received, login the user using this endpoint with their
0 commit comments