2014-07-11 4 views
1

OIOSAML을 기반으로 한 SP 시작 웹 SSO 시나리오를 사용하여 간단한 시스템을 작성했습니다. 시스템을 테스트하기 위해 원격 호스트에 배포했습니다.OIOSAML : 서비스 끝점 설정 문제

AssertionConsumerServiceURL 그러나 URL을 지정하면 Shibboleth idP (Shibboleth를 기반으로하는 idP)가 응답을 반환해야합니다.

SAMLAssertionConsumer - 단순한 서블릿이 같은 :로 시작을 위해

@WebServlet("/saml/consumer") 
public class SAMLAssertionConsumer extends HttpServlet { 
    @Override 
    protected void doPost(HttpServletRequest request, HttpServletResponse response) 
      throws ServletException, IOException { 

     System.out.println(new Date() + " incoming AuthResponse"); 
    } 

    @Override 
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 
     response.setContentType("text/html"); 
     PrintWriter out = response.getWriter(); 
     out.println("Yes, it worked"); 

     System.out.println(new Date() + " incoming AuthResponse"); 
    } 
} 

, 방금 응답이 온다 있는지 확인해야합니다.

내 web.xml의 :

<?xml version="1.0" encoding="UTF-8"?> 
<web-app id="WebApp_ID" version="3.0" 
    metadata-complete="false"  
    xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" > 

    <display-name>OIOSAML-J</display-name> 

    <listener> 
     <listener-class>dk.itst.oiosaml.sp.service.session.SessionDestroyListener</listener-class> 
    </listener> 

    <servlet> 
     <servlet-name>SAMLDispatcherServlet</servlet-name> 
     <servlet-class>dk.itst.oiosaml.sp.service.DispatcherServlet</servlet-class> 
     <load-on-startup>1</load-on-startup> 
    </servlet> 

    <servlet-mapping> 
     <servlet-name>SAMLDispatcherServlet</servlet-name> 
     <url-pattern>/saml/*</url-pattern> 
    </servlet-mapping> 

    <filter> 
     <filter-name>LoginFilter</filter-name> 
     <filter-class>dk.itst.oiosaml.sp.service.SPFilter</filter-class> 
    </filter> 

    <filter-mapping> 
     <filter-name>LoginFilter</filter-name> 
     <url-pattern>/sp/*</url-pattern> 
    </filter-mapping> 

    <welcome-file-list> 
     <welcome-file>index.jsp</welcome-file> 
    </welcome-file-list> 

</web-app> 

내 oiosaml-sp.properties :

# Properties used by oiosaml-j 

# Reference to the location of the certificate used for signing SAML documents with - relative to ${oiosaml.home} 
oiosaml-sp.certificate.location=./certificate/keystore 

# Opaque/encrypted password to the certificate used for signing SAML documents 
oiosaml-sp.certificate.password=some_password 

# Required authentication level. 2=password, 3=certificate 
oiosaml-sp.assurancelevel=2 

# Name of the meta data file for the current service provider - overrides setting in brs-common.properties 
common.saml2.metadata.sp.filename=SPMetadata.xml 

# URI References to the current service provider 
oiosaml-sp.uri.home= 

# Whether to validate server certificates. Set to false in production. 
# Used for artifact resolution. 
oiosaml-sp.resolve.ignorecert=true 

# Artifact resolution username and password. Only used the artifact profile is active. 
oiosaml-sp.resolve.username=rolf.trifork.com 
oiosaml-sp.resolve.password=rolf.trifork.com 

AuthnRequest를 생성은 :

<?xml version="1.0" encoding="UTF-8"?> 
<saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" 
        AssertionConsumerServiceURL="http://ip-of-remote-system-here:8080/saml/consumer" 
        Destination="http://ip-of-identity-provider-here/idp/profile/SAML2/Redirect/SSO" ForceAuthn="false" 
        ID="_31e...341d322d1d" IsPassive="false" 
        IssueInstant="2014-07-11T10:24:43.852Z" 
        ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.0"> 
    <saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">http://ip-of-remote-system-here:8080</saml2:Issuer> 
</saml2p:AuthnRequest> 

, 일부 JSP 페이지 private.jsp 있습니다 요청을 :

http://ip-of-identity-provider-here/idp/Authn/CommonLogin 

이 ... 아무것도을 몇 로그인/암호를 입력하지 않고 :

http://ip-of-remote-system-here:8080/sp/private.jsp 
이 요청 후에 나는 ID 공급자의 로그인 페이지로 리디렉션.
http://ip-of-identity-provider-here/idp/Authn/UsernamePasswordLogin 

error

An error occurred while request processing.

가 작동하지 않습니다 내 서블릿 SAMLAssertionConsumer는 콘솔은 분명하다 : 몇 가지 일반적인 오류의 설명과 함께 페이지를 엽니 다. 내가 직접 내 서블릿 SAMLAssertionConsumer에 요청을한다면 :
http://ip-of-remote-system-here:8080/saml/consumer 

그런 다음 그것을 작동합니다. 당연하지.

어서션 소비자 서비스를 올바르게 구성하는 방법을 알고 싶습니다. 이것이 어설 션 소비자를 지정하는 SP 메타 데이터의 일부입니다.

<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:esia="urn:esia:shibboleth:2.0:mdext" entityID="http://ip-of-remote-system-here:8080"> 
... 
<md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="http://ip-of-remote-system-here:8080/saml/consumer" ResponseLocation="http://ip-of-remote-system-here:8080/saml/consumer"/> 
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://ip-of-remote-system-here:8080/saml/consumer" index="0" isDefault="true"/> 

정보에 대해 매우 감사드립니다. 모두에게 감사드립니다.

답변

0

문제가 다릅니다. 키 저장소가 잘못 사용되었습니다. 이제 모든 것이 OK입니다.

처음에는 entityID 속성이 Location 속성에 지정된 도메인 이름을 참조해야한다고 가정했습니다. 그러나 그렇지 않습니다. 단지 고유해야하며 도메인 이름을 사용하는 것이 좋습니다.샌드 박스

Strongly recommended NOT to use the physical hostname of a server running Shibboleth as the entityID . As time passes, things get moved and that deployment may not always live on the same box.

Additionally there may be multiple logical deployments of Shibboleth on a single physical server, each requiring their own unique entityID , so using the server's name doesn't scale beyond a single one.

UnderstandingShibboleth, EntityNaming:

entityID [Required] -

Specifies the unique identifier of the SAML entity whose metadata is 
described by the element's contents. 

Metadata for the OASIS Security Assertion Markup Language (SAML)V2.0, 2.3.2 Element :

Shibboleth identity and service providers are used in SAML deployments, and as such, they are assigned a unique name known as an "entityID".

UnderstandingShibboleth, EntityNaming: 물리 주소를 사용할 수있다.