JASIG CAS 3 Learning Note 1 -- getting started

本文介绍如何部署和配置CAS单点登录系统,包括CAS服务器和客户端应用的安装步骤、HTTPS连接配置、证书生成及导入过程,以及如何通过修改web.xml启用单点登录功能。

 

Background Information

 

Access Control

 

Access control systems provide the essential services of authorization, identification and authentication, access approval, and accountability:

 

·         authorization specifies what a subject can do

 

·         identification and authentication ensure that only legitimate subjects can log on to a system

 

·         access approval grants access during operations, by association of users with the resources that they are allowed to access, based on the authorization policy

 

·         accountability identifies what a subject (or all subjects associated with a user) did

 

Central Authentication Service (CAS) is a solution for Authentication Service.

 

Single Sign-On

 

Single sign-on (SSO) is a property of access control of multiple related, but independent software systems. With this property a user logs in once and gains access to all systems without being prompted to log in again at each of them. Conversely, single sign-off is the property whereby a single action of signing out terminates access to multiple software systems.

 

To implement a single sign-on system, the following two requirments must be considered:

 

·         An unified authentication service

 

·         Change all the web apps which need SSO service to make sure they use the unified authentication service.

 

Transport Layer Security (TLS) and its predecessor Secure Sockets Layer (SSL)

 

JASIG Central Authentication Service (CAS)

The CAS protocol involves at least three parties: a client web browser, the web application requesting authentication, and the CAS server. It may also involve a back-end service, such as a database server, that does not have its own HTTP interface but communicates with a web application.

When the client visits an application desiring to authenticate to it, the application redirects it to CAS. CAS validates the client's authenticity, usually by checking a username and password against a database (such as Kerberos or Active Directory).

If the authentication succeeds, CAS returns the client to the application, passing along a security ticket. The application then validates the ticket by contacting CAS over a secure connection and providing its own service identifier and the ticket. CAS then gives the application trusted information about whether a particular user has successfully authenticated.

CAS allows multi-tier authentication via proxy address. A cooperating back-end service, like a database or mail server, can participate in CAS, validating the authenticity of users via information it receives from web applications. Thus, a webmail client and a webmail server can all implement CAS.

 

 

Preparation Work

Download CAS server and client

Download CAS server and client from internet:

·         cas-client-3.2.1

·         cas-server-3.5.2

User Keytool to generate keystore file and import certificate file

It includes 3 steps:

·         Delete the certificate and keystore file if they exist

·         Create the .keystore file and export .crt file from keystore

·         Import the created certificate into java trusted certficate repository

Before you run below batch script, you need to make sure:

·         JDK is better not installed in default path: C:\program files\java because “program files” contains a blank character which could cause weird problems.

·         Make sure the same JDK is used by tomcat server in eclipse.

·         JAVA_HOME is set in system environment variable

·         Java bin executables are included in PATH

The batch script is listed as below:

keytool -delete -alias tomcatsso -keystore %JAVA_HOME%/jre/lib/security/cacerts -storepass changeit

keytool -delete -alias tomcatsso -storepass changeit

keytool -genkey -keyalg RSA -keysize 1024 -alias tomcatsso -dname "CN=localhost" -storepass changeit

keytool -export -alias tomcatsso -file %java_home%/jre/lib/security/tomcatsso.crt -storepass changeit

keytool -import -alias tomcatsso -file %java_home%/jre/lib/security/tomcatsso.crt -keystore %java_home%/jre/lib/security/cacerts -storepass changeit

Keytool is provied by jdk.

The password for –storepass is used the access the jdk trusted certficate repository, and its default password is changeit.

-dname represents the certificat owners information. It has the following options:

CN=Computer Name, OU=Organization Unit Name,  O=Organization Name, L=City or Region Name, ST=State Name, C=Country Name

CN should be the full computer name, but it can be localhost

CAS Server Deployment

Create the CasServer project

Click Eclipse->File->New->Dynamic Web Project to create the web project, select Target Runtime as Apache Tomcat v7.0, select Dynamic web module version as 3.0, select configuration as Default Configuration for Apache Tomcat v7.0

Unzip cas-server-3.5.2.zip file, in the extracted folder you can find cas-server-uber-webapp-3.5.2.war, unzip this file to the project folder: /CasServer/WebContent

Configure server.xml to enable HTTPS connection

If you have created a tomcat server for CasServer, the configuration file for this tomcat server should be under project Servers.

Open server.xml file in /Servers/Tomcat v7.0 Server at localhost-config/server.xml

Add/Replace the follow xml script to Tenable HTTPS connector:

<Connector SSLEnabled="true" clientAuth="false"

                  keystoreFile="C:/Documents and Settings/yourname/.keystore" keystorePass="changeit"

                  maxThreads="150" port="8443" protocol="HTTP/1.1" scheme="https"

                  secure="true" sslProtocol="TLS"

                  truststoreFile="C:/Java/jdk1.7.0_45/jre/lib/security/cacerts" />

Login CasServer by using HTTPS connection

Add CasServer to tomcat for the deployment

Start tomcat server

Access CasServer web application by using url: https://localhost:8443/CasServer

If login successful, the following screen should be displayed:

CAS Application Deployment

Create the CasSample project

Click Eclipse->File->New->Dynamic Web Project to create the web project, select Target Runtime as Apache Tomcat v7.0, select Dynamic web module version as 3.0, select configuration as Default Configuration for Apache Tomcat v7.0

Unzip cas-client-3.2.1.zip file, in the extracted folder you can find all the lib jars under cas-client-3.2.1\modules, copy the following required jar to project folder: /CasSample/WebContent/WEB-INF/lib:

·         cas-client-core-3.1.12.jar

·         commons-codec-1.8.jar

