Hi! How does Graphcool’s Auth0 integration work fo...
# prisma-whats-new
r
Hi! How does Graphcool’s Auth0 integration work for mobile apps? I’m building a React Native app that lets a user sign in via the Auth0 Lock widget and then retrieve their data from Graphcool. PS: Feel free to point me to a better channel for this question – I wasn’t sure where to ask 🙂
n
@richeterre Hey! 🙂 We have two example projects for native that are using Auth0 - not quite sure if they fit your exact use case but they might give you an idea how to get started. The first one uses Expo: https://github.com/graphcool-examples/expo-auth0-instagram-example And the second one is a native example in Swift: https://github.com/nikolasburk/UDConf If neither of these help, feel free to ask again!! 👍
r
Hi @nikolasburk, thanks for the swift reply! I’m looking at https://github.com/nikolasburk/UDConf/blob/master/UDConf/ConferencesTableViewController.swift#L88-L96 and noticed that you’re using the
idToken
returned by Lock to authenticate against Graphcool. But according to Auth0 docs, this token is short-lived and should not be used for this purpose. How do you handle the case when it expires (the default seems to be 10 hours)?
I managed to get my app to work using this
idToken
, but when I return to it later, I just get plenty of permission errors because the token has expired.
n
Looking into it right now, will come back to you shortly! 🙂