cas认证登陆时报错,求高手指点

java.lang.ClassCastException: org.jasig.cas.client.authentication.AttributePrincipalImpl cannot be cast to org.springframework.security.cas.authentication.CasAuthenticationToken
com.chinamobile.bcop.user.sso.UserInjectFilter.doFilter(UserInjectFilter.java:46)

UserInjectFilter.java:46的代码
CasAuthenticationToken principal = (CasAuthenticationToken) ((HttpServletRequest) httpRequest).getUserPrincipal();

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
cas统一认证报500错误

![图片说明](https://img-ask.csdn.net/upload/201601/13/1452677767_570490.png) cas统一验证的时候报错,请高手指点

单点登录中 客户端登录认证中心后返回资源报错500

返回的链接地址为 http://127.0.0.1:8080/smp/SSO?ticket=ST-521-L7kBzyillGXrZwHkRFV1-egs.itownet.cn 报错为: java.lang.RuntimeException: Unable to create XMLReader at org.jasig.cas.client.util.XmlUtils.getXmlReader(XmlUtils.java:93) at org.jasig.cas.client.util.XmlUtils.getTextForElement(XmlUtils.java:161) at org.jasig.cas.client.validation.Cas20ServiceTicketValidator.parseAuthenticationFailureFromResponse(Cas20ServiceTicketValidator.java:125) at org.jasig.cas.client.validation.Cas20ServiceTicketValidator.parseResponseFromServer(Cas20ServiceTicketValidator.java:81) at org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.java:201) at org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:212) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:164) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:92) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Caused by: org.xml.sax.SAXNotRecognizedException: Feature: http://apache.org/xml/features/nonvalidating/load-external-dtd at org.apache.crimson.parser.XMLReaderImpl.setFeature(XMLReaderImpl.java:213) at org.jasig.cas.client.util.XmlUtils.getXmlReader(XmlUtils.java:90) ... 29 more 相同的配置换了一个项目就访问没有问题,应该是jar包冲突的问题, ![图片说明](https://img-ask.csdn.net/upload/201808/30/1535611299_24654.png) 这是报错的jar包

cas 登陆和用户认证相关问题;

1:小弟现在使用cas做项目, 遇到这样一个问题, 项目A和项目B通过cas 认证管理, 进行单点登陆, 在访问项目A的时候由于两个应用都没有登陆, 然后程序会自动跳转到 cas登陆界面进行登陆, 然后就登陆cas并进入到项目A中, 但是我现在访问项目B的使用, 程序还是又跳转到了 cas 登陆界面进行登陆, 这不符合单点登陆的逻辑, 按理来说应该登陆项目A后, 再进行项目B就不需要登陆cas了 , 请问各位大神有不有解决办法, (目前自己找到的方法是参考:http://denger.iteye.com/blog/809170 这里面的方法) 2:用户认证问题, 现在问题是这样的, 现在我有一个账号A 登陆到了cas, 并做了项目用户映射, 账号A映射到 项目A下的账号是A1, 映射到项目B的账号是A2, 问题就来了, A1 和 A2 的账号名和密码是不一样的, 我在进入项目A怎么能分清 到底是该用A1还是A2去登陆啦; (小弟现在的处理方法是 在做映射的时候标示了 A1和A2 分别是属于那个项目的用户名和密码, 各位大神有不有更好的解决方案啦)

cas 部署在weblogic下面报错,网上各种方法试过都不行,在线等

java.lang.NoSuchMethodError: javax.persistence.Persistence.getPersistenceUtil()Ljavax/persistence/PersistenceUtil; at org.hibernate.validator.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:33) at org.hibernate.validator.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:112) at org.hibernate.validator.engine.resolver.SingleThreadCachedTraversableResolver.isReachable(SingleThreadCachedTraversableResolver.java:47) at org.hibernate.validator.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:764) at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:331) at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:278) at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:260) at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:213) at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:119) at org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:86) at org.springframework.webflow.validation.ValidationHelper.invokeValidatorDefaultValidateMethod(ValidationHelper.java:233) at org.springframework.webflow.validation.ValidationHelper.invokeModelValidator(ValidationHelper.java:185) at org.springframework.webflow.validation.ValidationHelper.validate(ValidationHelper.java:104) at org.springframework.webflow.mvc.view.AbstractMvcView.validate(AbstractMvcView.java:625) at org.springframework.webflow.mvc.view.AbstractMvcView.processUserEvent(AbstractMvcView.java:217) at org.springframework.webflow.engine.ViewState.handleEvent(ViewState.java:248) at org.springframework.webflow.engine.ViewState.resume(ViewState.java:218) at org.springframework.webflow.engine.Flow.resume(Flow.java:545) at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259) at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169) at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody2(SafeDispatcherServlet.java:115) at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody3$advice(SafeDispatcherServlet.java:44) at org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:1) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at com.github.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:63) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