·         log4j-1.2.16.jar

·         opensaml1-1.1.jar

·         xmlsec-1.4.3.jar

Configure web.xml to enable SSO

Copy the follow script into web.xml,

serverName should be the same as CN value of created certificate(-dname "CN=localhost")

 

<filter>

      <filter-name>CAS Authentication Filter</filter-name>

      <filter-class>org.jasig.cas.client.authentication.Saml11AuthenticationFilter</filter-class>

      <init-param>

            <param-name>casServerLoginUrl</param-name>

            <param-value>https://localhost:8443/CasServer/login</param-value>

      </init-param>

      <init-param>

            <param-name>serverName</param-name>

            <param-value>https://localhost:8443</param-value>

      </init-param>

</filter>

 

<filter>

      <filter-name>CAS Validation Filter</filter-name>

      <filter-class>org.jasig.cas.client.validation.Saml11TicketValidationFilter</filter-class>

      <init-param>

            <param-name>casServerUrlPrefix</param-name>

            <param-value>https://localhost:8443/CasServer</param-value>

      </init-param>

      <init-param>

            <param-name>serverName</param-name>

            <param-value>https://localhost:8443</param-value>

      </init-param>

      <init-param>

            <param-name>redirectAfterValidation</param-name>

            <param-value>true</param-value>

      </init-param>

      <init-param>

            <param-name>useSession</param-name>

            <param-value>true</param-value>

      </init-param>

      <init-param>

            <param-name>acceptAnyProxy</param-name>

            <param-value>true</param-value>

      </init-param>

</filter>

 

<filter>

      <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>

      <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>

</filter>

 

<filter-mapping>

      <filter-name>CAS Validation Filter</filter-name>

      <url-pattern>/*</url-pattern>

</filter-mapping>

 

<filter-mapping>

      <filter-name>CAS Authentication Filter</filter-name>

      <url-pattern>/*</url-pattern>

</filter-mapping>

 

<filter-mapping>

      <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>

      <url-pattern>/*</url-pattern>

</filter-mapping>

Login CasSample by using SSO

Add CasSample to tomcat for the deployment

Start tomcat server

Access CasServer web application by using url: http://localhost:8080/CasSample/

If login successful, the following screen should be displayed:

 

Click Yes and the CAS login screen is displayed, input any username and password as same string.

The index.jsp for CasSample is displayed, and Authenticated Usr Id is displayed correctly.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

代码转载自:https://pan.quark.cn/s/a4b39357ea24 本文重点阐述了利用 LabVIEW 软件构建的锁相放大器的设计方案及其具体实施流程,并探讨了该设备在声波相位差定位系统中的实际运用情况。 锁相放大器作为一项基础测量技术,其核心功能在于能够精确锁定微弱信号的频率参数并完成相关测量工作。 在采用 LabVIEW 软件开发的锁相放大器系统中,通过计算测量信号与两条参考信号之间的互相关函数,实现对微弱信号的频率锁定,同时输出被测信号的幅值信息。 虚拟仪器技术是一种基于计算机硬件平台的仪器系统,其显著特征在于用户可以根据实际需求自主设计仪器功能,配备虚拟化操作界面,并将测试功能完全由专用软件程序实现。 虚拟仪器系统的基本架构主要由计算机主机、专用软件程序以及硬件接口模块等核心部件构成。 虚拟仪器最突出的优势在于其功能完全取决于软件编程,用户可以根据具体应用场景灵活调整系统功能参数。 在基于 LabVIEW 软件开发的锁相放大器系统中,主要运用 LabVIEW 软件平台完成锁相放大器功能的整体设计。 LabVIEW 作为一个图形化编程环境,能够高效地完成虚拟仪器的开发工作。 借助 LabVIEW 软件,可以快速构建锁相放大器的用户操作界面,并且可以根据实际需求进行灵活调整和功能扩展。 锁相放大器系统的关键构成要素包括测量信号输入通道、参考信号输入通道、频率锁定处理单元以及信号幅值输出单元。 测量信号是系统需要检测的对象,参考信号则用于引导系统完成对测量信号的频率锁定。 频率锁定处理单元负责实现测量信号的锁定功能,信号幅值输出单元则负责输出被测信号的幅值大小。 在锁相放大器的实际实现过程中,系统采用了双路参考信号输入方案来锁定测量信号。 通过分析两路参考信号之间的相...
边缘计算环境中基于启发式算法的深度神经网络卸载策略(Matlab代码实现)内容概要:本文介绍了在边缘计算环境中,利用启发式算法实现深度神经网络任务卸载的策略,并提供了相应的Matlab代码实现。文章重点探讨了如何通过合理的任务划分与调度,将深度神经网络的计算任务高效地卸载到边缘服务器,从而降低终端设备的计算负担、减少延迟并提高整体系统效率。文中涵盖了问题建模、启发式算法设计(如贪心策略、遗传算法、粒子群优化等可能的候选方法)、性能评估指标(如能耗、延迟、资源利用率)以及仿真实验结果分析等内容,旨在为边缘智能计算中的模型推理优化提供可行的技术路径。; 适合人群:具备一定编程基础,熟悉Matlab工具,从事边缘计算、人工智能、物联网或智能系统优化方向的研究生、科研人员及工程技术人员。; 使用场景及目标:①研究深度神经网络在资源受限设备上的部署与优化;②探索边缘计算环境下的任务卸载机制与算法设计;③通过Matlab仿真验证不同启发式算法在实际场景中的性能表现,优化系统延迟与能耗。; 阅读建议:建议读者结合提供的Matlab代码进行实践操作,重点关注算法实现细节与仿真参数设置,同时可尝试复现并对比不同启发式算法的效果,以深入理解边缘计算中DNN卸载的核心挑战与解决方案。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值