Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth tutorials #1228

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Auth tutorials #1228

wants to merge 5 commits into from

Conversation

sfc-gh-dmatthews
Copy link
Contributor

@sfc-gh-dmatthews sfc-gh-dmatthews commented Feb 7, 2025

📚 Context

Add Google Auth tutorial
Add Microsoft Entra tutorial

Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@sfc-gh-dmatthews sfc-gh-dmatthews changed the title Auth tutorials Google auth tutorial Feb 7, 2025
@sfc-gh-dmatthews sfc-gh-dmatthews changed the title Google auth tutorial Auth tutorials Feb 8, 2025
def login_screen():
st.header("This app is private.")
st.subheader("Please log in.")
st.button("Log in with Google", on_click=st.login)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a real problem, absolutely trust your judgment here for the final decision, but I think it would be easier to comprehend if we not include a little bit more advanced concept like button callbacks for auth tutorial, and will say something like

login_button_clicked = st.button("Log in with Google", on_click=st.login)
if login_button_clicked:
    st.login()

The reason is that if then user would like to specify a provider (which is a way I personally prefer for secrets organization, it would be obvious how to pass a argument to st.login(). It is possible with on_click too via args/kwargs, but then it became even more complicated to comprehend it.


# Use Microsoft Entra to authenticate users

[Microsoft Identity Platform](https://learn.microsoft.com/en-us/entra/identity-platform/v2-overview) is a service within Microsoft Entra that lets you build applications to authenticate users. Your applications can use personal, work, and school accounts managed by Microsoft. You can also connect other identity providers, like [Facebook](https://learn.microsoft.com/en-us/entra/external-id/facebook-federation).
Copy link
Collaborator

@kajarenc kajarenc Feb 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also connect with other identity providers, like [Facebook]

I am not sure it will work out of the box with the OIDC flow described in the tutorial, where the actual Auth flow will happen, I assume on Azure, and it will talk with Facebook in the background?

Please ignore this comment, if it has already been checked :)

@kajarenc
Copy link
Collaborator

kajarenc commented Feb 9, 2025

LGTM 👍

I think for some moment (probably for the Okta tutorial it makes more sense, but could be good for Microsoft Entra too) it could be a good idea to explain the client_kwargs option in the secrets and communicate that we use the default
scope="openid profile email" and prompt="select_account", but it could be overridden by the user.

I know this information is already included in the st.login documentation itself, but could be a good idea to highlight it in one of the upcoming tutorials

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants