2016-06-17 23 views
0

実装SSO:Idp- OpenAM、SP-Redmineの(Ominiauth SAMLプラグイン)SSO:redmine ominiauth SAMLプラグインのグループをSAML responeからどのように取得するのですか? Redmineのため

私はredmine_ominiauth_samlプラグインでユーザに割り当てられているグループのリストを取得したいが、私はSAMLに最初に1つだけのグループを取得することができますグループアサーションでの応答。

  • グループ= isMemberOf
  • LAST_NAME = SN
  • ユーザ名=メール
  • :OpenAMのSPの属性の

    マッピング:

    だから、配列属性のための任意の異なる構成がありますfirst_name = givenName

  • email = mail
  • Redmineの上の属性の0

マッピング:

<saml:AttributeStatement> 
         <saml:Attribute Name="first_name"> 
           <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:type="xs:string" 
                >umesh</saml:AttributeValue> 
         </saml:Attribute> 
         <saml:Attribute Name="username"> 
           <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:type="xs:string" 
                >[email protected]</saml:AttributeValue> 
         </saml:Attribute> 
         <saml:Attribute Name="email"> 
           <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:type="xs:string" 
                >[email protected]</saml:AttributeValue> 
         </saml:Attribute> 
         <saml:Attribute Name="last_name"> 
           <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:type="xs:string" 
                >rajani</saml:AttributeValue> 
         </saml:Attribute> 
         <saml:Attribute Name="groups"> 
           <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:type="xs:string" 
                >cn=ABC,ou=groups,dc=abc,dc=opendj,dc=com</saml:AttributeValue> 
           <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:type="xs:string" 
                >cn=XYZ,ou=groups,dc=abc,dc=opendj,dc=com</saml:AttributeValue> 
           <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:type="xs:string" 
                >cn=YZQ,ou=groups,dc=abc,dc=opendj,dc=com</saml:AttributeValue> 
         </saml:Attribute> 
       </saml:AttributeStatement> 
: "/opt/redmine/config/initializers/saml_3.0.rb"

:attribute_mapping    => { 
    # How will we map attributes from SSO to redmine attribute 
     :login  => 'extra.raw_info.username', 
     :firstname => 'extra.raw_info.first_name', 
     :lastname => 'extra.raw_info.last_name', 
     :mail  => 'extra.raw_info.email', 
     :isMemberOf => 'extra.raw_info.groups' 
    } 

SAML応答は、このような配列内の属性グループが含まれています /opt/redmine/plugins/redmine_omniauth_saml/lib/redmine_omniauth_saml.rb

私はSAMLプラグインで、このコードは私の単一のグループを与える(ルビーのコードを)知っていました

答えて

1

実際には、ruby-samlプラグインは単一の値として属性としてデフォルトの再実行されます。

ruby​​-samlプラグインで複数値を設定する必要があります。

ruby​​-samlプラグインにはattributes.rbファイルがあります。

更新single_value_compatibility @@の値と今、あなたは価値の完全な配列を取得している「偽」

として設定します。

問題が解決します。

+0

本当にありがとうございます! –

関連する問題