Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Service Security: the Local Construction method of CAS Service

Shulou Source: shulou.com Published: 2022-06-01 05:54:21 10月04日 Update

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

Tags: Directory configuration service command user code password file link application service browser user name interface program application browsing input success warehouse content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information vpn Shulou Technology Redmi Microsoft