RFC: Support native apps with bearer token support #652
Replies: 4 comments 10 replies
-
👍🏻 I am looking forward to this feature! I suggest adding guides to the CLI as well. |
Beta Was this translation helpful? Give feedback.
-
I'm guessing there's 2 ways of handling auth. Use app as the auth clientUse Use web as the auth clientValidation happens in the browser. Token is sent with deep-linking ( I'm going to guess that listening for navigation is the easier option for desktop (?):
For mobile (Expo and Native), still looking into it |
Beta Was this translation helpful? Give feedback.
-
any update on using this with expo? |
Beta Was this translation helpful? Give feedback.
-
does “Sign in with Apple” work by following the Expo guide? |
Beta Was this translation helpful? Give feedback.
-
I've gotten a few questions regarding on if Lucia can be used with native apps like React Native, Expo, Electron, and Tauri. Lucia is a server side library so it'll work as long as you have a server your app can call. Something like this for OAuth:
Unlike regular session ids, it should be long lasting (like a year). The client can now make requests by sending the token as a bearer token in the authorization header.
For token renewal, I'm not sure what's the best way to go. You can just disable it all together, or just send a 401 whenever the token is expired and let the client renew it.
API change
I think adding a way to validate access tokens would be enough:
Unlike
validateUser()
, it should not renew idle sessions.Docs
Maybe add a "Native" framework id, and add guides to Electron, React Native, etc? This part I need the help most :D
Beta Was this translation helpful? Give feedback.
All reactions