<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          使用IDEA運行CAS5.3服務(wù)器 springBoot客戶端

          共 2460字,需瀏覽 5分鐘

           ·

          2020-10-20 13:43

          點擊上方藍色字體,選擇“標星公眾號”

          優(yōu)質(zhì)文章,第一時間送達

          ? 作者?|??cn2020

          來源 |? urlify.cn/IZJFZn

          66套java從入門到精通實戰(zhàn)課程分享

          在上節(jié)中,我們運行CAS服務(wù)器是打成war包在tomcat中進行運行,這節(jié)介紹在IDEA中運行CAS服務(wù)器。

          1.下載CAS 模板 Overlay Template,我這里使用 Apereo CAS 5.3.x 版本,JDK需要1.8+

          地址:https://github.com/apereo/cas-overlay-template/tree/5.3

          2.進行解壓,使用IDEA添加解壓的項目,點擊File—>New—>Project from Existing Sources...

          ?

          選擇解壓好的項目

          ?

          ?

          ?選擇Maven

          ?

          ?

          ?

          ?點擊next,next...直到finish ??項目加載。加載完成后,項目結(jié)構(gòu)是這樣子的

          項目是一個overlay項目,下一節(jié)進行講解

          3.項目加載完成后,我們要在IDEA中配置tomcat,點擊右上角的下三角,選擇Edit Configurations...

          ?

          點擊+號

          ?

          ?向下拉,會有tomcat server,

          ?

          ?點擊選擇本地的,tomcat

          ?

          ?

          ?

          ?

          ?

          ?

          ?打包完成后的目錄結(jié)構(gòu)

          ?

          ?

          ?

          ?運行成功后就會加載界面了

          ?

          ?

          ?

          三:springBoot客戶端

          3.1?導(dǎo)包

          ?
          ????????org.springframework.boot
          ????????spring-boot-starter-parent
          ????????1.5.13.RELEASE
          ?????????
          ????

          ????
          ????????UTF-8
          ????????UTF-8
          ????????1.8
          ????

          ????
          ????
          ????????
          ????????
          ????????????org.springframework.boot
          ????????????spring-boot-starter-web
          ????????

          ????????
          ????????
          ????????????net.unicon.cas
          ????????????cas-client-autoconfig-support
          ????????????1.5.0-GA
          ????????

          ????

          3.2?application.properties

          server.port=8081

          cas.server-url-prefix=http\://127.0.0.1\:9080/cas
          cas.server-login-url=http\://127.0.0.1\:9080/cas/login
          cas.client-host-url=http\://127.0.0.1\:8081
          cas.validation-type=CAS

          3.3?配置類

          import?net.unicon.cas.client.configuration.CasClientConfigurerAdapter;
          import?net.unicon.cas.client.configuration.EnableCasClient;
          import?org.springframework.boot.web.servlet.FilterRegistrationBean;
          import?org.springframework.context.annotation.Configuration;

          @Configuration
          @EnableCasClient
          public?class?CasConfigure?extends?CasClientConfigurerAdapter?{
          @Override
          public?void?configureAuthenticationFilter(FilterRegistrationBean?authenticationFilter)?{
          ????super.configureAuthenticationFilter(authenticationFilter);
          ????????authenticationFilter.getInitParameters().put("authenticationRedirectStrategyClass","com.patterncat.CustomAuthRedirectStrategy");
          ????}
          }

          3.4?控制器

          @RestController
          public?class?IndexController?{
          ????
          ????@RequestMapping("/login")
          ????public?String?auth()?{
          ????????return?"login?success";
          ????}
          }

          3.5 主函數(shù)

          @SpringBootApplication
          public?class?Application?{

          ?????private?static?Logger?log?=?Logger.getLogger(Application.class);
          ?????
          ?????public?static?void?main(String[]?args)?{
          ????????????SpringApplication.run(Application.class,?args);
          ????????????log.info("SpringBoot?Start?Success");
          ????????}
          }






          粉絲福利:108本java從入門到大神精選電子書領(lǐng)取

          ???

          ?長按上方鋒哥微信二維碼?2 秒
          備注「1234」即可獲取資料以及
          可以進入java1234官方微信群



          感謝點贊支持下哈?

          瀏覽 54
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  亚洲狼在线 | 狠狠操免费| 菠萝视频一区二区 | 国产精品久久久久久视频 | 波多野吉衣在线观看免费天堂 |