2017-02-08 5 views
0

hereのようにSAML 1.1経由で属性を解放するようにJASIG CAS 3.5サーバーを設定しようとしています。不幸なことに、私はそれをテストアプリケーションにリリースするようには思わない。SAML 1.1を使用してJASIG CAS 3.5から属性を配信できません。

CASサーバー設定

私は、デフォルトの設定(DeployerConfigContext.xml)に表示されますStubPersonAttributeDaoを使用して開始。 JDBC版をセットアップしようとしたあと、結果が改善されませんでした。

<bean id="attributeRepository" 
     class="org.jasig.services.persondir.support.StubPersonAttributeDao"> 
     <property name="backingMap"> 
       <map> 
         <entry key="uid" value="uid" /> 
         <entry key="eduPersonAffiliation" value="eduPersonAffiliation" /> 
         <entry key="groupMembership" value="groupMembership" /> 
       </map> 
     </property> 
</bean> 

私のテストアプリケーションにCASの使用が許可され、属性が許可されていることを確認しました。

<bean 
     id="serviceRegistryDao" 
     class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl"> 
    <property name="registeredServices"> 
     <list> 
      <!-- MIS Developers --> 
      <bean class="org.jasig.cas.services.RegexRegisteredService"> 
       <property name="id" value="6" /> 
       <property name="name" value="Grails run-app" /> 
       <property name="description" value="JCC Developers can use this from any PC within the jccadmin domain." /> 
       <property name="serviceId" value="http://.*.my.domain:8080/.*" /> 
       <property name="evaluationOrder" value="6" /> 
       <property name="allowedAttributes"> 
        <list> 
        <value>uid</value> 
        <value>eduPersonAffiliation</value> 
        <value>groupMembership</value> 
        </list> 
       </property> 
      </bean> 
     </list> 
    </property> 
</bean> 

属性は、CASサービスアプリケーションで表示されるときに強調表示されます。

私の属性は、実際に働いていたかどうかを知るためにテスト

は、私がJASIGのウェブサイトにsample codeに肉を与えることのGradleと桟橋のプラグインを使用してCAS testing applicationを作成しました。私のアプリケーションはサーバーに対して認証を行い、SAML 1.1要求を出して属性を取得します。

私は正しいSAML要求を行っていることを確認しました。

https://my.test.server/cas/samlValidate?TARGET=http%3A%2F%2Fmy.local.machine%3A8080%2Fcas_tester%2F

それは私のCASサーバーから次の応答を受け取ります。

<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> 
    <SOAP-ENV:Header/> 
    <SOAP-ENV:Body> 
    <Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol" 
       xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" 
       xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" 
       xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       IssueInstant="2017-02-01T14:40:35.328Z" 
       MajorVersion="1" 
       MinorVersion="1" 
       Recipient="http://my.local.machine:8080/cas_tester/" 
       ResponseID="_a0df351b1081dafe599829f406be79f5"> 
     <Status> 
     <StatusCode Value="samlp:Success"> 
     </StatusCode> 
     </Status> 
     <Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion" 
       AssertionID="_988118abbd06485ab7f1eb684639ce38" 
       IssueInstant="2017-02-01T14:40:35.328Z" 
       Issuer="localhost" 
       MajorVersion="1" 
       MinorVersion="1"> 
     <Conditions NotBefore="2017-02-01T14:40:35.328Z" 
        NotOnOrAfter="2017-02-01T14:41:05.328Z"> 
      <AudienceRestrictionCondition> 
      <Audience>http://my.local.machine:8080/cas_tester/</Audience> 
      </AudienceRestrictionCondition> 
     </Conditions> 
     <AuthenticationStatement AuthenticationInstant="2017-02-01T14:40:34.312Z" 
           AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified"> 
      <Subject> 
      <NameIdentifier>coleew01</NameIdentifier> 
      <SubjectConfirmation> 
       <ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:artifact</ConfirmationMethod> 
      </SubjectConfirmation> 
      </Subject> 
     </AuthenticationStatement> 
     </Assertion> 
    </Response> 
    </SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

どんなに私が何をすべきか、それが応答した任意の属性を表示しません。私は間違って何をしていますか?

ご協力いただきありがとうございます。

答えて

0

この問題は、属性の設定からはほど遠いことがわかりました。私のcredentialsToPrincipalResolvers beanには、属性リゾルバへの参照がありませんでした。

<property name="credentialsToPrincipalResolvers"> 
     <list> 
       <!-- 
         | UsernamePasswordCredentialsToPrincipalResolver supports the UsernamePasswordCredentials that we use for /login 
         | by default and produces SimplePrincipal instances conveying the username from the credentials. 
         | 
         | If you've changed your LoginFormAction to use credentials other than UsernamePasswordCredentials then you will also 
         | need to change this bean declaration (or add additional declarations) to declare a CredentialsToPrincipalResolver that supports the 
         | Credentials you are using. 
         +--> 
       <bean 
         class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver"/> 
       <!-- 
         | HttpBasedServiceCredentialsToPrincipalResolver supports HttpBasedCredentials. It supports the CAS 2.0 approach of 
         | authenticating services by SSL callback, extracting the callback URL from the Credentials and representing it as a 
         | SimpleService identified by that callback URL. 
         | 
         | If you are representing services by something more or other than an HTTPS URL whereat they are able to 
         | receive a proxy callback, you will need to change this bean declaration (or add additional declarations). 
         +--> 
       <bean 
         class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver" /> 
     </list> 
</property> 

私はUsernamePasswordCredentialsToPrincipalResolverためのBeanにattributeRepositoryへの参照を置きます。

<bean 
     class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver" > 
    <property name="attributeRepository"> 
     <ref bean="attributeRepository"/> 
    </property> 
</bean> 

次に、私の属性が入りました。 Deo gratias!

関連する問題