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

How to build CAS Client based on springboot

WBOY
Release: 2023-05-14 10:46:14
forward
1462 people have browsed it

1. Create a new springboot project and introduce dependencies

<dependency>  <groupId>org.jasig.cas.client</groupId>  <artifactId>cas-client-support-springboot</artifactId>  <version>3.6.2</version></dependency>
Copy after login

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);    }}
Copy after login

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
Copy after login

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template