Skip to content

Commit bc32875

Browse files
committed
Link updates
* tools/tokensaver.py:
1 parent 07a02c9 commit bc32875

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tools/tokensaver.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ def __init__(self):
3030
self.name = "OK"
3131
configuration = {
3232
'issuer': 'https://cognito-idp.eu-west-1.amazonaws.com/eu-west-1_SLI9qJpc7',
33-
'authorization_endpoint': 'https://daikin-unicloud-prod.auth.eu-west-1.amazoncognito.com/oauth2/authorize',
33+
'authorization_endpoint': 'https://idp.onecta.daikineurope.com/v1/oidc/authorize',
3434
'userinfo_endpoint': 'userinfo_endpoint',
35-
'token_endpoint': 'https://daikin-unicloud-prod.auth.eu-west-1.amazoncognito.com/oauth2/token',
35+
'token_endpoint': 'https://idp.onecta.daikineurope.com/v1/oidc/token',
3636
'token_endpoint_auth_methods_supported': ['none']
3737
}
3838

39-
self.openIdClientId = '7rk39602f0ds8lk0h076vvijnb'
39+
self.openIdClientId = 'emU20GdJDiiUxI_HnFGz69dD'
4040
self.openIdClient = Client(client_id = self.openIdClientId, config=configuration)
4141
self.openIdClient.provider_config(configuration['issuer'])
4242
self.openIdStore = {}
@@ -86,7 +86,7 @@ async def doBearerRequest(self, resourceUrl, options=None, refreshed=False):
8686

8787
async def refreshAccessToken(self):
8888
"""Attempt to refresh the Access Token."""
89-
url = 'https://cognito-idp.eu-west-1.amazonaws.com'
89+
url = 'https://idp.onecta.daikineurope.com/v1/oidc/token'
9090

9191
headers = {
9292
'Content-Type': 'application/x-amz-json-1.1',
@@ -149,10 +149,10 @@ async def _doAuthorizationRequest(self):
149149
state = base64.urlsafe_b64encode(os.urandom(32)).decode('utf-8').replace('=','')
150150
print("STATE: {}".format(state))
151151
args = {
152-
'authorization_endpoint': 'https://daikin-unicloud-prod.auth.eu-west-1.amazoncognito.com/oauth2/authorize',
152+
'authorization_endpoint': 'https://idp.onecta.daikineurope.com/v1/oidc/authorize',
153153
'userinfo_endpoint': 'userinfo_endpoint',
154154
'response_type': ['code'],
155-
'scopes': 'email,openid,profile',
155+
'scopes': 'email,openid,profile,',
156156
}
157157

158158
self.openIdClient.redirect_uris = ['daikinunified://login']
@@ -172,8 +172,8 @@ async def _doAccessTokenRequest(self, callbackUrl):
172172
state = self.state
173173

174174
args = {
175-
'authorization_endpoint': 'https://daikin-unicloud-prod.auth.eu-west-1.amazoncognito.com/oauth2/authorize',
176-
'token_endpoint': 'https://daikin-unicloud-prod.auth.eu-west-1.amazoncognito.com/oauth2/token',
175+
'authorization_endpoint': 'https://idp.onecta.daikineurope.com/v1/oidc/authorize',
176+
'token_endpoint': 'https://idp.onecta.daikineurope.com/v1/oidc/token',
177177
'token_endpoint_auth_methods_supported': ['none'],
178178
# 'userinfo_endpoint': 'userinfo_endpoint',
179179
'response_type': ['code'],
@@ -461,6 +461,7 @@ async def main():
461461
user = sys.argv[1] if len(sys.argv) >= 2 else "nousr"
462462
pwd = sys.argv[2] if len(sys.argv) >= 3 else "nopwd"
463463
print ("PARAMS: " + user + " " + pwd)
464+
logging.getLogger('oci').setLevel(logging.DEBUG)
464465
controller = DaikinCloudController()
465466
tokenSet = await controller.retrieveAccessToken(user, pwd)
466467
devices = await controller.getCloudDevices()

0 commit comments

Comments
 (0)