CAS服务端登陆成功,不能返回目标页面

输入网址 http://fighting.com:8080/loginPlatformClient 跳转到https://fighting.com:8443/cas/login?service=http%3A%2F%2Ffighting.com%3A8080%2FloginPlatformClient%2Fj_spring_cas_security_check输入账户和密码登陆成功 却跳转到 http://fighting.com:8080/loginPlatformClient/页面这是为什么? 如果输入网址http://fighting.com:8080/loginPlatformClient/indexUser.jsp 跳转到https://fighting.com:8443/cas/login?service=http%3A%2F%2Ffighting.com%3A8080%2FloginPlatformClient%2Fj_spring_cas_security_check输入用户名 密码后http://fighting.com:8080/loginPlatformClient/这是为什么? 配置如下: <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oauth2="http://www.springframework.org/schema/security/oauth2" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd"> <http auto-config="false" use-expressions="false" entry-point-ref="authEntryPoint" disable-url-rewriting="false"> <intercept-url pattern="/indexAdmin.jsp" access="ROLE_ADMIN" /> <intercept-url pattern="/indexUser.jsp" access="ROLE_USER" /> <intercept-url pattern="/indexSecurity.jsp" access="ROLE_SECURITY" /> <intercept-url pattern="/indexAuditor.jsp" access="ROLE_AUDITOR" /> <intercept-url pattern="/login.jsp" access="IS_AUTHENTICATED_ANONYMOUSLY" /> <!-- 登出配置 --> <logout logout-url="/j_spring_security_logout" logout-success-url="/login.jsp" delete-cookies="JSESSIONID"/> <!-- 登出Cas Server的过滤器 --> <custom-filter ref="requestCasLogoutFilter" before="LOGOUT_FILTER"/> <!-- 登出Spring Security的过滤器 --> <custom-filter ref="casLogoutFilter" before="CAS_FILTER"/> <custom-filter ref="casFilter" position="CAS_FILTER"/> <!-- 添加自己定义的AuthenticationFilter到FilterChain的FORM_LOGIN_FILTER位置 --> <custom-filter ref="authenticationFilter" position="FORM_LOGIN_FILTER"/> </http> <beans:bean id="requestCasLogoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter"> <!-- 指定登出成功后需要跳转的地址,这里指向Cas Server的登出URL,以实现单点登出 --> <beans:constructor-arg value="https://fighting.com:8443/cas/logout"/> <beans:constructor-arg> <beans:bean class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler"/> </beans:constructor-arg> <!-- 该Filter需要处理的地址,默认是Spring Security的默认登出地址“/j_spring_security_logout” --> <beans:property name="filterProcessesUrl" value="/j_spring_cas_security_logout"/> </beans:bean> <beans:bean id="casLogoutFilter" class="org.jasig.cas.client.session.SingleSignOutFilter"/> <beans:bean id="casFilter" class="org.springframework.security.cas.web.CasAuthenticationFilter"> <beans:property name="authenticationManager" ref="authenticationManager" /> </beans:bean> <!-- AuthenticationEntryPoint,引导用户进行登录 --> <beans:bean id="authEntryPoint" class="org.springframework.security.cas.web.CasAuthenticationEntryPoint"> <beans:property name="loginUrl" value="https://fighting.com:8443/cas/login"/><!-- Cas Server的登录地址 --> <beans:property name="serviceProperties" ref="serviceProperties" /><!-- service相关的属性 --> </beans:bean> <!-- 指定service相关信息 --> <beans:bean id="serviceProperties" class="org.springframework.security.cas.ServiceProperties"> <!-- Cas Server认证成功后的跳转地址,这里要跳转到我们的Spring Security应用,之后会由CasAuthenticationFilter处理,默认处理地址为/j_spring_cas_security_check --> <beans:property name="service" value="http://fighting.com:8080/loginPlatformClient/j_spring_cas_security_check" /> <beans:property name="sendRenew" value="false"/> </beans:bean> <!-- 认证过滤器 --> <beans:bean id="authenticationFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter" > <!-- 登录提交处理 --> <beans:property name="filterProcessesUrl" value="/j_spring_security_check"></beans:property> <!-- 登录成功跳转 --> <beans:property name="authenticationSuccessHandler" ref="authenticationDispatcher"></beans:property> <!-- 设置登录失败的网址 --> <beans:property name="authenticationFailureHandler" ref="simpleUrlAuthenticationFailureHandler"></beans:property> <!-- 用户拥有权限 --> <beans:property name="authenticationManager" ref="authenticationManager" /> </beans:bean> <beans:bean id="simpleUrlAuthenticationFailureHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler"> <beans:property name="defaultFailureUrl" value="/login.jsp?error=true"></beans:property> </beans:bean> <authentication-manager alias="authenticationManager"> <!-- 使用自定义的重写的MyUserService类来实现从数据库中读取账户密码和权限,并在提交表单的过程中使用md5进行加密后再发送post请求到j_spring_security_check进行登录验证 --> <authentication-provider user-service-ref="MyUserService"> <password-encoder hash="md5" ref="passwordEncoder"> </password-encoder> </authentication-provider> <authentication-provider ref="casAuthenticationProvider"/> </authentication-manager> <beans:bean id="casAuthenticationProvider" class="org.springframework.security.cas.authentication.CasAuthenticationProvider"> <!-- 通过username来加载UserDetails --> <beans:property name="authenticationUserDetailsService"> <beans:bean class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper"> <!-- 真正加载UserDetails的UserDetailsService实现 --> <beans:constructor-arg ref="userDetailsManager" /> </beans:bean> </beans:property> <beans:property name="serviceProperties" ref="serviceProperties" /> <!-- 配置TicketValidator在登录认证成功后验证ticket --> <beans:property name="ticketValidator"> <beans:bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator"> <!-- Cas Server访问地址的前缀,即根路径--> <beans:constructor-arg index="0" value="https://fighting.com:8443/cas" /> </beans:bean> </beans:property> <beans:property name="key" value="key4CasAuthenticationProvider" /> </beans:bean> <!-- 认证成功的处理类 --> <beans:bean id="authenticationDispatcher" class="com.potevio.serivce.MyAuthenticationSuccessHandler"> <beans:property name="authDispatcherMap"> <beans:ref bean="dispatcherMap"/> </beans:property> </beans:bean> <beans:bean id="dispatcherMap" class="java.util.HashMap"> <beans:constructor-arg> <beans:map> <beans:entry key="ROLE_ADMIN" value="/indexAdmin.jsp"/> <beans:entry key="ROLE_USER" value="/indexUser.jsp"/> <beans:entry key="ROLE_SECURITY" value="/indexSecurity.jsp"/> <beans:entry key="ROLE_AUDITOR" value="/indexAuditor.jsp"/> </beans:map> </beans:constructor-arg> </beans:bean> <beans:bean id="userDetailsManager" class="com.potevio.serivce.UserDetailsManager"/> <beans:bean id="MyUserService" class="com.potevio.serivce.MyUserService"> </beans:bean> <beans:bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.Md5PasswordEncoder"> </beans:bean> <!-- 用于使用eID登录后再登录系统的手动认证过程,读取bean MyUserService,构建 UserDetails --> <!-- <beans:bean id="SpringContextUtil " class="com.potevio.common.utils.SpringContextUtil "> </beans:bean> --> </beans:beans>

