![](/img/trans.png)
[英]Custom Authentication Processing Filter Location in SecurityFilterChain?
我有一個AbstractAuthenticationProcessingFilter的自定義實現,我需要將其手動插入到安全過濾器鏈中。 我看過多個教程,每個教程都說要在鏈中的不同過濾器之前或之后插入它。 關於應該放置此過濾器的位置是否有明確的答案? 或者,至少,一個可以幫助解決問題的經驗法則? 視 ...
[英]Custom Authentication Processing Filter Location in SecurityFilterChain?
我有一個AbstractAuthenticationProcessingFilter的自定義實現,我需要將其手動插入到安全過濾器鏈中。 我看過多個教程,每個教程都說要在鏈中的不同過濾器之前或之后插入它。 關於應該放置此過濾器的位置是否有明確的答案? 或者,至少,一個可以幫助解決問題的經驗法則? 視 ...
[英]Why am I getting a 401 when using Spring Security 6, permitAll and after disabiling CSRF?
有一些類似的問題,所以我已盡力表示差異,但我已經審查過它們,但它們似乎與我的問題不符。 我有一些簡單的用例...... 我嘗試像這樣使用 spring 安全性來讓它工作...... 但是當我運行並嘗試使用 GET 請求http://localhost:8080時,我仍然得到 401。如果我從 PO ...
[英]Using Auth0 in Spring Cloud Gateway, problem with getting ID Token
我們在使用 auth0 SDK 獲取 ID 令牌時遇到問題。我們有基於 Spring 雲網關(版本 3.1.4)的 API 網關,我們嘗試使用您的 auth0 平台對用戶進行身份驗證,然后將交換路由到我們的微服務。 為此,我們想使用 ID Token 並從中獲取 email 並將此 email 傳遞 ...
[英]Unit test returns 401 Unauthorized on a permitted route in Spring WebFlux Security
我正在嘗試測試返回對象數組的路由,但測試失敗,因為它返回 Unauthorized 而不是 200 OK 我的測試 class 而ApplicationSecurityConfig class,有一個SecurityWebFilterChain Bean JUint 測試錯誤顯示如下 java. ...
[英]Spring OAuth2 Authorization Server + Spring WebFlux
我正在嘗試使用Spring Boot 3.0.2和新發布Spring OAuth2 Authorization Server 1.0.0重寫現有的 OAuth2 授權服務。 面臨從 Reactive Security 和 Standard Security 庫組合對象的問題:無法將默認安全應用於O ...
[英]How to use multiple login pages one for admin and the other one for user
我想要兩個不同的登錄頁面。 一個供管理員使用,另一個供用戶使用。 當我從 static 類中刪除@Order注釋時,僅使用帶有@Order(1)的 class 下面的代碼,只有最后一個有效。 我在兩個不同的ConfigSecurity文件中使用了它們,但沒有用。 我期待他們兩個都能工作。 然而只有一 ...
[英]Spring Security -> SecurityConfig causes ERR_TOO_MANY_REDIRECTS
嘗試訪問我的 Spring SecurityConfig 中的登錄頁面時,是什么導致“ERROR_TOO_MANY_REDIRECTS” ? 我不確定問題是否出在SecurityConfig中,但這就是我的假設。 我將 Spring Boot 3.0.2 與 IntelliJ IDE Commun ...
[英]Oauth2 jwt token enriched with userinfo enpoint
我有一個公開一些 webflux 端點的 spring 應用程序,我使用 jwt 令牌來授權 post 調用,但我們還需要 userinfo 端點提供的信息。 我現在有一個 SecurityWebFilterChain bean,我們正在使用 oauth2ResourceServer 配置,然后調 ...
[英]Spring authorization server authenticate for each client
我正在嘗試使用第三方應用程序將用於 FIM(聯合身份管理)的 Spring 授權服務器構建身份提供者。 我們希望每個 OAuth 客戶端都需要身份驗證(如果用戶嘗試使用不同的客戶端登錄,則他們需要為每個客戶端進行身份驗證)。 開箱即用的流程如下所示: 所以有2個問題。 /oauth2/autho ...
[英]Spring boot: Requests with an expired Cookie is still available after logging out
在 spring 引導項目中,當用戶注銷時,我們使用以下代碼塊使 cookie 失效: 然而,在注銷后,我用一個應用程序測試了我的網站,以捕獲請求並通過中繼器重新發送它,並使用准確的值,例如令牌和有效負載。 例如,我拒絕了更改 email 地址的請求,盡管已注銷,但此請求在 15 分鍾內有效(對於原 ...
[英]JWT in Cookies - do I need a refresh token?
我在后端使用 Spring Security 為我的 React SPA 實現安全性。 經過大量閱讀,我選擇了以下方法: HTTPS無處不在 POST /login 獲取憑據以 cookie 形式返回 JWT_TOKEN 和 XSRF_TOKEN。 我自己構建 JWT_TOKEN,而 Sprin ...
[英]Spring boot - holding authenticated user through many server instances
我有基於JWT令牌的STATELESS安全無狀態應用程序。 這是我的自定義授權過濾器override fun doFilterInternal( request: HttpServletRequest, response: HttpServletResponse, ...
[英]Spring security - using WebClient access a resource that is protected via Oauth2 "Password" grant type
賞金將在 6 天后到期。 此問題的答案有資格獲得+50聲望賞金。 tm1701想提請更多人注意這個問題。 如何使用 WebClient 訪問受 Oauth2“密碼”授權類型保護的資源? 連接 Oauth2 'client-credentials' 有效。 在這種情況下,我需要密碼授予類型。 我收 ...
[英]Spring Boot 3 with Spring Security Intercepts exceptions I don't want it to
我正在使用 Spring Boot 3.0.2 和 Spring Security 構建一個 API,我已經構建了安全過濾器鏈,它在阻止未經身份驗證的請求方面運行良好。 但是我有一個接受application/json的RestController class,如果我沒有正確提供內容類型 heade ...
[英]Can I have Spring Boot create a WebClient which uses OAuth2 without it trying to apply the OAuth flow to my endpoints?
我想要一個使用 client_credentials OAuth2 流來授權 API 的 WebClient。我遵循了從文檔到幾個教程的各種說明。 我覺得我非常接近讓 Spring Boot 做我想做的事,但默認行為是做我不想做的事——當我向我的任何控制器發出請求時,我被重定向到 /login。 ...
[英]Logout handler is hanging
我正在將工作應用程序從 Spring Boot 2.6.5 升級到 2.7.8 (Spring Security 5.7.6),以便我可以更好地升級到 3.0。 注銷之前工作正常。 但是在升級到 Sprint Boot 2.7.8 之后,注銷處理掛起並且永遠不會重定向到logoutSuccessUr ...
[英]Getting 403 forbidden after authentication using custom authentication filter that parses JSON payload
我想要做的只是使用自定義身份驗證過濾器對內存中的默認用戶進行身份驗證,該過濾器解析包含用戶名和密碼的 JSON 有效負載。 安全配置.javapackage ali.yousef.authdemo.config.security; @Configuration @EnableWebSecurit ...
[英]How do I use the BearerToken in all subsequent calls to the API after authenticating using username & password
我有一個 CustomAuthenticationProvider,它使用用戶名和密碼向 API 發出 POST 請求以進行身份驗證,API 返回一個帶有到期時間的訪問令牌。 我在哪里設置這個令牌,所以只要用戶登錄,我就可以使用相同的令牌進一步調用 API。我還想在發出另一個請求之前驗證令牌的到期 ...
[英]Cannot read client's X509 certificate in Spring Boot mTLS
我想在 mTLS 連接中讀取客戶端的 x509 證書。 我正在使用帶有嵌入式 tomcat 的 Spring Boot。 我的WebSecurityConfig.java@Configuration @EnableWebSecurity public class WebSecurityConfig ...
[英]API requires JWT Token on all requests despite the authentication configuration
我正在嘗試按照本教程(本教程的后續教程)為我的 API 實施 JWT 授權。當我嘗試使用“/authenticate”和“/register”時,出現錯誤“JWT Token does not從 Bearer String 開始”。 這是拋出錯誤的請求過濾器的一部分: 這是應該允許“驗證”和“請求” ...