有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java禁用REST安全性和身份验证Websphere Commerce

我想访问订阅的其余部分

比如,

/store/{storeId}/subscription?q=byBuyerIdAndSubscriptionType

参考:https://www-01.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.starterstores.doc/code/rsm_subscription_fep8.htm?lang=en

但是,如果我在其他用户登录时显式地将订阅购买者的member_id传递给REST调用,它会给我身份验证错误,并且不会返回任何内容

User 2581 does not have the authority to perform action "Display" on resource "com.ibm.commerce.subscription.facade.server.authorization.SubscriptionTypeProtectableProxy" for command "Display".

我应该如何绕过此身份验证并获得所需的数据


共 (2) 个答案

  1. # 1 楼答案

    你不应该因为显而易见的原因

    您不应允许访问其他用户的订阅数据。如果您试图实现的是允许特定用户访问其他用户的数据(例如CSR),那么您需要通过访问控制策略和适当的用户角色来解决这个问题

  2. # 2 楼答案

    你可以试着在你的wc rest security中给出这句话。xml文件

    <partialAuthentication resource="store/{storeId}/" method="GET" enabled="false"/>
    

    你也可以具体一点,提一提

    store/{storeId}/subscription
    

    而不是

    store/{storeId}/
    

    我还没有验证上面的内容,但我很确定解决问题的方法在于配置wc rest安全性。xml文件。链接到IBM文档:https://www-01.ibm.com/support/knowledgecenter/SSZLC2_8.0.0/com.ibm.commerce.webservices.doc/tasks/twvrestpartialauth.htm