Custom Authentication
Connect to your own authentication back-end
While RainbowKit provides first-class support for Sign-In with Ethereum and NextAuth, you can also integrate with custom back-ends and message formats.
First create an authentication adapter. This allows RainbowKit to create/prepare messages and communicate with your back-end.
As an example, we could make an authentication adapter that lets us use Sign-In with Ethereum against some custom API endpoints, like iron-session.
Assuming your application is already managing the authentication lifecycle in some way, you can pass the current authentication status along with your custom adapter to RainbowKitAuthenticationProvider
, wrapping your existing RainbowKitProvider
.
If you've got this far and created an adapter for an existing open source authentication library, please consider creating a package for others to use!