将XAPI语句发送到Web应用程序而不是LRS

发布于 2025-02-08 22:54:05 字数 612 浏览 2 评论 0 原文

我想要通过故事情节制作的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?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

Oo萌小芽oO 2025-02-15 22:54:05

您的非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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文