Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Service Security: the Local Construction method of CAS Service

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Open the following link in the browser:

Https://github.com/apereo/cas-overlay-template/tree/5.3

Download or checkout the corresponding version of the code from this code repository and change to the home directory of the code.

It is assumed that the domain name used by the CAS service is cas.xxx.com and the application service domain name is app.xxx.com.

First generate the SSL certificate using the following command:

Sudo. / build.sh gencert

Edit the / etc/hosts file and add the following to the file:

127.0.0.1 app.xxx.com

127.0.0.1 cas.xxx.com

Edit the configuration file etc/cas/config/cas.properties under the cas-overlay-template program directory as follows:

Cas.server.name: https://cas.xxx.com:8443

Cas.server.prefix: https://cas.xxx.com:8443/cas

Cas.serviceRegistry.initFromJson=true

Cas.serviceRegistry.json.location=file:/etc/cas/config/services

Cas.adminPagesSecurity.ip=

Cas.adminPagesSecurity.users= file://etc/cas/config/adminusers.properties

Cas.adminPagesSecurity.adminRoles [0] = ROLE_ADMIN

Logging.config: file:/etc/cas/config/log4j2.xml

Edit the etc/cas/config/adminusers.properties as follows:

Casuser=Mellon,ROLE_ADMIN

Edit the services/ExampleApplication-100.json, authorize and configure the application service, as follows:

{

"@ class": "org.apereo.cas.services.RegexRegisteredService"

"serviceId": "http://app\\.xxx\\.com.*","

"name": "ExampleApplication"

"id":

"evaluationOrder": 1

}

Execute the configuration copy command in the working directory:

Sudo. / build.sh copy

After execution, all configurations of etc/cas/config in the program directory will be copied to the / etc/cas/config directory.

Execute the following command to build and package:

Sudo. / build.sh package

Execute the following command to start the service:

Sudo. / build.sh run

Open the following link in your browser:

Https://cas.xxx.com:8443/cas

You can see the following interface:

Enter the user name and password configured by etc/cas/config/adminusers.properties in the user name and password input boxes, respectively:

User name: casuser, password: Mellon

If you see the following interface, the authentication of the user is successful:

You can log out of the user login with the following link address:

Https://cas.xxx.com:8443/cas/logout

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report