René's URL Explorer Experiment


Title: Determine Best Auth Solution · Issue #828 · reactive-python/reactpy · GitHub

Open Graph Title: Determine Best Auth Solution · Issue #828 · reactive-python/reactpy

X Title: Determine Best Auth Solution · Issue #828 · reactive-python/reactpy

Description: Current Situation This stems from discussion in #768 As explained in https://github.com/phihos/idom-auth-example-sanic, the problem we need to solve is how to securely authenticate users inside an ReactPy single page application. Usually...

Open Graph Description: Current Situation This stems from discussion in #768 As explained in https://github.com/phihos/idom-auth-example-sanic, the problem we need to solve is how to securely authenticate users inside an ...

X Description: Current Situation This stems from discussion in #768 As explained in https://github.com/phihos/idom-auth-example-sanic, the problem we need to solve is how to securely authenticate users inside an ...

Opengraph URL: https://github.com/reactive-python/reactpy/issues/828

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Determine Best Auth Solution","articleBody":"### Current Situation\r\n\r\nThis stems from discussion in https://github.com/idom-team/idom/discussions/768\r\n\r\nAs explained in https://github.com/phihos/idom-auth-example-sanic, the problem we need to solve is how to securely authenticate users inside an ReactPy single page application. Usually authentication is done via Cookie or Authorization header on each HTTP request. But after the websocket connection has been established no further HTTP requests and therefore no further headers will be sent. However, there are some ways you could try to work around this:\r\n\r\n1. You could push some Javascript via `html.script` that sends a separate auth request to your auth API and then reloads the page to reestablish the websocket connection with new auth headers, but this is kinda ugly. It defeats the purpose of ReactPy not having to write any Javascript and having a visible reload has a negative impact on the user-experience.\r\n\r\n2. You could also render the login page traditionally and then redirect to a new page with [embedded ReactPy](https://reactpy.dev/docs/guides/getting-started/running-reactpy.html?highlight=embed#embed-in-an-existing-webpage) . But then you already split your application into two parts: \"pre-auth\" with traditional server-side template rendering and \"post-auth\" with ReactPy. Keeping both parts consistent is probably not fun.\r\n\r\n3. You can also do authentication inside the single page app and save the auth state via `use_state`. But it will be gone as soon as a websocket disconnect happens. You can mitigate this by pushing some Javascript that sets a session cookie. But now there is a new problem: Session cookies should be set with the `HttpOnly` flag to prevent XSS attacks from recovering the session cookie. This can not be done (or at least is difficult to do) with Javascript. So you might end up with a security flaw in your app.\r\n\r\n4. Since you have at least one full HTTP request-response cycle you can set a session cookie with a session ID on that response if the request does not already contain a cookie with a valid session ID. That ensures that the following request for the websocket connection always contains a session ID cookie. With `use_request` we can extract the session ID and then the server can retrieve the session data. In that data we can look up the authentication state and let ReactPy display a login form or the actual content. We can later manipulate the session data to perform a login or logout. All without the need to set a further cookie or push Javascript - provided we implement a server-side session. A rough prototype for this [has been implemented here](https://github.com/reactive-python/reactpy/pull/771) based on work done in https://github.com/phihos/idom-auth-example-sanic. \r\n\r\n### Proposed Actions\r\n\r\nExplore the viability of each option.","author":{"url":"https://github.com/rmorshea","@type":"Person","name":"rmorshea"},"datePublished":"2022-11-01T19:13:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":19},"url":"https://github.com/828/reactpy/issues/828"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:370d5475-74ad-b7b5-bb29-b76d03945e92
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAC00:14AB50:E76B810:12D6DB10:697729E5
html-safe-nonceae1b9867c47940a77f2ccc449757d583153e90936fc8f2a82d3ee05701665211
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzAwOjE0QUI1MDpFNzZCODEwOjEyRDZEQjEwOjY5NzcyOUU1IiwidmlzaXRvcl9pZCI6IjUxMDg1ODgxNTU1MTg3OTAxMTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb3bbd84bd9418490a22e063f95147933448a071f6126a764727d444949138905
hovercard-subject-tagissue:1431951276
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/reactive-python/reactpy/828/issue_layout
twitter:imagehttps://opengraph.githubassets.com/504af503124a82218a390e4e6586dcee1b0d97fefda31243c1c45add2a528754/reactive-python/reactpy/issues/828
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/504af503124a82218a390e4e6586dcee1b0d97fefda31243c1c45add2a528754/reactive-python/reactpy/issues/828
og:image:altCurrent Situation This stems from discussion in #768 As explained in https://github.com/phihos/idom-auth-example-sanic, the problem we need to solve is how to securely authenticate users inside an ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamermorshea
hostnamegithub.com
expected-hostnamegithub.com
None01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09
turbo-cache-controlno-preview
go-importgithub.com/reactive-python/reactpy git https://github.com/reactive-python/reactpy.git
octolytics-dimension-user_id106191177
octolytics-dimension-user_loginreactive-python
octolytics-dimension-repository_id171410703
octolytics-dimension-repository_nworeactive-python/reactpy
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id171410703
octolytics-dimension-repository_network_root_nworeactive-python/reactpy
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef752335dbbea672610081196a1998e39aec5e14b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/reactive-python/reactpy/issues/828#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Freactive-python%2Freactpy%2Fissues%2F828
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Freactive-python%2Freactpy%2Fissues%2F828
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=reactive-python%2Freactpy
Reloadhttps://patch-diff.githubusercontent.com/reactive-python/reactpy/issues/828
Reloadhttps://patch-diff.githubusercontent.com/reactive-python/reactpy/issues/828
Reloadhttps://patch-diff.githubusercontent.com/reactive-python/reactpy/issues/828
reactive-python https://patch-diff.githubusercontent.com/reactive-python
reactpyhttps://patch-diff.githubusercontent.com/reactive-python/reactpy
Please reload this pagehttps://patch-diff.githubusercontent.com/reactive-python/reactpy/issues/828
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Freactive-python%2Freactpy
Fork 332 https://patch-diff.githubusercontent.com/login?return_to=%2Freactive-python%2Freactpy
Star 8.2k https://patch-diff.githubusercontent.com/login?return_to=%2Freactive-python%2Freactpy
Code https://patch-diff.githubusercontent.com/reactive-python/reactpy
Issues 50 https://patch-diff.githubusercontent.com/reactive-python/reactpy/issues
Pull requests 2 https://patch-diff.githubusercontent.com/reactive-python/reactpy/pulls
Discussions https://patch-diff.githubusercontent.com/reactive-python/reactpy/discussions
Actions https://patch-diff.githubusercontent.com/reactive-python/reactpy/actions
Security 0 https://patch-diff.githubusercontent.com/reactive-python/reactpy/security
Insights https://patch-diff.githubusercontent.com/reactive-python/reactpy/pulse
Code https://patch-diff.githubusercontent.com/reactive-python/reactpy
Issues https://patch-diff.githubusercontent.com/reactive-python/reactpy/issues
Pull requests https://patch-diff.githubusercontent.com/reactive-python/reactpy/pulls
Discussions https://patch-diff.githubusercontent.com/reactive-python/reactpy/discussions
Actions https://patch-diff.githubusercontent.com/reactive-python/reactpy/actions
Security https://patch-diff.githubusercontent.com/reactive-python/reactpy/security
Insights https://patch-diff.githubusercontent.com/reactive-python/reactpy/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/reactive-python/reactpy/issues/828
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/reactive-python/reactpy/issues/828
Determine Best Auth Solutionhttps://patch-diff.githubusercontent.com/reactive-python/reactpy/issues/828#top
https://patch-diff.githubusercontent.com/rmorshea
priority-2-moderateShould be resolved on a reasonable timeline.https://github.com/reactive-python/reactpy/issues?q=state%3Aopen%20label%3A%22priority-2-moderate%22
type-investigationAbout research and gathering informationhttps://github.com/reactive-python/reactpy/issues?q=state%3Aopen%20label%3A%22type-investigation%22
https://github.com/rmorshea
https://github.com/rmorshea
rmorsheahttps://github.com/rmorshea
on Nov 1, 2022https://github.com/reactive-python/reactpy/issues/828#issue-1431951276
#768https://github.com/reactive-python/reactpy/discussions/768
https://github.com/phihos/idom-auth-example-sanichttps://github.com/phihos/idom-auth-example-sanic
embedded ReactPyhttps://reactpy.dev/docs/guides/getting-started/running-reactpy.html?highlight=embed#embed-in-an-existing-webpage
has been implemented herehttps://github.com/reactive-python/reactpy/pull/771
https://github.com/phihos/idom-auth-example-sanichttps://github.com/phihos/idom-auth-example-sanic
rmorsheahttps://patch-diff.githubusercontent.com/rmorshea
priority-2-moderateShould be resolved on a reasonable timeline.https://github.com/reactive-python/reactpy/issues?q=state%3Aopen%20label%3A%22priority-2-moderate%22
type-investigationAbout research and gathering informationhttps://github.com/reactive-python/reactpy/issues?q=state%3Aopen%20label%3A%22type-investigation%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.