欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

CAS4.0連接mysql數(shù)據(jù)庫(kù)的詳細(xì)步驟-創(chuàng)新互聯(lián)

本文主要給大家介紹CAS4.0連接mysql數(shù)據(jù)庫(kù)的詳細(xì)步驟,文章內(nèi)容都是筆者用心摘選和編輯的,具有一定的針對(duì)性,對(duì)大家的參考意義還是比較大的,下面跟筆者一起了解下CAS4.0連接mysql數(shù)據(jù)庫(kù)的詳細(xì)步驟吧。

為曲沃等地區(qū)用戶提供了全套網(wǎng)頁(yè)設(shè)計(jì)制作服務(wù),及曲沃網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為成都網(wǎng)站建設(shè)、網(wǎng)站制作、曲沃網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!

步驟如下

一:

在cas-4.0.0\cas-server-webapp\pom.xml中添加依賴后(如下方所示),打開cmd在cas-4.0.0\cas-server-webapp文件夾下運(yùn)行mvn clean package,然后將cas-4.0.0\cas-server-webapp\target下的cas.war包部署至tomcat

Xml代碼  CAS4.0連接mysql數(shù)據(jù)庫(kù)的詳細(xì)步驟

  1. <dependency>

  2.     <groupId>org.jasig.cas</groupId>

  3.     <artifactId>cas-server-support-jdbc</artifactId>

  4.     <version>${project.version}</version>

  5.     <type>jar</type>

  6. </dependency>

  7. <!-- https://mvnrepository.com/artifact/commons-dbcp/commons-dbcp -->

  8. <dependency>

  9.     <groupId>commons-dbcp</groupId>

  10.     <artifactId>commons-dbcp</artifactId>

  11.     <version>1.4</version>

  12. </dependency>

  13. <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->

  14. <dependency>

  15.     <groupId>mysql</groupId>

  16.     <artifactId>mysql-connector-java</artifactId>

  17.     <version>5.1.6</version>

  18. </dependency>

 CAS4.0連接mysql數(shù)據(jù)庫(kù)的詳細(xì)步驟

二:

本地創(chuàng)建數(shù)據(jù)庫(kù),并新建表 cas_user,創(chuàng)建語句如下載

Sql代碼  CAS4.0連接mysql數(shù)據(jù)庫(kù)的詳細(xì)步驟

  1. create table cas_user (

  2.     id bigint not null auto_increment,

  3.     email varchar(255),

  4.     username varchar(255) not null unique,

  5.     name varchar(255),

  6.     password varchar(255),

  7.     primary key (id)

  8. ) ENGINE=InnoDB;

三:

配置數(shù)據(jù)庫(kù)相關(guān)文件,在tomcat-for-cas\webapps\cas\WEB-INF\deployerConfigContext.xml中配置對(duì)應(yīng)的datasource,數(shù)據(jù)庫(kù)地址,用戶名,密碼,以及查詢用戶的sql。需要注意的是,如果是自己建的表,要把相應(yīng)的字段名,數(shù)據(jù)庫(kù)名替換掉,以及,不要忘記注釋掉默認(rèn)用戶名密碼的配置(casuser/Mellon)。下載以下配置可以全拷貝

