Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit b3f8a56

Browse files
committed
add response_type to get_auth_url
1 parent 7b6ed59 commit b3f8a56

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/onedrivesdk/auth_provider.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,21 @@ def auth_token_url(self):
152152
def auth_token_url(self, value):
153153
self._auth_token_url = value
154154

155-
def get_auth_url(self, redirect_uri):
155+
def get_auth_url(self, redirect_uri, response_type=None):
156156
"""Build the auth url using the params provided
157157
and the auth_provider
158158
159159
Args:
160160
redirect_uri (str): The URI to redirect the response
161161
to
162+
response_type (str): Response type query param value.
163+
If not provided, defaults to 'code'. Should be either
164+
'code' or 'token'.
162165
"""
163166

164167
params = {
165168
"client_id": self.client_id,
166-
"response_type": "code",
169+
"response_type": "code" if response_type is None else response_type,
167170
"redirect_uri": redirect_uri
168171
}
169172
if self.scopes is not None:

src/onedrivesdk/helpers/get_access_token_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import webbrowser
3838

3939

40-
def get_access_token(auth_url, redirect_uri):
40+
def get_auth_token(auth_url, redirect_uri):
4141
"""Easy way to get the auth token. Wraps up all the threading
4242
and stuff. Does block main thread.
4343

0 commit comments

Comments
 (0)