在Hybris中使用REST调用

在Hybris中使用REST调用,rest,hybris,Rest,Hybris,我已经安装了hybris6.4,我想利用它的安全RESTful访问Hybris所有的platformwebservices模型 为了访问REST API,例如http://localhost:9001/ws410/rest/countries,我需要 我想,我需要了解我需要在标题中提供哪些值: client\u id=…&client\u secret=…&grant\u type=…&username=…&password=…?要进行测试,只需对用户名/密码使用基本身份验证(admin/***

我已经安装了
hybris6.4
,我想利用它的安全
RESTful
访问
Hybris
所有的
platformwebservices
模型

为了访问
REST API
,例如
http://localhost:9001/ws410/rest/countries
,我需要

我想,我需要了解我需要在标题中提供哪些值:
client\u id=…&client\u secret=…&grant\u type=…&username=…&password=…

要进行测试,只需对用户名/密码使用
基本身份验证(
admin/***
)。在中选择带有用户名和密码的基本身份验证(更新请求)


从中查找示例请求。

要进行测试,您只需将
基本身份验证
与用户名/密码一起使用(
admin/***
)。在中选择带有用户名和密码的基本身份验证(更新请求)


从中查找示例请求。

正在使用security-spring.xml中的配置对Web服务进行身份验证

    <oauth:client client-id="client-side" resource-ids="hybris" authorized-grant-types="implicit,client_credentials"
            authorities="ROLE_CLIENT" secret="secret" redirect-uri="http://localhost:9001/rest/oauth2_implicit_callback" />
        <oauth:client client-id="mobile_android" resource-ids="hybris"
            authorized-grant-types="authorization_code,refresh_token,password,client_credentials" authorities="ROLE_CLIENT" secret="secret"
            redirect-uri="http://localhost:9001/rest/oauth2_callback" />
        <oauth:client client-id="trusted_client" resource-ids="hybris"
            authorized-grant-types="authorization_code,refresh_token,password,client_credentials" authorities="ROLE_TRUSTED_CLIENT"
            secret="secret" />


这些是默认情况下可用的不同客户端id和密码。

使用security-spring.xml中的配置对Web服务进行身份验证

    <oauth:client client-id="client-side" resource-ids="hybris" authorized-grant-types="implicit,client_credentials"
            authorities="ROLE_CLIENT" secret="secret" redirect-uri="http://localhost:9001/rest/oauth2_implicit_callback" />
        <oauth:client client-id="mobile_android" resource-ids="hybris"
            authorized-grant-types="authorization_code,refresh_token,password,client_credentials" authorities="ROLE_CLIENT" secret="secret"
            redirect-uri="http://localhost:9001/rest/oauth2_callback" />
        <oauth:client client-id="trusted_client" resource-ids="hybris"
            authorized-grant-types="authorization_code,refresh_token,password,client_credentials" authorities="ROLE_TRUSTED_CLIENT"
            secret="secret" />


这些是默认情况下可用的不同客户端id和密码。

我正在执行GET/rest/oauth/token?客户端id={client_defined}&secret={secret_defined}&grant_type=password&username={customer_name}&password={pass},并收到HMTL响应:
hybris管理控制台|登录。。。			 				   				 ... 
无论我尝试什么REST请求,都会得到相同的HTML响应。知道吗?我正在做GET/rest/oauth/token?client_id={client_defined}&secret={secret_defined}&grant_type=password&username={customer_name}&password={pass}并收到HMTL响应:
hybris管理控制台|登录。。。			 				   				 ... 
无论我尝试什么REST请求,都会得到相同的HTML响应。有什么想法吗?您运行ant extgen选择ycommecerwebservices模板了吗?您运行ant extgen选择ycommecerwebservices模板了吗?