如何在Moqui中创建可公开访问的REST API [英] How to create a publicly accessible REST API in Moqui

查看:111
本文介绍了如何在Moqui中创建可公开访问的REST API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Moqui中创建可公开访问的REST API的最佳方法是什么?公开的意思是不需要事先身份验证的API.

What is the best way to create a publicly accessible REST API in Moqui? By public I mean an API that does not require prior authentication.

到目前为止,我发现的唯一解决方法是创建一个用户"public_api"并授予他访问所需服务的权限.然后,客户端应用程序使用该用户向Moqui服务器进行身份验证.

The only work around I found so far was to create a user "public_api" and grant him access to the desired services. The client applications then use this user to authenticate with the Moqui server.

推荐答案

moqui-framework commit#44272ba中进行了更新,以支持Service REST API资源,id和method元素上的require-authentication元素.将其设置为anonymous-view或anonymous-all,以允许无需身份验证或授权即可访问REST API服务.这遵循与无需登录即可访问XML屏幕(如POP Commerce电子商务应用程序)所使用的相同模式.

There is now an update in moqui-framework commit #44272ba to support the require-authentication element on the Service REST API resource, id, and method elements. Set this to anonymous-view or anonymous-all to allow access to REST API services without authentication or authorization. This follows the same pattern as is used for XML Screens to be accessible without login (like the POP Commerce ecommerce app).

这篇关于如何在Moqui中创建可公开访问的REST API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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