单点登录中 客户端登录认证中心后返回资源页报错500

HTTP Status 500 - Unable to create XMLReader type Exception report message Unable to create XMLReader description The server encountered an internal error that prevented it from fulfilling this request. exception java.lang.RuntimeException: Unable to create XMLReader org.jasig.cas.client.util.XmlUtils.getXmlReader(XmlUtils.java:58) org.jasig.cas.client.util.XmlUtils.getTextForElement(XmlUtils.java:130) org.jasig.cas.client.validation.Cas20ServiceTicketValidator.parseResponseFromServer(Cas20ServiceTicketValidator.java:82) org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.java:217) org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:169) org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:116) org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76) root cause org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:230) org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:191) org.jasig.cas.client.util.XmlUtils.getXmlReader(XmlUtils.java:56) org.jasig.cas.client.util.XmlUtils.getTextForElement(XmlUtils.java:130) org.jasig.cas.client.validation.Cas20ServiceTicketValidator.parseResponseFromServer(Cas20ServiceTicketValidator.java:82) org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.java:217) org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:169) org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:116) org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76) root cause java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:82) org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:228) org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:191) org.jasig.cas.client.util.XmlUtils.getXmlReader(XmlUtils.java:56) org.jasig.cas.client.util.XmlUtils.getTextForElement(XmlUtils.java:130) org.jasig.cas.client.validation.Cas20ServiceTicketValidator.parseResponseFromServer(Cas20ServiceTicketValidator.java:82) org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.java:217) org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:169) org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:116) org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76) note The full stack trace of the root cause is available in the Apache Tomcat/8.0.30 logs.

