"error_description":"Subject does not have permission to access this resource"

Not applicable

Hi,

While doing device registration for push notification i am getting this error..

{"error":"unauthorized","timestamp":1470035549951,"duration":0,"error_description":"Subject does not have permission to access this resource","exception":"org.apache.usergrid.rest.exceptions.SecurityException"}

I am using

ApigeeClientResponse *response = [dataClient setDevicePushToken: deviceToken forNotifier: notifier];

Base Url is - https://amer-apibaas-prod.apigee.net/appservices/{org}/{app}/device

Please do let me know how to fix this issue.

Thanks

Solved Solved
0 3 695
1 ACCEPTED SOLUTION

@Partha Sarathi Barik , Welcome to Apigee Community.

Looks like a permission issue for me. Make sure user role has permissions set for /devices or /device collection you are trying to access. You can set permissions to user role by navigating to BaaS UI, Users -> Roles in left side menu navigation bar. See example screenshot below,

3306-screen-shot-2016-08-06-at-24011-pm.png

Also, make sure user trying to access API is also added to above userrole. Keep us posted if any. For more details refer Apigee BaaS Docs.

View solution in original post

3 REPLIES 3

@Partha Sarathi Barik , Welcome to Apigee Community.

Looks like a permission issue for me. Make sure user role has permissions set for /devices or /device collection you are trying to access. You can set permissions to user role by navigating to BaaS UI, Users -> Roles in left side menu navigation bar. See example screenshot below,

3306-screen-shot-2016-08-06-at-24011-pm.png

Also, make sure user trying to access API is also added to above userrole. Keep us posted if any. For more details refer Apigee BaaS Docs.

We are getting same error and we are using Guest Role (no user tagged) just org name and appname to register device. Getting same error even after setting permissions for guest role

We need to enable all permissions in Default role for Push Notifications to work.. Not sure what is going wrong. This is the permissions we have set..

Permissions (?)

PathGETPOSTPUTDELETE
/devicesyesyesyesno
/devices/*yesyesyesno
/notificationsyesyesyesno
/usersyesyesyesno
/users/*yesyesyesno
/**yesyesyesyes