Xml代碼  CAS4.0連接mysql數(shù)據(jù)庫(kù)的詳細(xì)步驟

  1. <?xml version="1.0" encoding="UTF-8"?>

  2. <!--

  3.     Licensed to Jasig under one or more contributor license

  4.     agreements. See the NOTICE file distributed with this work

  5.     for additional information regarding copyright ownership.

  6.     Jasig licenses this file to you under the Apache License,

  7.     Version 2.0 (the "License"); you may not use this file

  8.     except in compliance with the License.  You may obtain a

  9.     copy of the License at the following location:

  10.       http://www.apache.org/licenses/LICENSE-2.0

  11.     Unless required by applicable law or agreed to in writing,

  12.     software distributed under the License is distributed on an

  13.     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

  14.     KIND, either express or implied.  See the License for the

  15.     specific language governing permissions and limitations

  16.     under the License.

  17. -->

  18. <!--

  19. | deployerConfigContext.xml centralizes into one file some of the declarative configuration that

  20. | all CAS deployers will need to modify.

  21. |

  22. | This file declares some of the Spring-managed JavaBeans that make up a CAS deployment.

  23. | The beans declared in this file are instantiated at context initialization time by the Spring

  24. | ContextLoaderListener declared in web.xml.  It finds this file because this

  25. | file is among those declared in the context parameter "contextConfigLocation".

  26. |

  27. | By far the most common change you will need to make in this file is to change the last bean

  28. | declaration to replace the default authentication handler with

  29. | one implementing your approach for authenticating usernames and passwords.

  30. +-->

  31. <beans xmlns="http://www.springframework.org/schema/beans"

  32.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  33.        xmlns:p="http://www.springframework.org/schema/p"

  34.        xmlns:c="http://www.springframework.org/schema/c"

  35.        xmlns:tx="http://www.springframework.org/schema/tx"

  36.        xmlns:util="http://www.springframework.org/schema/util"

  37.        xmlns:sec="http://www.springframework.org/schema/security"

  38.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd

  39.        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd

  40.        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd

  41.        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

  42.     <!--

  43.        | The authentication manager defines security policy for authentication by specifying at a minimum

  44.        | the authentication handlers that will be used to authenticate credential. While the AuthenticationManager

  45.        | interface supports plugging in another implementation, the default PolicyBasedAuthenticationManager should

  46.        | be sufficient in most cases.

  47.        +-->  下載

  48.     <bean id="authenticationManager" class="org.jasig.cas.authentication.PolicyBasedAuthenticationManager">

  49.         <constructor-arg>

  50.             <map>

  51.                 <!--

  52.                    | IMPORTANT

  53.                    | Every handler requires a unique name.

  54.                    | If more than one instance of the same handler class is configured, you must explicitly

  55.                    | set its name to something other than its default name (typically the simple class name).

  56.                    -->

  57.                     <entry key-ref="proxyAuthenticationHandler" value-ref="proxyPrincipalResolver" />

  58.                  <entry key-ref="primaryAuthenticationHandler" value-ref="primaryPrincipalResolver" />

  59.             </map>

  60.         </constructor-arg>

  61.         <!-- Uncomment the metadata populator to allow clearpass to capture and cache the password

  62.              This switch effectively will turn on clearpass.

  63.         <property name="authenticationMetaDataPopulators">

  64.            <util:list>

  65.               <bean class="org.jasig.cas.extension.clearpass.CacheCredentialsMetaDataPopulator"

  66.                     c:credentialCache-ref="encryptedMap" />

  67.            </util:list>

  68.         </property>

  69.         -->

  70.         <!--

  71.            | Defines the security policy around authentication. Some alternative policies that ship with CAS:

  72.            |

  73.            | * NotPreventedAuthenticationPolicy - all credential must either pass or fail authentication

  74.            | * AllAuthenticationPolicy - all presented credential must be authenticated successfully

  75.            | * RequiredHandlerAuthenticationPolicy - specifies a handler that must authenticate its credential to pass

  76.            -->

  77.         <property name="authenticationPolicy">

  78.             <bean class="org.jasig.cas.authentication.AnyAuthenticationPolicy" />

  79.         </property>

  80.     </bean>

  81.     <!-- Required for proxy ticket mechanism. -->

  82.     <bean id="proxyAuthenticationHandler"

  83.           class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"

  84.           p:httpClient-ref="httpClient" p:requireSecure="true" />

  85.     <!--

  86.        | TODO: Replace this component with one suitable for your enviroment.

  87.        |

  88.        | This component provides authentication for the kind of credential used in your environment. In most cases

  89.        | credential is a username/password pair that lives in a system of record like an LDAP directory.

  90.        | The most common authentication handler beans:

  91.        |  下載

  92.        | * org.jasig.cas.authentication.LdapAuthenticationHandler

  93.        | * org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler

  94.        | * org.jasig.cas.adaptors.x509.authentication.handler.support.X509CredentialsAuthenticationHandler

  95.        | * org.jasig.cas.support.spnego.authentication.handler.support.JCIFSSpnegoAuthenticationHandler

  96.        -->

  97.     <bean id="primaryAuthenticationHandler"

  98.           class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler">

  99.           <property name="dataSource" ref="dataSource"/>

  100.           <property name="sql" value="select password from cas_user where username = ?"/>

  101.     </bean>

  102.     <!-- Required for proxy ticket mechanism -->

  103.     <bean id="proxyPrincipalResolver"

  104.           class="org.jasig.cas.authentication.principal.BasicPrincipalResolver" />

  105.     <!--

  106.        | Resolves a principal from a credential using an attribute repository that is configured to resolve

  107.        | against a deployer-specific store (e.g. LDAP).

  108.        -->

  109.     <bean id="primaryPrincipalResolver"

  110.           class="org.jasig.cas.authentication.principal.PersonDirectoryPrincipalResolver" >

  111.         <property name="attributeRepository" ref="selfAttributeRepository" />

  112.     </bean>

  113.     <!--

  114.     Bean that defines the attributes that a service may return.  This example uses the Stub/Mock version.  A real implementation

  115.     may go against a database or LDAP server.  The id should remain "attributeRepository" though.

  116.     +-->

  117.     <bean id="attributeRepository" class="org.jasig.services.persondir.support.StubPersonAttributeDao"

  118.             p:backingMap-ref="attrRepoBackingMap" />

  119.     <util:map id="attrRepoBackingMap">

  120.         <entry key="uid" value="uid" />

  121.         <entry key="eduPersonAffiliation" value="eduPersonAffiliation" />

  122.         <entry key="groupMembership" value="groupMembership" />

  123.     </util:map>

  124.     <!--

  125.     Sample, in-memory data store for the ServiceRegistry. A real implementation

  126.     would probably want to replace this with the JPA-backed ServiceRegistry DAO

  127.     The name of this bean should remain "serviceRegistryDao".

  128.     +-->

  129.     <bean id="serviceRegistryDao" class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl"

  130.             p:registeredServices-ref="registeredServicesList" />

  131.     <util:list id="registeredServicesList">

  132.         <bean class="org.jasig.cas.services.RegexRegisteredService"

  133.               p:id="0" p:name="HTTP and IMAP" p:description="Allows HTTP(S) and IMAP(S) protocols"

  134.               p:serviceId="^(https?|imaps?)://.*" p:evaluationOrder="10000001" />

  135.         <!--

  136.         Use the following definition instead of the above to further restrict access

  137.         to services within your domain (including sub domains).

  138.         Note that example.com must be replaced with the domain you wish to permit.

  139.         This example also demonstrates the configuration of an attribute filter

  140.         that only allows for attributes whose length is 3.

  141.         -->

  142.         <!--

  143.         <bean class="org.jasig.cas.services.RegexRegisteredService">

  144.             <property name="id" value="1" />

  145.             <property name="name" value="HTTP and IMAP on example.com" />

  146.             <property name="description" value="Allows HTTP(S) and IMAP(S) protocols on example.com" />

  147.             <property name="serviceId" value="^(https?|imaps?)://([A-Za-z0-9_-]+\.)*example\.com/.*" />

  148.             <property name="evaluationOrder" value="0" />

  149.             <property name="attributeFilter">

  150.               <bean class="org.jasig.cas.services.support.RegisteredServiceRegexAttributeFilter" c:regex="^\w{3}$" />

  151.             </property>

  152.         </bean>

  153.         -->

  154.     </util:list>

  155.     <bean id="auditTrailManager" class="com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager" />

  156.     <bean id="healthCheckMonitor" class="org.jasig.cas.monitor.HealthCheckMonitor" p:monitors-ref="monitorsList" />

  157.     下載

  158.     <util:list id="monitorsList">

  159.       <bean class="org.jasig.cas.monitor.MemoryMonitor" p:freeMemoryWarnThreshold="10" />

  160.       <!--

  161.         NOTE

  162.         The following ticket registries support SessionMonitor:

  163.           * DefaultTicketRegistry

  164.           * JpaTicketRegistry

  165.         Remove this monitor if you use an unsupported registry.

  166.       -->

  167.       <bean class="org.jasig.cas.monitor.SessionMonitor"

  168.           p:ticketRegistry-ref="ticketRegistry"

  169.           p:serviceTicketCountWarnThreshold="5000"

  170.           p:sessionCountWarnThreshold="100000" />

  171.     </util:list>

  172.     <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">

  173.                    <property name="driverClassName">

  174.                            <value>com.mysql.jdbc.Driver</value>

  175.                    </property>

  176.                    <property name="url">

  177.                             <value>jdbc:mysql://localhost:3306/test</value>

  178.                    </property>

  179.                    <property name="username">

  180.                             <value>root</value>

  181.                    </property>

  182.                    <property name="password">

  183.                             <value>123456</value>

  184.                    </property>

  185.     </bean>

  186.     <bean id="selfAttributeRepository"

  187.   class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">

  188.   <constructor-arg index="0" ref="dataSource" />

  189.   <constructor-arg index="1"

  190.    value="select username,password from cas_user where {0}" />

  191.   <!-- 組裝sql用的查詢條件屬性 -->

  192.   <property name="queryAttributeMapping">

  193.    <map>

  194.        <!-- key必須是uername而且是小寫否則會(huì)導(dǎo)致取不到用戶的其它信息,value對(duì)應(yīng)數(shù)據(jù)庫(kù)用戶名字段,系統(tǒng)會(huì)自己匹配 -->

  195.     <entry key="username" value="username" />

  196.     <entry key="password" value="password" />

  197.    </map>

  198.   </property>

  199.   <property name="resultAttributeMapping">

  200.    <map>

  201.        <!-- key為對(duì)應(yīng)的數(shù)據(jù)庫(kù)字段名稱,value為提供給客戶端獲取的屬性名字,系統(tǒng)會(huì)自動(dòng)填充值 -->

  202.     <entry key="username" value="username"></entry>

  203.     <entry key="password" value="password"></entry>

  204.    </map>

  205.   </property>

  206.  </bean>

  207. </beans>

