Start a new topic

Authorization Token Invalid or Expired


I am using an auto generated user in our app and recently started seeing this error. The error returned is Authorization Token Inavlid or Expired. Is there something I need to do on app launch to revalidate the user? I am checking the active user if it is nil I am creating a new as discussed in your docs. What can I do to fix this error/prevent it during release?


Which commands return this error? Can you share a code example of how you create the user?
I have this in may app did finish launching

if ([KCSUser activeUser] == nil) {

[KCSUser createAutogeneratedUser:^(KCSUser *user, NSError *errorOrNil, KCSUserActionResult result)


The error is being returned when trying to fetch a datastore. I was under the impression that all the login details for the autogenerated user is stored in the keychain and when I access the active user it will login with those credentials. I call the datastore on the other side of this statement only if the active user is not nil. So theoretically all the tokens should be refreshed at that point?
If the activeUser is non-nil that means there are stored credentials, but that does not mean that those credentials are necessarily valid. If they have been updated outside the app, the user has to logout and back in.
It is an autogenerated user the only place the credentials would change from would be the app correct? How do you log back in an auto generated user?
I have also tried calling initAndActivateWithSavedCredentials and still doesn't work.
Login or Signup to post a comment