Skip to content

Commit 16beb76

Browse files
committed
add an app for authentication
1 parent bf3995a commit 16beb76

File tree

5 files changed

+171
-1
lines changed

5 files changed

+171
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,4 @@ cython_debug/
164164
requirements.txt
165165
generated
166166
tests/test_codegen.py
167+
.streamlit/*

docs/index.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ make install-deps-dev
1515

1616
- [[BUG] Host system is missing dependencies to run browsers (WSL2) #19100](https://github.com/microsoft/playwright/issues/19100)
1717

18-
## Guides
18+
## Fundamentals
1919

2020
To run some demos, please follow the instructions below.
2121

@@ -30,6 +30,35 @@ make show-trace
3030
make codegen
3131
```
3232

33+
## Guides
34+
35+
### Authentication
36+
37+
To run a frontend application with authentication, you can refer to the following links.
38+
39+
- [User authentication and information](https://docs.streamlit.io/develop/concepts/connections/authentication)
40+
- [Use Microsoft Entra to authenticate users](https://docs.streamlit.io/develop/tutorials/authentication/microsoft)
41+
42+
For example, you can use the following file [.streamlit/secrets.toml](../.streamlit/secrets.toml) to set up authentication with Microsoft Entra ID.
43+
44+
```toml
45+
[auth]
46+
redirect_uri = "http://localhost:8501/oauth2callback"
47+
cookie_secret = "xxx"
48+
49+
[auth.microsoft]
50+
client_id = "your-client-id"
51+
client_secret = "your-client-secret"
52+
server_metadata_url = "https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration"
53+
```
54+
55+
Then, run the application using the following command:
56+
57+
```shell
58+
# Run the application
59+
uv run streamlit run workshop_playwright_python/apps/authentication.py
60+
```
61+
3362
## [Microsoft Playwright Testing](https://learn.microsoft.com/ja-jp/azure/playwright-testing/)
3463

3564
- [Get Started Sample](https://github.com/microsoft/playwright-testing-service/tree/main/samples/get-started)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description = "A GitHub template repository for Python"
55
readme = "README.md"
66
requires-python = ">=3.10"
77
dependencies = [
8+
"authlib>=1.5.2",
89
"playwright>=1.52.0",
910
"pytest-playwright>=0.7.0",
1011
"streamlit>=1.45.0",

0 commit comments

Comments
 (0)