Backand.signup() - “创建我的应用用户"未能执行 [英] Backand.signup() - "Create My App User" failed to perform

查看:19
本文介绍了Backand.signup() - “创建我的应用用户"未能执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下方式注册新用户:

I'm trying to register a new user using:

Backand.signup(firstName, lastName, username, password, password2);

但我最终得到:

POST https://api.backand.com/1/user/signup 504 (GATEWAY_TIMEOUT)

当我检查日志(日志 > 服务器端异常)时,我注意到这个错误:

When I check the logs (Log > Server Side Exceptions), I notice this error:

An unexpected signup exception occured The following action: 
"Create My App User" failed to perform: The operation has timed out 
The operation has timed out Exception has been thrown by the target 
of an invocation. The operation has timed out

我还没有接触过创建我的应用用户"脚本.

I haven't touched the "Create My App User" script.

安全与身份验证 > 配置 > 公共应用程序:打开并设置为用户.如果出现权限问题,我还打开和关闭了匿名,并在 ReadOnly 和 User 之间切换.

Security & Auth > Configuration > Public App: Turned on and set to User. I've also toggled anonymous on and off and switched between ReadOnly and User in case of a permission issue.

几周前它运行良好,有几次我能够进入 Security &Auth > Registered User's table,但我无法让它在我的应用程序的用户表中创建任何新条目,甚至现在根本无法工作.

It was working just fine a few weeks ago, and a few times I was able to get an entry into the Security & Auth > Registered User's table, but I can't get it to create any new entries in my app's user table or even work at all now.

任何帮助将不胜感激.

推荐答案

基于创建我的应用用户"操作返回的服务器端错误,这是一个安全问题.

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

Action 利用前端用户权限,在这种情况下,它要求 Anonymus 访问能够更新用户对象.

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.

解决方案是在服务器端操作中使用管理员权限.要添加管理员权限,您可以使用基本的 auth Authorization 标头.

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(用户名+':'+密码)}

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

因此创建我的应用用户"操作中的新代码应如下所示:

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

var 响应 = $http({方法:POST",url:CONSTS.apiUrl + "/1/objects/users",参数:{参数:{同步":真}},数据:参数,headers:{'Authorization':'basic' + btoa (username + ':'+ password) }});

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

用户名是应用主令牌(Securit & Auth/social &keys).

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

密码是管理员用户密钥(用户名旁边的团队/密钥图标)

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

这篇关于Backand.signup() - “创建我的应用用户"未能执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