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.
I'm trying to fetch a few items from my collection but I receive an error, "The credentials used to authenticate this request are not authorized to run this operation. Please retry your request with appropriate credentials"
The request:
let dataStore = DataStore<Item>.collection(.network)
dataStore.find { (item, error) in
if let item = item {
//succeed
print("Items: \(item.count)")
} else {
print("ERROR: \(error?.localizedDescription)")
//fail
}
}
Model:
import Kinvey
class Item: Entity {
dynamic var name: String?
override class func collectionName() -> String {
//return the name of the backend collection corresponding to this entity
return "items"
}
override func propertyMapping(_ map: Map) {
super.propertyMapping(map)
name <- ("item_name", map["item_name"])
}
}
The items collection's permission is set to Read Only.
Best Answer
P
Pranav J
said
over 6 years ago
Shae,
So "Item" is the name of your collection. Let me know the username of your 'test' user.
Can you please change collection's permission to different options and try to fetch records again? Let me know if it works.
Are you fetching the same records which were created by your 'test' user (results will depend on what permission is set for the collection)?
Also can you try fetching records from "Item" collection by logging in 'test' user on Kinvey API console. Please check http://devcenter.kinvey.com/rest/guides/datastore#Fetching. Make sure you login using 'test' user, not mastersecret.
So "Item" is the name of your collection. Let me know the username of your 'test' user.
Can you please change collection's permission to different options and try to fetch records again? Let me know if it works.
Are you fetching the same records which were created by your 'test' user (results will depend on what permission is set for the collection)?
Also can you try fetching records from "Item" collection by logging in 'test' user on Kinvey API console. Please check http://devcenter.kinvey.com/rest/guides/datastore#Fetching. Make sure you login using 'test' user, not mastersecret.
Thanks,
Pranav
S
Shae Hazelwood
said
over 6 years ago
Hey Pranav,
I am currently logging in a test user before I make the call to get the collections so there's a user. Seems like it's something I'm missing, even when I take the .network option out of the collection's call it succeeds but return 0 items.
P
Pranav J
said
over 6 years ago
Shae,
At first glance, I think login session has not been established before accessing/ fetching data from the backend. Please login and then try fetching few items from your collection. Please check http://devcenter.kinvey.com/ios/guides/users#login.
Shae Hazelwood
I'm trying to fetch a few items from my collection but I receive an error, "The credentials used to authenticate this request are not authorized to run this operation. Please retry your request with appropriate credentials"
The request:
Model:
The items collection's permission is set to Read Only.
Thanks,
Pranav
- Oldest First
- Popular
- Newest First
Sorted by Newest FirstPranav J
Thanks,
Pranav
Shae Hazelwood
Hey Pranav,
I am currently logging in a test user before I make the call to get the collections so there's a user. Seems like it's something I'm missing, even when I take the .network option out of the collection's call it succeeds but return 0 items.
Pranav J
At first glance, I think login session has not been established before accessing/ fetching data from the backend. Please login and then try fetching few items from your collection. Please check http://devcenter.kinvey.com/ios/guides/users#login.
Good luck, and let me know how it goes.
Thanks,
Pranav
Kinvey
-
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