diff --git a/streamlit/security.py b/streamlit/security.py index 1ad59fd..69e0b91 100644 --- a/streamlit/security.py +++ b/streamlit/security.py @@ -3,7 +3,7 @@ import msal import requests import boto3 from botocore.exceptions import ClientError - +import json # Replace with your own values CLIENT_ID = 'effafe90-7ed7-43a3-ab03-19a0be2f1758' @@ -14,6 +14,7 @@ AUTHORITY = 'https://login.microsoftonline.com/organizations/' SCOPE = ['User.Read'] REDIRECT_URI = 'https://171.29.20.126:8501' +# Initialize boto3 client to interact with AWS Secrets Manager @@ -24,12 +25,12 @@ def get_secret(): region_name = "us-east-2" # Create a Secrets Manager client - session = boto3.session.Session() - client = session.client( - service_name='secretsmanager', - region_name=region_name - ) - + # session = boto3.session.Session() + # client = session.client( + # service_name='secretsmanager', + # region_name=region_name + # ) + client = boto3.client('secretsmanager', region_name=region_name) try: get_secret_value_response = client.get_secret_value( SecretId=secret_name @@ -38,6 +39,7 @@ def get_secret(): raise e secret = get_secret_value_response['SecretString'] + secret = json.loads(secret)['CLIENT_SECRET'] return secret