-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add python shiny express oauth test app
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from posit import connect | ||
from shiny.express import render, session | ||
|
||
# Runs once per startup | ||
client = connect.Client() | ||
|
||
# Runs once per session | ||
@render.text | ||
def access_token(): | ||
user_session_token = session.http_conn.headers.get("Posit-Connect-User-Session-Token") | ||
return client.oauth.get_credentials(user_session_token).get("access_token") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"version": 1, | ||
"locale": "en_US.UTF-8", | ||
"metadata": { | ||
"appmode": "python-shiny", | ||
"entrypoint": "shiny.express.app:app_2e_py" | ||
}, | ||
"python": { | ||
"version": "3.11.3", | ||
"package_manager": { | ||
"name": "pip", | ||
"version": "24.1.1", | ||
"package_file": "requirements.txt" | ||
} | ||
}, | ||
"files": { | ||
"requirements.txt": { | ||
"checksum": "ef98e3be14a319ebb9f1d215e1df58ea" | ||
}, | ||
"app.py": { | ||
"checksum": "4ee2ac2b5117b68af1c69536e9c0f9f0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
posit-sdk==0.3.1 | ||
shiny==1.0.0 |