Catalog

1.tomcat add to https Security protocols

2. download cas server End deployment to tomcat On

3.CAS Server deep configuration ( Connect MYSQL)

4.Apache Shiro Integrate Cas As cas client Server-side implementation

CAS Server deep configuration ( Connect MYSQL)

Currently configured CAS User name and password verification is very simple , As long as the user name and password are the same, you can log in . But in practical application, our user name and password are often stored in the database , So we want to verify the user name and password from the database . The operation steps are as follows :

First step 、MySQL Create databases and tables

I won't talk about this step , I don't know. I can check the information

Second parts 、 add to jar package

1、 download mysql-connector-java-5.1.34-bin.jar, Take this jar Package and download cas server Below modules Below cas-server-support-jdbc-3.5.2.1.jar Kao to tomcat\webapps\cas\WEB-INF\lib Next

Be careful : Because of my mysql The version is 5.7, A lot of online tutorials are mysql-connector-java-5.1.22.jar, But when I get down, I start tomcat An error is as follows :

PropertyAccessException : org.springframework.beans.MethodInvocationException:
Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [com.mysql.jdbc.Driver]

I download mysql-connector-java-5.1.34-bin.jar The version is good , So according to your own mysql Version download jdbc drive .

The third step 、 To configure apache-tomcat-8.0.36\webapps\cas\WEB-INF\ In the catalog deployerConfigContext.xml file

First, add one datasource, By adding a bit of code to achieve :

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="url" value="jdbc:mysql://192.168.20.254:3306/nh"/>
<property name="username" value="root"/>
<property name="password" value="123456"/>
</bean>

And then change the way of Authentication , Go to the following code :

<bean
class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler" />

Comment it out , Switch to :

<!--<bean class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler" />-->
<bean class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler">
<property name="dataSource" ref="dataSource" />
<property name="sql" value="select password from sus_user where username=?" />
</bean>

(4) restart tomcat, Go to the login page again https://localhost:443/cas/login On , You can log in with the user name and password in the database , For example, I use the settings here "test","123456" Sign in , The configuration is finished here

cas+tomcat+shiro Single sign on -3-CAS Server deep configuration ( Connect MYSQL) More articles about

  1. cas+tomcat+shiro Single sign on -4-Apache Shiro Integrate Cas As cas client Server-side implementation

    Catalog 1.tomcat add to https Security protocols 2. download cas server End deployment to tomcat On 3.CAS Server deep configuration ( Connect MYSQL) 4.Apache Shiro Integrate Cas As cas cli ...

  2. cas+tomcat+shiro Single sign on -2- Deploy cas server To tomcat

    Catalog 1.tomcat add to https Security protocols 2. download cas server End deployment to tomcat On 3.CAS Server deep configuration ( Connect MYSQL) 4.Apache Shiro Integrate Cas As cas cli ...

  3. cas+tomcat+shiro Single sign on -1-tomcat add to https agreement

    Catalog 1.tomcat add to https Security protocols 2. download cas server End deployment to tomcat On 3.CAS Server deep configuration ( Connect MYSQL) 4.Apache Shiro Integrate Cas As cas cli ...

  4. 【IBM】 Use CAS stay Tomcat Single sign on in

    source : IBM Developer http://www.ibm.com/developerworks/cn/opensource/os-cn-cas/ Zhang tao  (zzhangt@cn.ibm.com ...

  5. Use CAS stay Tomcat Single sign on in

    Single sign on (Single Sign On , abbreviation SSO ) It is one of the most popular solutions for enterprise business integration , SSO In many application systems , Users only need to log in once to access all mutual trust application systems .CAS ...

  6. Use CAS stay Tomcat Single sign on in http://www.ibm.com/developerworks/cn/opensource/os-cn-cas/

    developerWorks China Technical topics Open source The document library Use CAS stay Tomcat Single sign on in Single sign on (Single Sign On , abbreviation SSO ) It's popular at present ...

  7. SSO Single sign on Spring-Security &amp; CAS User manual

    1.1 summary 1.1.1 Introduction to single sign on Single sign on (Single Sign On , abbreviation SSO ) It is one of the most popular solutions for enterprise business integration , SSO In many application systems , Users only need to log in once to ...

  8. Single sign on System CAS The realization of preparing and obtaining more user information

    Jiuding holdings, a domestic private equity firm, has created APP, Send it as soon as you come  20 The address for collecting yuan in cash :http://jdb.jiudingcapital.com/phone.html Internal invitation code :C8E245J ( No invitation code , No cash to send ) Domestic private ...

  9. java Single sign on System CAS Simple use

    turn :http://blog.csdn.net/yunye114105/article/details/7997041 background There are several relatively independent java Of web Application system , Each has its own login verification function , The user is in ...

Random recommendation

  1. Java Generate 16/32 position MD5

    http://blog.csdn.net/codeeer/article/details/30044831

  2. MYSQL Basic operation statement

    0. Change Password :mysqladmin -u root -p password 123456 Export database :mysqldump -u root -p yunpay>yunpay.sql Import database :m ...

  3. SOA_ Environment installation series 4_Oracle SOA Installation and environment construction ( Case study )

    2015-01-02 Created By BaoXinjian

  4. OC7_ Compound class memory management (setter Method )

    // // Person.h // OC7_ Compound class memory management (setter Method ) // // Created by zhangxueming on 15/6/18. // Copyright (c) 2 ...

  5. HTTPS Principle analysis

    HTTPS(Hypertext Transfer Protocol Secure) Protocol is used to provide secure hypertext transfer service . It's essentially SSL/TLS On the floor HTTP agreement , That is to say "HTTP ove ...

  6. NHibernate Basic use of

    One .O/R Mapping An introduction to Factory mode + Reflection + For each database DAL Layer to solve the data access layer code We can't predict the changes of the fields in the database table , So every modification of user requirements will directly lead us programmers to modify — Entity class (B ...

  7. JS The differences and comparison rules between congruent and equal operators in

    One . The difference between the two equal : Cast the variable type first , Compare again Congruence : Don't convert type , Once the type is different , It's just not congruent . Two . The comparison rules of equality and inequality 1. When there is a Boolean value in the operator : Convert it to a numerical value before comparing false => 0 ...

  8. Extremely simple VSCode C++ Environment configuration

    Download my packaged file VSCode-cpp.7z.001 and VSCode-cpp.7z.002, decompression . Add environment variables to the system : Your decompression path \Project\.vscode\MinGW\bin. Open it and unzip it ...

  9. R Language Rename all the files in the directory

    myfilepath <- "F:/paper2/climateExposure/wjj_mec/second/paths/" setwd(myfilepath) allty ...

  10. practice ng-show and ng-hide Methods

    In the programming process , We need to show and hide an element or a block . If you are using angularjs Words , You can use ng-show perhaps ng-hide To control . var showhideApp = angula ...