Backgrounded Swift app returns 'noCredentials'

Using Auth0.swift SDK version 1.37.1…

My iOS app stores user credentials normally using store() and later on in the app’s lifecycle it tries to retrieve them using:

credentials(withScope: nil, minTTL: 0, callback: callback)

I’m using Sentry to track some app metrics and I’m seeing a significant number of events showing the Auth0 SDK returning .noCredentials. At the point this happens, Sentry is telling us that the last app lifecycle breadcrumb is nearly always {​​​​​ state: Background }​​​​​.

Does anyone know of any limitations in the default Auth0 keychain implementation regarding access while the app is backgrounded?

Or any restrictions around keychain access while the phone is locked (which would be odd because A0SimpleKeychain defaults to kSecAttrAccessibleAfterFirstUnlock)?

Going to look at upgrading to v2.0.0 but couldn’t see any relevant fixes in the release notes.


Hey there @norders welcome to the community!

I am not aware of any limitations here - Are you using refresh tokens at all?

We definitely recommend upgrading to v2 if you can - You can find the migration guide here :smile:

Thanks @tyf . Yes we are using refresh tokens, however the refresh token is part of the Credentials object, so it never gets that far, as the app receives a .noCredentials response from Auth0.

Thank you for the explanation. It is clear for me. Exactly what I needed! You just saved me several hours.
MyInsite Login