Backand.signup() - “Create My App User” failed to perform

末鹿安然 提交于 2019-12-01 06:35:06

Based on the server side error that returned from the "Create My App User" action, this is a security issue.

The Action leverage the front-end user permission and, in this case, it requires that Anonymus access will be able to update the users object.

The error started after you turned off the anonymous switch or changed it to read-only.

The solution is to use Admin's permission in the server side action. To add the Admin permission you can use the basic auth Authorization header.

Change the headers code to be this line:

headers:{'Authorization':'basic ' + btoa (username + ':'+ password) }

So the new code in the "Create My App User" Action should look like this:

var response = $http({ method: "POST", url:CONSTS.apiUrl + "/1/objects/users", params: {parameters: {"sync": true}}, data: parameters, headers:{'Authorization':'basic ' + btoa (username + ':'+ password) } });

The username is the app master token (Securit & Auth /social &keys).

The password is the Admin user key (Team / key Icon near the username)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!