2016-07-27 52 views
0

我想我的Tomcat Web服務器上運行樣本travelocity.com和使用WSO2身份服務器作爲身份提供商(IDP)的例子travelocity.com。我部署travelocity.com.war我本地的Tomcat與http://localhost:8080/travelocity.com,它得到了重新定向到WSO2身份服務器https://localhost:9443/samlsso訪問的應用程序,並給了錯誤的無法運行樣本SSO WSO2身份服務器

"SAML 2.0 based Single Sign-On 
    Error when processing the authentication request! 
    Please try login again." 

在當地我catalina.log文件中的錯誤Tomcat是

INFO: Deployment of web application directory C:\Users\258155\Desktop\Tomcat\webapps\SAMLTestTool has finished in 359 ms 
Jul 27, 2016 3:22:39 PM org.apache.coyote.AbstractProtocol start 
INFO: Starting ProtocolHandler ["http-bio-8080"] 
Jul 27, 2016 3:22:39 PM org.apache.coyote.AbstractProtocol start 
INFO: Starting ProtocolHandler ["ajp-bio-8009"] 
Jul 27, 2016 3:22:39 PM org.apache.catalina.startup.Catalina start 
INFO: Server startup in 28075 ms 
Jul 27, 2016 3:36:50 PM org.wso2.sample.is.sso.agent.SSOAgentSampleFilter doFilter 
INFO: SAML2 HTTP Binding not found in request. Defaulting to HTTP-POST 

還沒有做出這得到了與樣本戰爭產生travelocity.properties文件進行任何更改,並且默認的一個

# Copyright (c) WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 
# 
# WSO2 Inc. licenses this file to you under the Apache License, 
# Version 2.0 (the "License"); you may not use this file except 
# in compliance with the License. 
# You may obtain a copy of the License at 
# 
# http://www.apache.org/licenses/LICENSE-2.0 
# 
# Unless required by applicable law or agreed to in writing, 
# software distributed under the License is distributed on an 
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
# KIND, either express or implied. See the License for the 
# specific language governing permissions and limitations 
# under the License. 


EnableSAML2SSOLogin=true 
EnableOpenIDLogin=true 
EnableOAuth2SAML2Grant=false 

#Url to do send SAML2 SSO AuthnRequest 
SAML2SSOURL=samlsso 

#Url to do initiate OAuth2 SAML2 Grant Request 
OAuth2SAML2GrantURL=token 

#Url to initiate OpenID Authentication Request 
OpenIdURL=openid 

#URIs to skip SSOAgentFilter; comma separated values 
SkipURIs=/travelocity.com/index.jsp 

#A unique identifier for this SAML 2.0 Service Provider application 
SAML2.SPEntityId=travelocity.com 

#The URL of the SAML 2.0 Assertion Consumer 
SAML2.AssertionConsumerURL=http://localhost:8080/travelocity.com/home.jsp 

#A unique identifier for this SAML 2.0 Service Provider application 
SAML2.IdPEntityId=localhost 

#The URL of the SAML 2.0 Identity Provider 
SAML2.IdPURL=https://localhost:9443/samlsso 

#Identifier given for the Service Provider for SAML 2.0 attributes 
#exchange 
#SAML2.AttributeConsumingServiceIndex=1701087467 

#Specify if SingleLogout is enabled/disabled 
SAML2.EnableSLO=true 

#This is the URL that is used for SLO 
SAML2.SLOURL=logout 

#Specify if SAMLResponse element is signed 
SAML2.EnableResponseSigning=true 

#Specify if SAMLAssertion element is signed 
SAML2.EnableAssertionSigning=true 

#Specify if SAMLAssertion element is encrypted 
SAML2.EnableAssertionEncryption=false 

#Specify if AuthnRequests and LogoutRequests should be signed 
SAML2.EnableRequestSigning=true 

#Password of the KeyStore for SAML and OpenID 
KeyStorePassword=wso2carbon 

#Alias of the IdP's public certificate 
IdPPublicCertAlias=wso2carbon 

#Alias of the SP's private key 
PrivateKeyAlias=wso2carbon 

#Private key password to retrieve the private key used to sign 
#AuthnRequest and LogoutRequest messages 
PrivateKeyPassword=wso2carbon 

#OAuth2 token endpoint URL 
OAuth2.TokenURL=https://localhost:9443/oauth2/token 

#OAuth2 Client ID 
OAuth2.ClientId=Qn5DQHCYfshxeZh6R9SL1HM2lsMa 

#OAuth2 Client Secret 
OAuth2.ClientSecret=cbkAs1gajdwPAMbrSR54hPAIcz0a 

#OpenId Provider Url 
OpenId.ProviderURL=https://localhost:9443/openid/ 

#openid.return_to parameter 
OpenId.ReturnToURL=http://localhost:8080/travelocity.com/home.jsp 

#Custom SAML post binding request page 
#SAML.PostBinding.RequestPage=path/to/the/html 

#Additional request parameters 
#QueryParams=tenantDomain=-1234 

#SAML2.IsForceAuthn=true 

#Specify whether the consumer requests user attributes from the provider 
OpenId.EnableAttributeExchange=true 

#Specify whether the consumer runs in dumb mode 
OpenId.EnableDumbMode=false 

在WSO2身份服務器的服務提供商的設置是默認的,如要求在文章中

https://docs.wso2.com/display/IS500/Configuring+Single+Sign-On+with+SAML+2.0 

我有兩個問題 (1)什麼是在運行和accesing使用SAML樣品travelocity.com應用拋出錯誤的原因SSO (2)如果我用我已經在運行的Java應用程序WSO2身份服務器(無單點登錄),什麼樣的變化都在我的應用程序結束工作要做,以實現SAML SSO。因爲在這裏我們可以看到有travelocity.properties文件和一些編碼(大約4個文件: - ForwardingServlet.java,SampleAttributesRequestor.java,SampleContextEventListener.java,SSOAgentSampleFilter.java)將第一個請求重定向到標識提供商https://localhost:9443/samlsso 我將做什麼更改必須在我的應用程序結束。

+0

嗨,歡迎來到Stackoverflow!請花一分鐘閱讀本教程更好的問題,對好的和壞的標題特別的例子:stackoverflow.com/help/how-to-ask - 一切看起來很不錯! – Jurik

+0

你有沒有發現這個問題。我也得到同樣的問題。跟隨文檔和博客。 – Sushil

回答

0

請按照WSO2 documentation配置travelocity.com Web應用程序。 首先,您需要登錄到WSO2 IS 5.1.0,然後需要創建travelocity.com Web應用程序在SAML 2.0服務提供商。請參閱鏈接文檔以獲取更多細節。