As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
Invalid credentials (401) - Further requests denied
S
Sebastian Kruschwitz
started a topic
over 6 years ago
SDK: 3.3.8
During my development I got the following error, when trying to pull or find data from collections:
Invalid credentials. Please retry your request with correct credentials
I found one way to reproduce this error (and now I'm stuck):
In the backend:
Clear the User collection
Import a backup json into the User collection
=> Every request is denied with the error message.
Currently I'm stuck: Deleting & installing the App again seems not to solve this problem. Login with existing users is not possible anymore (same error). I must register/signup a new user.
Programmatically calling "Kinvey.sharedClient.activeUser?.logout()" is not solving the problem and I get the same error message, even when I recreate a new autogenerated user.
I know, clearing the user collection is not usual, but: Are there other collection related tasks that can cause the "Invalid credentials" error?
What is causing this "401 unauthorized" error? Is the SDK saving any session token in the keychain that are not valid anymore (and can not be deleted/recreated)?
How to solve this problem in the App? What do I have to do (in code) to handle this error?
Best Answer
S
Sebastian Kruschwitz
said
over 6 years ago
"logout()" seems to work. My current solution:
if error.httpResponse?.statusCode == 401 {
Kinvey.sharedClient.activeUser?.logout()
setupAutogeneratedUser()
}
func setupAutogeneratedUser() {
if Kinvey.sharedClient.activeUser == nil {
User.signup { user, error in
}
}
1 Comment
S
Sebastian Kruschwitz
said
over 6 years ago
Answer
"logout()" seems to work. My current solution:
if error.httpResponse?.statusCode == 401 {
Kinvey.sharedClient.activeUser?.logout()
setupAutogeneratedUser()
}
func setupAutogeneratedUser() {
if Kinvey.sharedClient.activeUser == nil {
User.signup { user, error in
}
}
Sebastian Kruschwitz
SDK: 3.3.8
During my development I got the following error, when trying to pull or find data from collections:
Invalid credentials. Please retry your request with correct credentials
I found one way to reproduce this error (and now I'm stuck):
In the backend:
Programmatically calling "Kinvey.sharedClient.activeUser?.logout()" is not solving the problem and I get the same error message, even when I recreate a new autogenerated user.
"logout()" seems to work. My current solution:
Sebastian Kruschwitz
"logout()" seems to work. My current solution:
-
Why do I get "Undefined symbols" errors when building with KinveyKit?
-
How do I register push tokens?
-
When using social login, to perform a log-out, do I need to log out of the social network, Kinvey, o
-
How can I assign additional properties to users?
-
Does KinveyKit support 64-bit ARM devices, such as iPhone 5s?
-
Authorization Token Invalid or Expired
-
BOOL and how it is stored in the database.
-
Offline saving throwing errors
-
Custom endpoint not able to form request object
-
Security through business logic
See all 437 topics