Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: Provide modules for integrating Supabase Auth into a custom backend #415

Open
2 tasks done
landsman opened this issue Jan 5, 2024 · 10 comments
Open
2 tasks done
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@landsman
Copy link

landsman commented Jan 5, 2024

General Info

  • I installed the latest version of Supabase Kt
  • I checked for similar feature requests

Feature request

Please provide a package to decode JWT auth. Including Supabase user interface etc.
It would be lovely to have ready-made integration for the most common Spring Boot Framework (Java/Kotlin).

Inspiration: https://github.com/tschuehly/htmx-supabase-spring-boot-starter/tree/master/src/main/kotlin/de/tschuehly/htmx/spring/supabase/auth

Usecase

Typically you have React / Next.js application for frontend and backend in Spring Boot. So you want to get a Supabase access token and verify it on the backend to let the user in and pair it to backend entities.

@landsman landsman added the enhancement New feature or request label Jan 5, 2024
@jan-tennert jan-tennert self-assigned this Jan 5, 2024
@jan-tennert
Copy link
Collaborator

Could you clarify what exactly such a library should provide? So JWT decoding and verification?

@nateweisz
Copy link

nateweisz commented Jan 5, 2024

Could you clarify what exactly such a library should provide? So JWT decoding and verification?

I'd also be interested in this for ktor as a server. Our frontend uses supabase for authentication and I need to be able to intercept requests and perform authentication checks on the backend.

@jan-tennert
Copy link
Collaborator

Could you clarify what exactly such a library should provide? So JWT decoding and verification?

I'd also be interested in this for ktor as a server. Our frontend uses supabase for authentication and I need to be able to intercept requests and perform authentication checks on the backend.

So it should work like a ktor plugin which automatically checks/rejects requests based on the JWT?

@nateweisz
Copy link

Could you clarify what exactly such a library should provide? So JWT decoding and verification?

I'd also be interested in this for ktor as a server. Our frontend uses supabase for authentication and I need to be able to intercept requests and perform authentication checks on the backend.

So it should work like a ktor plugin which automatically checks/rejects requests based on the JWT?

Yes, or at least makes it possibly to build that into your system without too much code.

@jan-tennert jan-tennert removed their assignment Jan 6, 2024
@jan-tennert jan-tennert added the help wanted Extra attention is needed label Jan 9, 2024
@jan-tennert
Copy link
Collaborator

jan-tennert commented Jan 9, 2024

Alright, if anyone wants to try to take this on, feel free to ask me for questions about integrating this into supabase-kt. I think ideally there is some basic JWT stuff inside gotrue-kt and then there are spring-boot/ktor modules inside /plugins (like Compose Auth Ui which is not really a supabase-kt plugin). I'm neither an expert in spring-boot nor server side authentication with ktor so it might take a while until I start to work on it.

@jan-tennert jan-tennert changed the title [Feature request]: package to use jwt for backend [Feature request]: Provide modules for integrating Supabase Auth into a custom backend Jan 9, 2024
@landsman
Copy link
Author

landsman commented Jan 9, 2024

@tschuehly can you help us here, please? I was able to use your code from the mentioned repository and I think that official/community integration would be amazing for the Spring Framework ecosystem :)

@tschuehly
Copy link

@landsman
What kind of help would you need? You should be able to use the htmx-supabase-starter also in non htmx spring boot projects.

It would probably make sense to partition the different functionality.

@landsman
Copy link
Author

landsman commented Jan 9, 2024

@tschuehly I would appreciate your feedback on what would be good to provide (classes, methods) from supabase-kt to be easy to use in projects and packages like yours.

@nateweisz
Copy link

Alright, if anyone wants to try to take this on, feel free to ask me for questions about integrating this into supabase-kt. I think ideally there is some basic JWT stuff inside gotrue-kt and then there are spring-boot/ktor modules inside /plugins (like Compose Auth Ui which is not really a supabase-kt plugin). I'm neither an expert in spring-boot nor server side authentication with ktor so it might take a while until I start to work on it.

I'm currently working on a backend that will use it. I can try and post some code/work on it once I get that done but mostly waiting on my frontend team to get started.

@tschuehly
Copy link

@landsman
I can check in 2 weeks or so when I'm back from my holidays!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants