File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,11 @@ def access_token_expired(self):
212
212
213
213
@CheckAuth
214
214
def LocalWebserverAuth (
215
- self , host_name = "localhost" , port_numbers = None , launch_browser = True
215
+ self ,
216
+ host_name = "localhost" ,
217
+ port_numbers = None ,
218
+ launch_browser = True ,
219
+ bind_addr = None ,
216
220
):
217
221
"""Authenticate and authorize from user by creating local web server and
218
222
retrieving authentication code.
@@ -226,6 +230,10 @@ def LocalWebserverAuth(
226
230
:type port_numbers: list.
227
231
:param launch_browser: should browser be launched automatically
228
232
:type launch_browser: bool
233
+ :param bind_addr: optional IP address for the local web server to listen on.
234
+ If not specified, it will listen on the address specified in the
235
+ host_name parameter.
236
+ :type bind_addr: str.
229
237
:returns: str -- code returned from local web server
230
238
:raises: AuthenticationRejected, AuthenticationError
231
239
"""
@@ -241,7 +249,7 @@ def LocalWebserverAuth(
241
249
port_number = port
242
250
try :
243
251
httpd = ClientRedirectServer (
244
- (host_name , port ), ClientRedirectHandler
252
+ (bind_addr or host_name , port ), ClientRedirectHandler
245
253
)
246
254
except OSError :
247
255
pass
You can’t perform that action at this time.
0 commit comments