OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

MSAL login pop-up is not showing user selection in docker image

  • Thread starter Thread starter Pam
  • Start date Start date
P

Pam

Guest
I have streamlit application, which runs properly in local with MSAL login. but when try to run same code in docker image. code runs fine but pop-up to select user account is coming blank.

my login.py is below:

Code:
def login():
     
    st.image("images/nc_header.png")
    st.title("Welcome to Meeting Summarizer")
    auth_data = Msal.initialize_ui(
                client_id=CLIENT_ID,
                authority=AUTHORITY,
                scopes=[], # Optional
                # Customize (Default values):
                connecting_label="Connecting",
                disconnected_label="Disconnected",
                sign_in_label="Sign in",
                sign_out_label="Sign out"
            )

    if not auth_data:
            st.write("Please authenticate to access Meeting Summarizer")
            st.stop()
    return  auth_data       

# account = auth_data["account"]
# print("account", account)

# name = account["name"]
# print("name", name)


if 'accessToken' not in st.session_state:
    
    authValues=login()
    account = authValues["account"]
    print("account", account)

    name = account["name"]
    print("name", name)
    username = account["username"]
    print("username", username)
    # Getting useful information
    access_token = authValues["accessToken"]
    print("access_token", access_token)
    if account:
        st.session_state.logged_in = True
        # Store the name and access token in session state
        st.session_state.name = name
        st.session_state.access_token = access_token
        st.success("Logged in successfully!")
        print("Session State:", st.session_state)
        sleep(0.5)
    
        st.switch_page("pages/Meeting_Notes.py")

my docker file contains below:

Code:
FROM python:3.10.11
COPY ./requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip install -r requirements.txt
COPY . /app
EXPOSE 8000
CMD ["streamlit", "run", "Login.py", "--server.port=8000", "--server.address=0.0.0.0"]

when run locally , this is the pop-up is visible:

enter image description here

but when I try to run same code with docker image, showing below blank pop-up:

enter image description here

I am expecting to resolve above issue.

I am new to this , any help will be thankful.
<p>I have streamlit application, which runs properly in local with MSAL login. but when try to run same code in docker image. code runs fine but pop-up to select user account is coming blank.</p>
<p>my login.py is below:</p>
<pre><code>def login():

st.image("images/nc_header.png")
st.title("Welcome to Meeting Summarizer")
auth_data = Msal.initialize_ui(
client_id=CLIENT_ID,
authority=AUTHORITY,
scopes=[], # Optional
# Customize (Default values):
connecting_label="Connecting",
disconnected_label="Disconnected",
sign_in_label="Sign in",
sign_out_label="Sign out"
)

if not auth_data:
st.write("Please authenticate to access Meeting Summarizer")
st.stop()
return auth_data

# account = auth_data["account"]
# print("account", account)

# name = account["name"]
# print("name", name)


if 'accessToken' not in st.session_state:

authValues=login()
account = authValues["account"]
print("account", account)

name = account["name"]
print("name", name)
username = account["username"]
print("username", username)
# Getting useful information
access_token = authValues["accessToken"]
print("access_token", access_token)
if account:
st.session_state.logged_in = True
# Store the name and access token in session state
st.session_state.name = name
st.session_state.access_token = access_token
st.success("Logged in successfully!")
print("Session State:", st.session_state)
sleep(0.5)

st.switch_page("pages/Meeting_Notes.py")
</code></pre>
<p>my docker file contains below:</p>
<pre><code>FROM python:3.10.11
COPY ./requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip install -r requirements.txt
COPY . /app
EXPOSE 8000
CMD ["streamlit", "run", "Login.py", "--server.port=8000", "--server.address=0.0.0.0"]
</code></pre>
<p>when run locally , this is the pop-up is visible:</p>
<p><a href="https://i.sstatic.net/M6sWX73p.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/M6sWX73p.png" alt="enter image description here" /></a></p>
<p>but when I try to run same code with docker image, showing below blank pop-up:</p>
<p><a href="https://i.sstatic.net/9njRU3fK.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9njRU3fK.png" alt="enter image description here" /></a></p>
<p>I am expecting to resolve above issue.</p>
<p>I am new to this , any help will be thankful.</p>
 

Online statistics

Members online
0
Guests online
3
Total visitors
3
Top