cas 5.3版本连接mysql数据库显示认证失败

配置文件配置如下 ![图片说明](https://img-ask.csdn.net/upload/201912/11/1576032133_982367.png) 报错如下 ![图片说明](https://img-ask.csdn.net/upload/201912/11/1576032179_827174.png)

app访问的接口服务需要cas单点登陆,需要什么写

现在遇到的问题是这样的: 一个app需要服务一个服务端A提供的接口,而服务端对所有的url都有经过CAS过滤器过滤,也就是说要访问服务端A提供的url,必须先登陆cas, app是提供httpclient访问服务端A提供的接口,app的登陆账号是例外一套账号跟服务端A是不一样的,服务端A给该app提供一个通用的账号B来登陆cas,也就是说所有app请求过来都需要通过账号B来登陆cas,然后再访问服务端A的服务, 现在有个思路是这样的,app请求服务时带上账号B的信息,然后在服务端A的cas过滤器前再定义一个新的过滤器C来拦截请求,然后在过滤器C里提供httpclient模拟登陆,登陆后那jsessionid返回给app,app再使用带有该jsessionid的请求来访问服务 遇到的问题:这样带过滤器C模拟登陆后的jsessionid的请求,还是会被转到cas登陆页面, 而如果通过浏览器登陆后 再拿浏览器请求里的jsessionid设置给app请求 确可以访问服务端A提供的服务。请问这是什么回事? 浏览器登陆与httpclient模拟登陆对后台有什么不一样?? 请大侠赐教。。。。。。。。。。。。。。。 急啊 被这问题困扰了好几天了

cas server连接数据库出错

我从官网下载cas-server-4.0.0,发布到tomcat,可以正常跑起来,使用账号casuser/Mellon,现在我修改配置文件deployerConfigContext.xml,换成从数据库读取用户名和密码登录,结果程序启动出现异常,跑不起来了,请问一下是什么原因,应该怎么修改?

配置cas时完成验证调回客户端程序后报错code:500咋回事?

![图片说明](https://img-ask.csdn.net/upload/201507/28/1438074112_305731.jpg)

cas sso 配置了,登录有通过数据库,但是跳转失败

1.生成安全证书: 运行cmd 切换到tomcat的目录下: 输入命令 “ keytool -genkey -alias localhost -keyalg RSA -storepass localhost -keystore D:\sso\tomcat-cas\localhost.keystore -validity 3600 ” //此时会生成别名为abc的abc.keystore 文件。 密码是abc 123 导出证书到key文件夹: 命令“ keytool -export -trustcacerts -alias localhost -file D:\sso\tomcat-cas\localhost.cer -keystore D:\sso\tomcat-cas\localhost.keystore -storepass localhost ”//此时会生成abc.cer文件。 将证书导入到JDK证书信任库: 命令“ keytool -import -trustcacerts -alias localhost -file D:\sso\tomcat-cas\localhost.cer -keystore “%JAVA_HOME%\jre\lib\security\cacerts” -storepass changeit ” 系统询问是否信任此证书,回答"y" --------“changeit” 是JDK证书信任库默认的密钥 我用这些指令生成证书,然后也配置了sso\tomcat-cas/conf/server.xml里面的<Connector port=”8443” protocol=”org.apache.coyote.http11.Http11Protocol” SSLEnabled=”true” maxThreads=”150” scheme=”https” secure=”true” clientAuth=”false” sslProtocol=”TLS” keystoreFile="D:/sso/tomcat-cas/abc.keystore" keystorePass="abc123" /> 这整一个sso文件是从别的电脑拷贝过来的,在那台电脑使用正常,而拷贝过来这台电脑就出现了输入帐号名密码,点击登录,浏览器出现10几秒的加载状态然后直接跳出CAS is Unavailable There was an error trying to complete your request. Please notify your support desk or try again. 的信息,请问一下是怎么回事,能不能帮帮忙

CAS单点登录问题,认证成功如何自动登录

如果有应用AB两个系统,AB本身都有登录页面,访问A系统将被CAS拦截认证, 认证成功跳转到A应用的login.jsp,本人做的是获取刚才登录的用户名密码,自动填充到 login.jsp页面登录成功,那么请问(1)这样做是否正确? 此时再访问应用B则不需要前往认证中心去认证,那么请问(2)在应用A和B分别拥有数据库的时候,应用B要如何才能成功登录?是否需要把AB数据库进行关联,还是通过设置token跳过B的登录?

SpringBootApplication 启动CAS报错 诸位大哥求帮助!

![图片说明](https://img-ask.csdn.net/upload/201903/08/1552014020_310510.png) ![图片说明](https://img-ask.csdn.net/upload/201903/08/1552014031_35144.png) ![图片说明](https://img-ask.csdn.net/upload/201903/08/1552014041_726752.png) ![图片说明](https://img-ask.csdn.net/upload/201903/08/1552014048_345846.png) ![图片说明](https://img-ask.csdn.net/upload/201903/08/1552014056_119799.png) ![图片说明](https://img-ask.csdn.net/upload/201903/08/1552014064_925210.png)

shiro+cas+velocity:单点登录cas退出之后跳转到应用的另一个页面报错,求救!

shiro+cas+velocity:单点登录cas退出之后跳转到应用的另一个页面报错,求救! 报错信息如下: HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalStateException: org.apache.shiro.session.UnknownSessionException: There is no session with id [dda73627-d317-47f1-a1fb-6bc52431fa86] type Exception report message Request processing failed; nested exception is java.lang.IllegalStateException: org.apache.shiro.session.UnknownSessionException: There is no session with id [dda73627-d317-47f1-a1fb-6bc52431fa86] description The server encountered an internal error that prevented it from fulfilling this request. exception org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: org.apache.shiro.session.UnknownSessionException: There is no session with id [dda73627-d317-47f1-a1fb-6bc52431fa86] org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:979) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:75) org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:201) org.e3.security.filter.ReAuthenticationFilter.doFilter(ReAuthenticationFilter.java:144) org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76) org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) root cause java.lang.IllegalStateException: org.apache.shiro.session.UnknownSessionException: There is no session with id [dda73627-d317-47f1-a1fb-6bc52431fa86] org.apache.shiro.web.servlet.ShiroHttpSession.getAttribute(ShiroHttpSession.java:133) org.apache.velocity.tools.view.ServletUtils.getMutex(ServletUtils.java:417) org.apache.velocity.tools.view.ViewToolManager.publishToolboxes(ViewToolManager.java:326) org.apache.velocity.tools.view.ViewToolManager.prepareContext(ViewToolManager.java:261) org.apache.velocity.tools.view.ViewToolManager.createContext(ViewToolManager.java:250) org.e3.base.velocity.VelocityLayoutToolboxView.createVelocityContext(VelocityLayoutToolboxView.java:32) org.springframework.web.servlet.view.velocity.VelocityView.renderMergedTemplateModel(VelocityView.java:288) org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1246) org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1029) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:973) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:75) org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:201) org.e3.security.filter.ReAuthenticationFilter.doFilter(ReAuthenticationFilter.java:144) org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76) org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) root cause org.apache.shiro.session.UnknownSessionException: There is no session with id [dda73627-d317-47f1-a1fb-6bc52431fa86] org.apache.shiro.session.mgt.eis.AbstractSessionDAO.readSession(AbstractSessionDAO.java:170) org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:236) org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:222) org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:118) org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:148) org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupRequiredSession(AbstractNativeSessionManager.java:152) org.apache.shiro.session.mgt.AbstractNativeSessionManager.getAttribute(AbstractNativeSessionManager.java:249) org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:141) org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) org.apache.shiro.web.servlet.ShiroHttpSession.getAttribute(ShiroHttpSession.java:131) org.apache.velocity.tools.view.ServletUtils.getMutex(ServletUtils.java:417) org.apache.velocity.tools.view.ViewToolManager.publishToolboxes(ViewToolManager.java:326) org.apache.velocity.tools.view.ViewToolManager.prepareContext(ViewToolManager.java:261) org.apache.velocity.tools.view.ViewToolManager.createContext(ViewToolManager.java:250) org.e3.base.velocity.VelocityLayoutToolboxView.createVelocityContext(VelocityLayoutToolboxView.java:32) org.springframework.web.servlet.view.velocity.VelocityView.renderMergedTemplateModel(VelocityView.java:288) org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1246) org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1029) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:973) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:75) org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:201) org.e3.security.filter.ReAuthenticationFilter.doFilter(ReAuthenticationFilter.java:144) org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76) org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.70 logs. Apache Tomcat/7.0.70

