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"/>
정보에 대해 매우 감사드립니다. 모두에게 감사드립니다.