Replies: 10 comments 4 replies
-
correct A leptos example, it depends if your leptos app is running with SSR or CSR. If it's SSR, then you could either do it like in one of the examples for the As an example for an axum backend, you can do the following (since leptos v0.6 you don't need to specify the sever fn handler like in this screen shot any more): Next, you can handle all the leptos routes yourself and have full control over it: These example screenshots are taken from a small app I am working on right now, so they include more stuff than you would need (maybe). You can take a peek at the client's cookies and HTTP header before even starting to render the leptos part. This way you can extract a session cookie or maybe an In the end, the whole thing would roughly look like that:
Something else you could do is to take a look at leptos_oidc. I have never used it so far, because I use the rauthy-client everywhere, but this has been tested and is working with Rauthy as well. There are even examples. If your app is using CSR, the whole thing would get a bit easier. Let me know if this is the case and I can give some guidance on that as well. I am just assuming you use leptos in SSR mode, which makes the most sense. |
Beta Was this translation helpful? Give feedback.
-
Another much simpler approach to the one above, but of course with a different UX as well, would be to simply not use any custom routes extractor and return 301's from any protected endpoints, if the user is not logged in. |
Beta Was this translation helpful? Give feedback.
-
Incredible! Very informative and thorough. I'll be working on this in the next couple of weeks (hopefully) and will follow up here (if this is a good place to do so). |
Beta Was this translation helpful? Give feedback.
-
If you are just asking for advice or something, starting a discussion would be cleaner. But if you have an issue, then this is the right place, yes. So I guess this issue can be closed for now, since there just is none so far? |
Beta Was this translation helpful? Give feedback.
-
Looks like you may as well move this from Issues to Discussion :) GitHub lets you do that. |
Beta Was this translation helpful? Give feedback.
-
Thanks @erlend-sh . Didn't know github can do this. :) |
Beta Was this translation helpful? Give feedback.
-
Oh thanks! :) |
Beta Was this translation helpful? Give feedback.
-
I got an E-Mail because of a post from you @sjud asking about upstream SSO providers, but I cannot see the post here. The title may not be totally clear, but when I will implement this issue, it will be a generic support for any upstream auth provider. |
Beta Was this translation helpful? Give feedback.
-
Yes, I did post that. But then as I dug through the information available I found an answer to my question so I went and I deleted my question (I didn't want anyone to waste their time on it) little did I know you got an email about it. :) Regarding a generic implementation, it seems like various popular SSO providers have slightly different processes which might make a fully generic implementation a pain. It might be beneficial for there to be some specific implementations for upstream auth providers, such the big five or six google, facebook, github, apple, microsoft, etc. This would satisfy some aspiring rauthy users, providing their needed functionality for their onboarding process while also possibly laying the groundwork for a generic implementation later. Having a handful of specific implementations make the design of the generic much easier in my experience. I've been reading the rauthy codebase, and I find it very accessible and I appreciate the way you've written it. You're responsiveness and willingness to share technical details is very inspiring and I'd like to contribute to the rauthy code base. May I write a specific implementation for one such upstream auth provider and open a pull request for it? From there we can tweak details and I could hammer out all the popular ones and lay the groundwork for a future generic implementation. I'd love to get involved in this project! Please let me know what you think, thank you. |
Beta Was this translation helpful? Give feedback.
-
Oops I deleted another comment again. Sorry! |
Beta Was this translation helpful? Give feedback.
-
It looks like, I would run it alongside the server and then use the rauthy client to make calls to it? And it would act like google SSO acts but instead it is my own SSO. So if I deployed this next to my server, I'd basically be the SSO auth provider?
How best would I use this in a leptos example? Thanks for your work on this project!!
Beta Was this translation helpful? Give feedback.
All reactions