请帮助这方面,我已经奋斗了一个多星期,现在解决这一个,但是,没有成功。我已尝试过所有可能的改变。
我在catalina.out中获取的日志:
2017-09-19 09:45:20,094 WARN [org.jasig.cas.CentralAuthenticationServiceImpl] - <ServiceManagement: Unauthorized Service Access. Service [http://hidden1:9001/ssomanager/c/SSB] not found in Service Registry.>
2017-09-19 09:45:20,094 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: CASAdmin
WHAT: http://hidden:9001/ssomanager/c/SSB
ACTION: SERVICE_TICKET_NOT_CREATED
APPLICATION: CAS
WHEN: Tue Sep 19 09:45:20 AST 2017
CLIENT IP ADDRESS: <abc>
SERVER IP ADDRESS: <pqr>
=============================================================
在前端,我收到以下错误:
Application Not Authorized to Use CAS
The application you attempted to authenticate to is not authorized to use CAS.
cas.properties文件:
server.prefix=https://hidden1:8443/cas
cas.securityContext.serviceProperties.service=${server.prefix}/services/j_acegi_cas_security_check
# Names of roles allowed to access the CAS service manager
cas.securityContext.serviceProperties.adminRoles=ROLE_ADMIN
cas.securityContext.casProcessingFilterEntryPoint.loginUrl=${server.prefix}/login
cas.securityContext.ticketValidator.casServerUrlPrefix=${server.prefix}
cas.themeResolver.defaultThemeName=cas-theme-default
cas.viewResolver.basename=default_views
host.name=hidden1
#database.hibernate.dialect=org.hibernate.dialect.OracleDialect
#database.hibernate.dialect=org.hibernate.dialect.MySQLDialect
database.hibernate.dialect=org.hibernate.dialect.HSQLDialect
deployerConfigContext.xml有这些条目来打开应用程序,但是,它还没有通过:
<bean class="org.jasig.cas.services.RegisteredServiceImpl">
<property name="id" value="2" />
<property name="name" value="SSO Manager" />
<property name="description" value="CAS Client for SSB/INB" />
<property name="serviceId" value="http://hidden:9001/ssomanager/c/**" />
<property name="allowedAttributes">
<list>
<value>uid</value>
<value>UDC_IDENTIFIER</value>
</list>
</property>
<property name="evaluationOrder" value="10000002" />
</bean>
<bean class="org.jasig.cas.services.RegisteredServiceImpl">
<property name="id" value="1" />
<property name="name" value="CAS Managed Services" />
<property name="description" value="CAS Managed Services Endpoint" />
<property name="serviceId" value="https://hidden1:8443/cas/services/**" />
<property name="allowedAttributes">
<list>
<value>uid</value>
<value>UDC_IDENTIFIER</value>
</list>
</property>
<property name="evaluationOrder" value="10000001" />
</bean>
文件夹结构:
[tomcat@bancas cas-server-3.4.12.1]$ ls
assembly.xml cas-server-integration-memcached cas-server-support-legacy cas-server-support-x509 modules
cas-server-core cas-server-integration-restlet cas-server-support-openid cas-server-uber-webapp notice.txt
cas-server-documentation cas-server-support-generic cas-server-support-radius cas-server-webapp pom.xml
cas-server-integration-berkeleydb cas-server-support-jdbc cas-server-support-spnego INSTALL.txt tasks.xml
cas-server-integration-jboss cas-server-support-ldap cas-server-support-trusted license.txt
[tomcat@bancas cas-server-3.4.12.1]$
[tomcat@bancas cas-server-3.4.12.1]$ cd cas-server-webapp/
[tomcat@bancas cas-server-webapp]$
[tomcat@bancas cas-server-webapp]$ ls
old_targets pom.xml pom.xml_orig src target
[tomcat@bancas cas-server-webapp]$
无法确定问题所在或者如果我需要提供更多信息,请告诉我们。
尝试使用cas 4.2.0版本并在生成war文件时遇到错误:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[3,46] package org.jasig.cas.authentication.principal does not exist
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[9,36] package org.springframework.mock.web does not exist
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[26,27] method setConfigLocations in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext cannot be applied to given types;
required: java.lang.String[]
found: java.lang.String,java.lang.String,java.lang.String,java.lang.String
reason: actual and formal argument lists differ in length
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[31,50] cannot find symbol
symbol: class MockServletContext
location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[52,15] cannot find symbol
symbol: class PrincipalFactory
location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[53,64] cannot find symbol
symbol: class PrincipalFactory
location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[54,15] cannot find symbol
symbol: class PrincipalFactory
location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[55,64] cannot find symbol
symbol: class PrincipalFactory
location: class org.jasig.cas.WiringTests
[INFO] 8 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.593 s
[INFO] Finished at: 2017-09-24T15:06:20+03:00
[INFO] Final Memory: 13M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project local-cas: Compilation failure: Compilation failure:
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[3,46] package org.jasig.cas.authentication.principal does not exist
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[9,36] package org.springframework.mock.web does not exist
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[26,27] method setConfigLocations in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext cannot be applied to given types;
[ERROR] required: java.lang.String[]
[ERROR] found: java.lang.String,java.lang.String,java.lang.String,java.lang.String
[ERROR] reason: actual and formal argument lists differ in length
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[31,50] cannot find symbol
[ERROR] symbol: class MockServletContext
[ERROR] location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[52,15] cannot find symbol
[ERROR] symbol: class PrincipalFactory
[ERROR] location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[53,64] cannot find symbol
[ERROR] symbol: class PrincipalFactory
[ERROR] location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[54,15] cannot find symbol
[ERROR] symbol: class PrincipalFactory
[ERROR] location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[55,64] cannot find symbol
[ERROR] symbol: class PrincipalFactory
[ERROR] location: class org.jasig.cas.WiringTests
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
提前致谢。
答案 0 :(得分:0)
我的情况是,我在serviceId
之类的json中定义了cas服务器的"^(http)://192.168.0.14.*"
,它的IP不是localhost
。
但是,我将callbackUrl
设置为localhost
:
<bean id="casClient" class="org.pac4j.cas.client.CasClient">
..
<property name="callbackUrl" value="http://localhost:8080/CDS/callback?client_name=client1"/>
</bean>
然后发生此错误。
使用IP地址设置callbackUrl
可以解决我的问题。