I just developed a Tanstack-Start example for an OAuth2 Code-Flow login to github, google and keycloak.
I wanted to login without any library usage to find out the differences of these identity-providers. And there are many small things like params required, getting the token from auth-code has slightly different fetch requirements, e.g. including params in the POST body instead of query-params etc. .
This example code was inspired by (https://www.youtube.com/watch?v=rRn2EisxPl4) but I did not use expressJS because Tanstack has all we need in server-side functions.
(https://tanstack.com/router/latest/docs/framework/react/start/server-functions)
Here is my example:
(https://github.com/progwise/tanstack-auth-examples)
Happy coding!
Michael
For a TanStack-Start solution that uses the keycloakJS library see my other article/example:
(https://dev.to/moncapitaine/tanstack-start-keycloakjs-client-library-4f84)
Top comments (0)