Skip to content

Commit fb206ff

Browse files
committed
Fix cognito auth flow
1 parent 7cd1111 commit fb206ff

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

py_boilingdata/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# Preview environment in eu-west-1
1717
# TODO: Put in dotenv for example
1818
AWS_REGION = os.getenv("AWS_REGION", os.getenv("AWS_DEFAULT_REGION", "eu-west-1"))
19-
USER_POOL_ID = "eu-west-1_0GLV9KO1p"
2019
CLIENT_ID = "37f44ql7bp5p8fpk5qrh2sgu8"
2120
BOILING_WSS_URL = "wss://4rpyi2ae3f.execute-api.eu-west-1.amazonaws.com/prodbd/"
2221
# BOILING_WSS_URL = "wss://e4f3t7fs58.execute-api.eu-west-1.amazonaws.com/devbd/"
@@ -158,10 +157,9 @@ def _get_auth_headers(self):
158157

159158
def _get_cognito_tokens(self, username, password):
160159
try:
161-
response = self.idp_client.admin_initiate_auth(
162-
UserPoolId=USER_POOL_ID,
160+
response = self.idp_client.initiate_auth(
163161
ClientId=CLIENT_ID,
164-
AuthFlow="ADMIN_USER_PASSWORD_AUTH",
162+
AuthFlow="USER_PASSWORD_AUTH",
165163
AuthParameters={"USERNAME": username, "PASSWORD": password},
166164
)
167165
return response["AuthenticationResult"]
@@ -175,7 +173,7 @@ def _get_cognito_tokens(self, username, password):
175173
self.logger.error(e)
176174
self.logger.error("Credentials not available.")
177175
raise e
178-
except:
176+
except Exception as e:
179177
self.logger.error(e)
180178
raise e
181179

0 commit comments

Comments
 (0)