RFC: Support native apps with bearer token support #652
Replies: 5 comments 13 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.
-
|
Hi @pilcrowonpaper, ik this is probably really old. But just a question... But would you actually recommend passing the session_id to the deeplink like this? I mean the session_id is long-lived and just there in plain-text. Isn't this an attack vector? iirc, I think you recommended before to use a single-use / one-time token for cases like these when the session_id isn't accessible via the HTTP cookie. So maybe a better flow for here would be?
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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