@@ -152,6 +152,7 @@ class Configuration:
152152 :param username: Username for HTTP basic authentication.
153153 :param password: Password for HTTP basic authentication.
154154 :param access_token: Access token.
155+ :param access_token_url: URL to get access token for OAuth2 authentication.
155156 :param client_id: Client ID for OAuth2 authentication.
156157 :param client_secret: Client Secret for OAuth2 authentication.
157158 :param server_index: Index to servers configuration.
@@ -201,6 +202,7 @@ def __init__(
201202 username : Optional [str ]= None ,
202203 password : Optional [str ]= None ,
203204 access_token : Optional [str ]= None ,
205+ access_token_url : Optional [str ]= None ,
204206 client_id : Optional [str ]= None ,
205207 client_secret : Optional [str ]= None ,
206208 server_index : Optional [int ]= None ,
@@ -258,6 +260,9 @@ def __init__(
258260 self .access_token = access_token
259261 """Access token
260262 """
263+ self .access_token_url = 'https://api.bandwidth.com/api/v1/oauth2/token' if access_token_url is None else access_token_url
264+ """URL to get access token for OAuth2 authentication
265+ """
261266 self .client_id = client_id
262267 """Client ID for OAuth2 authentication
263268 """
@@ -540,7 +545,7 @@ def get_access_token(self) -> str:
540545 auth_header = f"Basic { _encoded_string } "
541546 resp = urllib3 .request (
542547 'POST' ,
543- 'https://api.bandwidth.com/api/v1/oauth2/token' ,
548+ self . access_token_url ,
544549 headers = {
545550 'Authorization' : auth_header ,
546551 'Content-Type' : 'application/x-www-form-urlencoded' ,
0 commit comments