1. 程式人生 > >springboot + security +CAS 注意事項

springboot + security +CAS 注意事項

上一篇文章裡的SecurityConfig.java配置檔案初始化的時候會設定cas登陸後的service路徑,如下的serive為“localhost:8080/admin/index.html”,我設定的登陸許可權是"/admin/**",訪問這個url會跳轉到cas服務登陸,但是登陸成功後是無法跳轉回這個頁面的,因為這個頁面和service是同一個

這裡寫圖片描述

/**
   * 指定service相關資訊
   */
  @Bean
  public ServiceProperties serviceProperties() {
    ServiceProperties serviceProperties = new
ServiceProperties(); serviceProperties.setService("localhost:8080/admin/index.html"); serviceProperties.setAuthenticateAllArtifacts(true); return serviceProperties; }

還有CAS認證過濾器裡也會設定過濾url,這裡還是請求“localhost:8080/admin/index.html”,也會丟擲異常
這裡寫圖片描述

/**
   * CAS認證過濾器
   */
  @Bean
  public CasAuthenticationFilter casAuthenticationFilter
() throws Exception { CasAuthenticationFilter casAuthenticationFilter = new CasAuthenticationFilter(); casAuthenticationFilter.setAuthenticationManager(authenticationManager()); casAuthenticationFilter.setFilterProcessesUrl("localhost:8080/admin/index.html"); return casAuthenticationFilter; }

總結,這兩個url千萬不要用首頁什麼的重要url,我就是用了index設定的,掉坑裡了,可以設定兩個不會訪問url,也可以用同一個。

相關推薦

springboot + security +CAS 注意事項

上一篇文章裡的SecurityConfig.java配置檔案初始化的時候會設定cas登陸後的service路徑,如下的serive為“localhost:8080/admin/index.html”,我設定的登陸許可權是"/admin/**",訪問這個url會跳

springboot整合rabbitmq注意事項

1:傳輸物件 (1)物件必須實現Serializable介面 (2)實體類在專案中的位置必須一樣,即包名(訪問路徑)一樣 2:建立exchange和queue    在程式碼中exchange和queue和rabbitmq中的持久化要一樣,否則專案啟動失敗 (

Nginx+Springboot+Security+CAS 整合方案-XML 實現SSO客戶端

javaconfig版本: https://www.cnblogs.com/question-sky/p/7068511.html 以下使用的是SpringBoot 2.1.1進行測試 0 Maven引用 <dependency>

Springboot 注意事項 慢慢累積

1.當使用這種方式配置資料來源,預設url名稱使用的是jdbc-url public DataSource testDataSource() { return DataSourceBuilder.create().build(); } 2.使用這種方式配置資料來源

SpringBoot開發詳解(三)--SpringBoot配置檔案YML注意事項

轉載自:https://blog.csdn.net/qq_31001665/article/details/70197543#commentBox 一、多重層級讀取 在YML中我們再新增一個ZZP2的配置資訊,其中包含了girl節點以及girl下的name,age屬性。 zzp2:

springboot 專案 注意事項

SpringBoot出現下列錯誤。 Your ApplicationContext is unlikely to start due to a @ComponentScan of the default packageDestroy method on bean with name 'org.springf

springboot下多執行緒開發注意事項

基於springboot的多執行緒程式開發過程中,由於本身也需要注入spring容器進行管理,才能發揮springboot的優勢。所以這篇文字主要用來記錄開發中兩者結合時需要注意的一些事項。 第一步我們把執行緒類的例項注入sping容器進行管理 @Configuration @SpringBootAppli

springboot注意事項

1.專案中如果既有yml配置檔案又有properties的配置檔案。優先使用propeities檔案中的配置 2.springboot可以指定工作環境(如測試、開發、生產)可以在application後邊加上-識別符號 比如application-dev.properit

Spring和SpringBoot中的@Component 和@ComponentScan註解用法介紹和注意事項

通過本文你將學到: Component Scan是什麼? 為什麼ComponentScan很重要? 專案中Spring Boot會對哪些包自動執行掃描(Component Scan)? 如何利用Spring Boot定義掃描範圍? 專案啟動時關於Compone

SpringBoot中使用任務排程器的注意事項

https://blog.csdn.net/tyztyztyztyztyz/article/details/81813489 https://www.jianshu.com/p/70dcc12c6ef5 springboot排程器單執行緒,一個卡了,別的也就不執行了。 1、當然針對耗時較

Spring Security 4.2.2 一些注意事項

1.配置檔案中的http標籤變為security:http2.security:http上的屬性use-expressions="false",如果未這麼宣告,那麼在子節點中security:intercept-url的access中直接使用角色名,則會報錯Field or

horizonview security server ssl 證書注意事項

1.根證書要安裝到信任的頒發機構中 2 還要把證書匯入信任的頒發機構中 3, 匯入私鑰到本地證書的個人證書中 外部URL 填寫為 公網域名+埠 PCOIP填寫為內網security的ip blast外部URL填寫外網地址對應的域名 vdmadmin -S -r -s

SpringBoot番外篇之logback日誌使用注意事項

springboot預設的日誌配置:logback 根節點:   <configuration /> 主要子節點:   <appender />:配置日誌輸出的方式,控制檯,檔案等。   <logger />、&l

springboot security基於註解配置許可權與CAS單點登入配置。

1.因產品需求方的要求,我經過考察,使用現今流行的springboot框架,security許可權配置,剛開始碰到不少坑,後來慢慢琢磨,其實發現也就那麼一回事。 2.看本文章前,需要有點springboot對於註解基礎,否則可能不太理解。 這個是我的基本配置,有部分大家可

關於基於springboot啟動專案的一些注意事項

1.在專案中涉及到了資料庫的操作時,我們需要新增一個連線池啟動器,例如<!-- Druid連線池 --><dependency>   <groupId>com.alibaba</groupId>   <artifact

Springboot+mybatis注意事項,以及@Repository與@Mapper的區別

第一步:pom檔案匯入依賴      以及相關外掛     第二步: 核心配置檔案配置連線資料庫的相關資訊:使用mysql8.0.19版本為例(注意8.0版本driver需要加cj)      第三步(注意): 1、#

簡單易用的Apache shiro框架,以及復雜完整的springboot security安全框架

port primary 框架 testin java ron none AS 實現 Shiro是一個強大的簡單的易用的Java安全框架。 實現認證、授權、加密、會話管理 primary concerns:Authentication、Authorization、Crypt

spring security+cas(cas proxy配置)

interface iteye RF lns key sock nag spec uitable 什麽時候會用到代理proxy模式? 舉一個例子:有兩個應用App1和App2,它們都是受Cas服務器保護的,即請求它們時都需要通過Cas 服務器的認證。現在需要在App1中通過

springboot+security+JWT實現單點登錄

tchar dmi void wire pla writer 只為 conf string   本次整合實現的目標:1、SSO單點登錄2、基於角色和spring security註解的權限控制。   整合過程如下:   1、使用maven構建項目,加入先關依賴,pom.xm

ISTQB TA - 邊界值分析中三值測試法的注意事項

三值測試法的定義(中文版20150601大綱): 取一個不超過邊界、一個在邊界上、一個超過邊界的值。 這三個值其實還有另外一種叫法,分別是內點、上點和離點。 內點:不超過邊界的點 上點:在邊界上的點 離點:超過邊界的點 以閉區間[10, 20]的右邊界20為例(取值均為整數