How to Override , login function from Authenticator class , streamlit_authenticatorar library

Hello Streamlit Team,

I have a GenAI application using streamlit in the frontend. However, I need username should be an integer. But login function from Authenticator class of streamlit_authenticator library accepts only string as username , if we pass integer its giving error : AttributeError: ‘int’ object has no attribute ‘lower’. ( I can make the changes in authenticate.py file , as it cant be deployed in azure , this approach is not recommended)

I would like to know, how can we override login function from Authenticator class of streamlit_authenticator library.

Appreciate your time!

Thanks!

Hey @Rakshitha,

Thanks for sharing this question! Other than converting the int to a string or modifying the streamlit-authenticator code, I’m not aware of a built-in way to change the type of the username. You could also open a GitHub Issue for the creator of the package (@mkhorasani) to review.

Hi @Rakshitha, in its current form, Streamlit-Authenticator expects a string input for the username. Please raise an issue on the GitHub repository, and I will try to address it for the next release. Thanks.

1 Like

Thank you for your help, @mkhorasani! :heart: really appreciate it

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.