2017-09-26 14 views
0

私はWSO2 Identity Manager(5.3)内部LDAPとWSO2 APIマネージャ(2.1)を統合する必要があります。ポリシー資格WS02のXACML WS02 APIマネージャを持つIdentity Server

以下のコードのコメントを解除して、wso2-api-2.1 \ repository \ conf \ user-mgt.xmlのLDAP設定のコメントを解除して変更を行いました。

<UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager"> 
and commented the below. 
<UserStoreManager class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager"> 

私は、以下のように、XACMLを使用した役割ベースのアクセス制御のWSO2ドキュメントに記載されているすべての手順を実行しました。 https://docs.wso2.com/display/AM210/Enabling+Role-Based+Access+Control+Using+XACML

「schooladmin」という役割と「testuser」というユーザーを作成しました。認可されたすべてのパーミッションと共に、アイデンティティ・サーバーの 'testuser'にrole'schooladmin 'を割り当てました。

私はWSO2アイデンティティストアでPDPをテストすることができ、正常に動作します。

問題:アイデンティティサーバーおよびAPIマネージャーとして

  1. がLDAPを介して接続されている、私は、PDPは、APIマネージャで利用可能なアイデンティティ・サーバーで開発を見ることができません。これは正しい動作ですか?

  2. 私は、WSO2のドキュメントに記載されているように、ビジネスサービスとしてREST APIベースを作成して配備し、設定時に資格を追加しました。私はポストマンで新たに開発されたREST APIにしようとしていた場合

      <sequence xmlns="http://ws.apache.org/ns/synapse" name="newEntitlementMediator"> 
           <entitlementService xmlns="http://ws.apache.org/ns/synapse" remoteServiceUrl="https://localhost:9443/services" remoteServiceUserName="admin" remoteServicePassword="admin" 
           callbackClass="org.wso2.sample.handlers.entitlement.APIEntitlementCallbackHandler"/> 
           </sequence> 
    

、私はいつも、以下のエラーを取得しています。提供下記のサービスを使用してテスト、私は正しいユーザーに新しいトークンを作成しています「testuserを」の

<am:fault xmlns:am="http://wso2.org/apimanager"> 
    <am:code>0</am:code> 
    <am:type>Status report</am:type> 
    <am:message>Runtime Error</am:message> 
    <am:description>User is not authorized to perform the action</am:description> 
</am:fault> 

からhttps://localhost:8244/token

が何らかの制限があるか、私は任意の構成を逃した場合はお勧めしてください。

WSO2 ISサーバーで作成されたポリシーを資格として追加しています。 ご確認ください。

<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="iib_policy_entitlement" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-unless-permit" Version="1.0"> 
    <Target/> 
    <Rule Effect="Permit" RuleId="iib_test_rule"> 
     <Target> 
     <AnyOf> 
      <AllOf> 
       <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> 
        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">/login/v1</AttributeValue> 
        <AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/> 
       </Match> 
       <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> 
        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">POST</AttributeValue> 
        <AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/> 
       </Match> 
      </AllOf> 
     </AnyOf> 
     </Target> 
     <Condition> 
     <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of"> 
      <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"> 
       <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">iib_role</AttributeValue> 
      </Apply> 
      <AttributeDesignator AttributeId="http://wso2.org/claims/role" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/> 
     </Apply> 
     </Condition> 
    </Rule> 
</Policy> 

おかげで、 アビシェーク質問1について

答えて

0

回答:はい、LDAPのみユーザストアとして使用されています。メタデータは別のDBに格納されます。メタデータを共有する必要がある場合は、メタデータDBも共有します。そのために/repository/conf/datasourses/master-datasourses.xmlを変更してください。

質問2の回答:直接この質問に答えることはできませんが、確認する点はいくつかあります。

  • 作成したユーザーとロールがAPIマネージャ側から見えるかどうかを確認してください。
  • ISをAPIMのキーマネージャーとして機能させますか?もしそうなら、この文書をチェックしてください。 IS as a Key Manager
+0

ISで作成されたユーザーと役割がAPIMに反映されています。問題は、XACMLを使用して役割ベースの認証を行うためにISで作成されたPDPに接続するために上記の資格を付与する場合です。ユーザーがアクションを実行する権限を持っていないため、エラーが表示され、エラーが表示されます。ここで欠けている構成は何か分かりません。私はリファレンスドキュメントに記載されているすべての手順に従った。 https://docs.wso2.com/display/AM210/Enabling+Role-Based+Access+Control+Using+XACML – AbhishekM

関連する問題