CAS怎么实现多种登陆方式

目前已经实现了自定义登录和自定义获得登录页面的信息。但是如果要做多种登陆验证要怎么做呢?百度上都是只定义了一种登录方式。配置文件要怎么设置,CAS默认只有一种登录页。这个要怎么处理

CAS 集成restful server 获取ticket报404????

大佬们,我下载的CAS5.2的server开启restful,通过http://localhost:8080/cas/v1/tickets,报404什么原因啊,那个大神有server源码,能发给我吗,万分感谢

CAS单点登录多个认证中心集成

多个单点登录服务器如何集成,现存在两个casServer,客户端任何一个casServer登录都可以认证?两个Server之间的集成怎么实现?

微服务间接口调用返回cas登陆的html

自己写了两个简单微服务一个user一个file。配置好feign后file调用user的接口,返回正常 ![图片说明](https://img-ask.csdn.net/upload/201910/15/1571109771_186172.png) 然后配置cas。cas配置好后,我两个服务确实只要登陆一个另一个就不需要登陆了,这里测试他们各自的接口都是可以的。然后问题来了,我测试之前的服务间调用的接口就崩溃了,返回cas的登陆html ![图片说明](https://img-ask.csdn.net/upload/201910/15/1571109936_502405.png) ![图片说明](https://img-ask.csdn.net/upload/201910/15/1571109953_623796.png) 我尝试过配置了session,cooike,跨域相关的配置,但是问题依然存在,求大佬帮忙看看,我不知道是哪里的问题

cas server4.1.3集群退出的问题

一个Nginx+两个Tomcat组成的cas server集群,cas server主要配置如下: ticketRegistry.xml文件: ``` <bean id="ticketDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" p:driverClass="com.mysql.jdbc.Driver" p:jdbcUrl="jdbc:mysql://localhost:7999/casticket?useUnicode=true&amp;characterEncoding=UTF-8&amp;zeroDateTimeBehavior=convertToNull" p:user="root" p:password="root" p:initialPoolSize="6" p:minPoolSize="6" p:maxPoolSize="20" p:maxIdleTimeExcessConnections="1000" p:checkoutTimeout="2000" p:acquireIncrement="16" p:acquireRetryAttempts="5" p:acquireRetryDelay="2000" p:idleConnectionTestPeriod="30" p:preferredTestQuery="select 1" /> <!-- Ticket Registry --> <!-- <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.DefaultTicketRegistry"/> --> <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry" /> <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/> <util:list id="packagesToScan"> <value>org.jasig.cas.ticket</value> <value>org.jasig.cas.adaptors.jdbc</value> </util:list> <bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" p:generateDdl="true" p:showSql="true" /> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" p:dataSource-ref="ticketDataSource" p:jpaVendorAdapter-ref="jpaVendorAdapter" p:packagesToScan-ref="packagesToScan"> <property name="persistenceUnitName" value="CasPU"/> <property name="jpaProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> </props> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" p:entityManagerFactory-ref="entityManagerFactory" /> <!-- 使用这个报错 --> <!-- <tx:annotation-driven transaction-manager="transactionManager" /> --> <tx:advice id="txRegistryAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="deleteTicket" read-only="false" /> <tx:method name="addTicket" read-only="false" /> <tx:method name="updateTicket" read-only="false" /> <tx:method name="getTicket" read-only="true" /> <tx:method name="getTickets" read-only="true" /> <tx:method name="add*" read-only="false"/> <tx:method name="delete*" read-only="false"/> <tx:method name="save*" read-only="false"/> <tx:method name="update*" read-only="false"/> <tx:method name="get*" read-only="true"/> <tx:method name="grant*" read-only="false"/> <tx:method name="validate*" read-only="true"/> <tx:method name="sessionCount" read-only="true" /> <tx:method name="serviceTicketCount" read-only="true" /> </tx:attributes> </tx:advice> <tx:advice id="txRegistryLockingAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="getOwner" read-only="true" /> <tx:method name="acquire" read-only="false" /> <tx:method name="release" read-only="false" /> </tx:attributes> </tx:advice> <aop:config> <aop:pointcut id="ticketRegistryOperations" expression="execution(* org.jasig.cas.ticket.registry.JpaTicketRegistry.*(..))"/> <aop:pointcut id="ticketRegistryLockingOperations" expression="execution(* org.jasig.cas.ticket.registry.support.JpaLockingStrategy.*(..))"/> <aop:pointcut id="centralAuthenticationServiceOperations" expression="execution(* org.jasig.cas.CentralAuthenticationService.*(..))"/> <aop:advisor advice-ref="txRegistryAdvice" pointcut-ref="ticketRegistryOperations"/> <aop:advisor advice-ref="txRegistryLockingAdvice" pointcut-ref="ticketRegistryLockingOperations"/> <aop:advisor advice-ref="txRegistryAdvice" pointcut-ref="centralAuthenticationServiceOperations"/> </aop:config> <!--Quartz --> <!-- TICKET REGISTRY CLEANER --> <bean id="cleanerLock" class="org.jasig.cas.ticket.registry.support.JpaLockingStrategy" p:uniqueId="${host.name}" p:applicationId="cas-ticket-registry-cleaner" /> <bean id="ticketRegistryCleaner" class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner" c:centralAuthenticationService-ref="centralAuthenticationService" c:ticketRegistry-ref="ticketRegistry" p:lock-ref="cleanerLock"/> <bean id="jobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" p:targetObject-ref="ticketRegistryCleaner" p:targetMethod="clean"/> <bean id="triggerJobDetailTicketRegistryCleaner" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean" p:jobDetail-ref="jobDetailTicketRegistryCleaner" p:startDelay="20000" p:repeatInterval="5000000"/> ``` Nginx.conf配置文件: ``` upstream cas { server 10.0.0.8:8082 weight=1; server 10.0.0.8:8083 weight=1; } server { listen 8080; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { #proxy_redirect off; proxy_set_header Host $host; proxy_set_header Referer $http_referer; proxy_set_header Cookie $http_cookie; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://cas; } ``` 两个tomcat使用memcached-session-manager实现session共享: ``` <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" memcachedNodes="n1:localhost:11211" sticky="false" sessionBackupAsync="false" lockingMode="auto" requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory" /> ``` 客户端SpringMVC项目web.xml文件: ``` <filter> <filter-name>CAS Single Sign Out Filter</filter-name> <filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class> <init-param> <param-name>casServerUrlPrefix</param-name> <param-value>http://h4:8080/cas</param-value> </init-param> </filter> <!-- 该过滤器负责用户的认证工作,必须启用它 --> <filter> <filter-name>CASFilter</filter-name> <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class> <init-param> <param-name>casServerLoginUrl</param-name> <!-- 下面的URL是Cas服务器的登录地址 --> <param-value>http://h4:8080/cas/login</param-value> </init-param> <init-param> <param-name>serverName</param-name> <param-value>http://localhost:8888</param-value> </init-param> </filter> <!-- 该过滤器负责对Ticket的校验工作,必须启用它 --> <filter> <filter-name>CAS Validation Filter</filter-name> <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class> <init-param> <param-name>casServerUrlPrefix</param-name> <!-- 下面的URL是Cas服务器的认证地址 --> <param-value>http://h4:8080/cas</param-value><!-- /login --> </init-param> <init-param> <param-name>serverName</param-name> <param-value>http://localhost:8888</param-value> </init-param> <init-param> <param-name>redirectAfterValidation</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>useSession</param-name> <param-value>true</param-value> </init-param> <!--<init-param>--> <!--<param-name>renew</param-name>--> <!--<param-value>false</param-value>--> <!--</init-param>--> <!--<init-param>--> <!--<param-name>gateway</param-name>--> <!--<param-value>false</param-value>--> <!--</init-param>--> </filter> <filter> <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name> <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class> </filter> <!-- 该过滤器使得开发者可以通过org.jasig.cas.client.util.AssertionHolder来获取用户的登录名。 比如AssertionHolder.getAssertion().getPrincipal().getName()。 --> <filter> <filter-name>CAS Assertion Thread Local Filter</filter-name> <filter-class>org.jasig.cas.client.util.AssertionThreadLocalFilter</filter-class> </filter> <filter> <filter-name>CasForInvokeContextFilter</filter-name> <filter-class>javacommon.filter.LoginFilter</filter-class> </filter> <listener> <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class> </listener> ``` 客户端项目退出时报错: 2016-10-18 10:58:35,558 ERROR [org.springframework.transaction.interceptor.TransactionInterceptor] - Application exception overridden by commit exception INVALID_TICKET at org.jasig.cas.CentralAuthenticationServiceImpl.getTicket(CentralAuthenticationServiceImpl.java:520) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Linux面试题(2020最新版)

文章目录Linux 概述什么是LinuxUnix和Linux有什么区别?什么是 Linux 内核?Linux的基本组件是什么?Linux 的体系结构BASH和DOS之间的基本区别是什么?Linux 开机启动过程?Linux系统缺省的运行级别?Linux 使用的进程间通信方式?Linux 有哪些系统日志文件?Linux系统安装多个桌面环境有帮助吗?什么是交换空间?什么是root帐户什么是LILO?什...

将一个接口响应时间从2s优化到 200ms以内的一个案例

一、背景 在开发联调阶段发现一个接口的响应时间特别长,经常超时,囧… 本文讲讲是如何定位到性能瓶颈以及修改的思路,将该接口从 2 s 左右优化到 200ms 以内 。 二、步骤 2.1 定位 定位性能瓶颈有两个思路,一个是通过工具去监控,一个是通过经验去猜想。 2.1.1 工具监控 就工具而言,推荐使用 arthas ,用到的是 trace 命令 具体安装步骤很简单,大家自行研究。 我的使用步骤是...

学历低,无法胜任工作,大佬告诉你应该怎么做

微信上收到一位读者小涛的留言,大致的意思是自己只有高中学历,经过培训后找到了一份工作,但很难胜任,考虑要不要辞职找一份他能力可以胜任的实习工作。下面是他留言的一部分内容: 二哥,我是 2016 年高中毕业的,考上了大学但没去成,主要是因为当时家里经济条件不太允许。 打工了三年后想学一门技术,就去培训了。培训的学校比较垃圾,现在非常后悔没去正规一点的机构培训。 去年 11 月份来北京找到了一份工...

JVM内存结构和Java内存模型别再傻傻分不清了

JVM内存结构和Java内存模型都是面试的热点问题,名字看感觉都差不多,网上有些博客也都把这两个概念混着用,实际上他们之间差别还是挺大的。 通俗点说,JVM内存结构是与JVM的内部存储结构相关,而Java内存模型是与多线程编程相关,本文针对这两个总是被混用的概念展开讲解。 JVM内存结构 JVM构成 说到JVM内存结构,就不会只是说内存结构的5个分区,而是会延展到整个JVM相关的问题,所以先了解下

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Google 与微软的浏览器之争

浏览器再现“神仙打架”。整理 | 屠敏头图 | CSDN 下载自东方 IC出品 | CSDN(ID:CSDNnews)从 IE 到 Chrome,再从 Chrome 到 Edge,微软与...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

85后蒋凡:28岁实现财务自由、34岁成为阿里万亿电商帝国双掌门,他的人生底层逻辑是什么?...

蒋凡是何许人也? 2017年12月27日,在入职4年时间里,蒋凡开挂般坐上了淘宝总裁位置。 为此,时任阿里CEO张勇在任命书中力赞: 蒋凡加入阿里,始终保持创业者的冲劲,有敏锐的...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

什么时候跳槽,为什么离职,你想好了么?

都是出来打工的,多为自己着想

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

立即提问
相关内容推荐