2017-02-08 11 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의 빈에 attributeRepository에 대한 참조를 넣어.

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

그런 다음 내 특성이 나타납니다. Deo gratias!