看完以上關(guān)于CAS4.0連接mysql數(shù)據(jù)庫(kù)的詳細(xì)步驟,很多讀者朋友肯定多少有一定的了解,如需獲取更多的行業(yè)知識(shí)信息 ,可以持續(xù)關(guān)注我們的行業(yè)資訊欄目的。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

當(dāng)前題目:CAS4.0連接mysql數(shù)據(jù)庫(kù)的詳細(xì)步驟-創(chuàng)新互聯(lián)
本文鏈接:http://aaarwkj.com/article46/pjpeg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供Google響應(yīng)式網(wǎng)站、軟件開發(fā)、定制網(wǎng)站、移動(dòng)網(wǎng)站建設(shè)外貿(mào)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)頁(yè)設(shè)計(jì)公司
日本福利写真在线观看| 国产成人免费公开视频| 99久久成人精品国产片| 国产三级亚洲三级在线理论| 日本一区二区不卡二区| 国产av一区二区三区| 中文字幕午夜av福利| 国产H精品在线观看| 欧美黄色一区二区三区视频 | 欧美日本一区二区三区免费| 国产免费播放一区二区三区| 日本欧美国产污黄在线观看| 日韩视频精品推荐一区二区| 18禁在线免费观看网站| 不卡的视频在线观看| 亚洲欧美半夜激情一区二区| 国产午夜福利不卡在线观看| 黄片视频免费在线播放大全| 亚洲av一本岛在线播放| 国产精品午夜视频免费观看| 亚洲日本日本午夜精品| av在线免费观看青青草原| 亚洲午夜经典一区二区日韩| 女人天堂网av免费看| 欧美亚洲另类日韩综合网| 欧美日韩黄色人人小视频| 亚洲日本不卡在线一区二区| 国产成人国产三级国产精品| 日本亚洲一区二区在线| 老湿机午夜十分钟视频| 亚洲中国av一区二区| 亚洲字幕中文在线乱码mv| 日本高清区一区二区三区四区五区| 精品中文人妻中文字幕| 欧美亚日韩精品视频| 狼人综合狼人综合网站| 欧美日韩一区二区三区四区高清视频 | 国产成人精品福利一区二区| 宅男视频在线观看视频| 青青草原高清在线观看 | 国产精品久久99精品|