Private documentation with auth or jwt token check #1348
Replies: 5 comments 5 replies
-
are you able to implement this? |
Beta Was this translation helpful? Give feedback.
-
Sharing a link to a new template for Starlight + authentication built by @TheOtterlord: https://github.com/TheOtterlord/starlight-auth |
Beta Was this translation helpful? Give feedback.
-
Was anyone able to run starlight-auth with node? Seems to work as expected on Vercel, but I cannot get it to run on Node yet. Tried compiling server/indext.ts but couldn't figure it out yet. |
Beta Was this translation helpful? Give feedback.
-
Sharing a new example I created that uses the Better Auth library to handle user authentication: users can create an account, sign in, and sign out — some pages are protected and require the user to be authenticated to access them or even be visible in the documentation sidebar. |
Beta Was this translation helpful? Give feedback.
-
I'm making my life easy by using "proxy auth" - i.e. traffic hits my IdP which does the authentication and session management and almost acts like a reverse proxy but with extra steps. Finally, (if signed in) it passes on some user data via http headers to my astro site in ssr mode. Those headers are trivial to read from a middleware, but the part I'm struggling with is how to get a markdown page's props from my middleware. Sure, checking if the slug starts with a certain string is okay I guess but ideally I'd like to have a page prop in my frontmatter that controls the "confidentiality" level of that page - i.e. whether it requires signin, who can view it, and so on |
Beta Was this translation helpful? Give feedback.
-
What version of
starlight
are you using?4.0.0
What is your idea?
I have a commercial product and would like to implement the capability to authenticate by JWT tokens. This would enable users to access the documentation only after a successful check with the token
Why is this feature necessary?
Since the documentation is private and should not be publicly available I would like to add this check
Do you have examples of this feature in other projects?
No response
Participation
Beta Was this translation helpful? Give feedback.
All reactions