Home  >  Article  >  Java  >  How to build CAS Client based on springboot

How to build CAS Client based on springboot

WBOY
WBOYforward
2023-05-14 10:46:141300browse

1. Create a new springboot project and introduce dependencies

  org.jasig.cas.client  cas-client-support-springboot  3.6.2

2. Configure the @EnableCasClient annotation

package com.codetiler.demo;import org.jasig.cas.client.boot.configuration.EnableCasClient;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplication@EnableCasClientpublic class Application {    public static void main(String[] args) {        SpringApplication.run(Application.class, args);    }}

3. Configure the application.properties file

server.port=8081#cas服务端配置cas.server-url-prefix=http://cas.codetiler.org:8443/cascas.server-login-url=http://cas.codetiler.org:8443/cas/login#cas客户端配置cas.client-host-url=http://demo.codetiler.org:8081cas.validation-type=CAS3

4. In the browser Enter the address of the authentication server http://cas.codetiler.org:8443/cas and log in. Enter the address of the application again in the browser http://demo.codetiler.org:8081. The browser directly requests it. No need. Log in again.

The above is the detailed content of How to build CAS Client based on springboot. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete