我想要通过故事情节制作的XAPI内容,我希望将声明发送到WebApp而不是LRS。
使用Laravel开发此WebApp,并应使用电子邮件和密码对用户进行身份验证以使用它。
我为将语句发送到此应用程序所做的:
1。在WebApp中,我创建了使用Post方法的API端点路由。
2.在XAPI包装器中,我将配置中的端点更改为我在WebApp中所做的路由。
const conf = {
"endpoint":"here I added my api endpoint route of the webapp",
"auth":"Basic " + toBase64(""),
}
现在,与应该发送语句的内容进行任何互动,例如在图片中,我认为这是身份验证错误,我该如何将我的身份验证凭据添加到XAPI包装器中?
I have an xAPI content made by storyline I want for the statement to be sent to a webapp instead of the LRS.
this webapp is developped using laravel, and user should be authenticated with email and password to use it.
what I did to send the statement to this app:
1.in the webapp I created an API endpoint route that use POST method.
2.in the xAPI wrapper I changed the endpoint in the configuration to the route I made in the webapp.
const conf = {
"endpoint":"here I added my api endpoint route of the webapp",
"auth":"Basic " + toBase64(""),
}
now whith any interaction with the content where a statement should be sent the request making cors error like in the picture down, I think this is authentication error, how can I add my authentication credentials to the xAPI wrapper?

发布评论
评论(1)
您的非LRS LRS可能没有处理CORS处理所需的飞行前请求。大多数常见的LRS将适当处理这些请求,因为它们希望从其他起源访问。参见
另外,除非您还处理状态请求,否则您可能会遇到问题。
此外,除非您在运行时请求用户的凭据,否则从安全角度来看,将凭据硬编码并不是一个好主意。
Your non-LRS LRS is probably not handling preflight requests which are necessary for CORS handling. Most common LRSs will handle those requests appropriately since they expect to be accessed from additional origins. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#preflighted_requests
Also note that you'll likely run into issues unless you also handle state requests.
Additionally unless you are requesting the credentials from the user during runtime then hard coding the credentials into the package isn't a great idea from a security perspective.