IBM Worklight版本8.0-访问令牌时禁止错误
在访问令牌时收到以下错误:
WLAuthorizationManager.obtainAccessToken()
.then(
function (accessToken) {
console.log(accessToken);
console.log("Connected to MobileFirst Server")
WL.Logger.debug("Connected to MobileFirst Server");
},
function (error) {
console.log(error);
console.log("Failed to connect to MobileFirst Server");
WL.Logger.debug("Failed to connect to MobileFirst Server");
}
);
响应:
errorCode: "403"
errorMsg: "Forbidden"
responseHeaders: {connection: '[Keep-Alive]', content-length: '[199]', content-type: '[text/html; charset=iso-8859-1]', date: '[Thu, 21 Apr 2022 07:29:35 GMT]', keep-alive: '[timeout=120, max=1840]', …}
responseText: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access this resource.</p>\n</body></html>\n"
status: 403
statusText: "Forbidden"
详细信息: IBM Worklight平台版本:'8.0.0.00-20190910-142437'
将不胜感激。谢谢!
Receiving below error while accessing token:
WLAuthorizationManager.obtainAccessToken()
.then(
function (accessToken) {
console.log(accessToken);
console.log("Connected to MobileFirst Server")
WL.Logger.debug("Connected to MobileFirst Server");
},
function (error) {
console.log(error);
console.log("Failed to connect to MobileFirst Server");
WL.Logger.debug("Failed to connect to MobileFirst Server");
}
);
Response:
errorCode: "403"
errorMsg: "Forbidden"
responseHeaders: {connection: '[Keep-Alive]', content-length: '[199]', content-type: '[text/html; charset=iso-8859-1]', date: '[Thu, 21 Apr 2022 07:29:35 GMT]', keep-alive: '[timeout=120, max=1840]', …}
responseText: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access this resource.</p>\n</body></html>\n"
status: 403
statusText: "Forbidden"
Details:
IBM Worklight platform version: '8.0.0.00-20190910-142437'
Any help will be appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在得到HTML响应指示403的事实,并且在替换APK时会发生这种情况,指向可能的网络策略或Web服务器阻止PUT请求的
原因是原因是:
发布http://&lt; host&gt;:&lt; port&gt;/mfp/api/registration/v1/self
,而当a将http://&lt; host&gt;:&lt; port&gt;/mfp/api/registration/v1/v1/v1/self/&lt; clientId&gt;
当更新APK时射击(或覆盖)。另一个远程可能性是,您在服务器中启用了应用程序真实性保护,而在较旧的APK的情况下不起作用。但是,这种情况的机会接近零,因为返回的错误消息可以清楚地表明该问题,并且在新安装的情况下也无法使用。
我建议您验证您的网络策略是否不允许请求请求。
The fact that you are getting an HTML response indicating the 403 and this happens when the apk is replaced, points to a possible network policy or webserver blocking a PUT request to
The reasons why this could be the cause are:
POST http://<host>:<port>/mfp/api/registration/v1/self
, while aPUT http://<host>:<port>/mfp/api/registration/v1/self/<clientid>
fires when the apk is updated (or overwritten).The other remote possibility is, you have application authenticity protection enabled in the server that is not working in case of the older apk. However, the chances of this being the case is near zero, as the error message returned gives a clear indication of the issue and it would not have worked in case of a fresh install too.
I would suggest you verify if your network policy does not allow PUT requests.