-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS SDK Offline authentication with WiFi #650
Comments
Hi @MysticMedia, an internet connection is required to log in. Once the user is logged in, you can store the credentials in your app and then on launch use the expiration timestamp to check if they're still valid. If the credentials are still valid, then you don't need to perform login again. This step does not require an internet connection. Once the credentials expire, you can use the refresh token (use the Please check out the Auth0.swift User Sessions QuickStart to learn more. Does that help? |
Yes, we understand that. The issue is. Your SDK thinks we have an active
internet connection because we are connected to an SSID. But our SSID is
for an internal network without access to the internet. So the auth0 SDK
is trying to connect to the internet and validating the credentials. It
works fine, as you mentioned when we have no internet connection AND it is
not connected to an SSID. So what we need is to force the SDK to ignore our
SSID connection and jut use the stored credentials.
Please let me know if I am making sense.
Thank you!
…On Thu, Jan 28, 2021, 7:11 PM Rita Zerrizuela ***@***.***> wrote:
Hi @MysticMedia <https://github.com/MysticMedia>, an internet connection
is required to log in. Once the user is logged in, you can store the
credentials in your app and then on launch use the expiration timestamp to
check if they're still valid. If the credentials are still valid, then you
don't need to perform login again. This step does not require an internet
connection.
Once the credentials expire, you can use the refresh token (use the
offline_access scope to get one) to get new credentials and keep the user
logged in.
Please check out the Auth0.swift User Sessions QuickStart
<https://auth0.com/docs/quickstart/native/ios-swift/03-user-sessions> to
learn more. Does that help?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#650 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABLMHUMLF2AAHSSMO2F4KODS4IKMRANCNFSM4WXCEAEQ>
.
|
Here is some additional info. After checking token expiry with function "credentialsManager.hasValid()", we are fetching current user's credentials using SDK's function credentialsManager.credentials { error, credentials in in this function it tries to connect to Internet and goes into loop. |
@MysticMedia can you provide a video of the loop you're talking about? If the SDK can't reach Auth0's servers, then the data task should fail with an error. Also, the request will only take place if the credentials have expired. What is your use case for wanting expired credentials? |
Closing due to inactivity. |
Hi,
We are using Auth0 iOS Siwft SDK into our app. Our app needs to authenticate user in both situation with and without internet connection. Everything is working fine however we are running into issue at offline authentication when device is connected to WiFi but there is no active internet connection. At that time Auth0 SDK keeps trying to connect to internet with no luck and not switching to offline auth method preventing user to proceed further.
Reproduction
Detail the steps taken to reproduce this error, and whether this issue can be reproduced consistently or if it is intermittent.
Version of
Lock.swift
used:Version of iOS:
Version of Xcode:
The text was updated successfully, but these errors were encountered: