skywalking+cas集成实现单点登录

参考上一篇Sentinel集成CAS实现SSO

版本

skywalking8.1

添加cas核心包依赖

报错

Connected to the target VM, address: '127.0.0.1:51902', transport: 'socket'
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/F:/soft/maven/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.9.0/log4j-slf4j-impl-2.9.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/F:/soft/maven/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Exception in thread "main" java.lang.StackOverflowError
	at java.lang.reflect.InvocationTargetException.(InvocationTargetException.java:72)
	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.logging.log4j.util.StackLocator.getCallerClass(StackLocator.java:112)

直接在依赖中exclusion掉

        
            org.jasig.cas.client
            cas-client-core
            3.6.1
        
        
            net.unicon.cas
            cas-client-autoconfig-support
            2.3.0-GA
            
                
                    org.springframework.boot
                    spring-boot-starter-logging
                
                
                    org.slf4j
                    slf4j-log4j12
                
            
        

配置application.yml文件

server:
  port: 8080

cas:
  #cas服务端的地址
  server-url-prefix: http://localhost:8443/cas
  #cas服务端的登录地址
  server-login-url: http://localhost:8443/cas/login
  #当前服务器的地址(客户端)
  client-host-url: http://localhost:8080/
  #Ticket校验器使用Cas30ProxyReceivingTicketValidationFilter
  validation-type: cas3
  use-session: true

编写CasConfig加载单点登录的过滤器

参考Sentinel集成CAS实现SSO

总结

skywalking+cas的集成不难,难在先要把skywalking源码编译成功,祝大家好运。

你可能感兴趣的:(sentinel集成cas,spring,boot)