Spring Boot 2 Oauth 如何實現隱式代碼流 (Spring Boot 2 Oauth how to implement Implicit Code Flow)


問題描述

Spring Boot 2 Oauth 如何實現隱式代碼流 (Spring Boot 2 Oauth how to implement Implicit Code Flow)

目前我正在將 OAuth 引入我的 Spring 應用程序,但我沒有正確集成它的運氣。我正在使用 Spring Boot 2

我的要求是:

  • 授權和資源服務器是同一個應用程序在同一台服務器上運行
  • 需要支持隱式、授權碼授予和資源所有者憑據授予
  • 我想在“ /api/v1/"

所有流程都無法正常工作。到目前為止,我所取得的成就是基於

我很確定安全配置的某些東西搞砸了,但我不知道它能做什麼是。我在網上查看了很多指南,但我沒有找到一個解釋所有授權碼組合的指南。我認為這可能是驗證 URL 的一個小錯誤,但我不知道它可能是什麼。

如果有人知道這個問題的答案,我會非常高興。

我在網上查看了很多指南,但我沒有找到一個解釋所有授權碼組合的指南。我認為這可能是驗證 URL 的一個小錯誤,但我不知道它可能是什麼。

如果有人知道這個問題的答案,我會非常高興。

我在網上查看了很多指南,但我沒有找到一個解釋所有授權碼組合的指南。我認為這可能是驗證 URL 的一個小錯誤,但我不知道它可能是什麼。

如果有人知道這個問題的答案,我會非常高興。


參考解法

方法 1:

Move your configure() implementation from WebSecurityConfig to Resource Server configure() method as below

http.authorizeRequests()
      .antMatchers("/api/v1/**")
      .hasAnyRole("ADMIN", "USER")

Rest of the configurations in configure() method are not required

(by grahanDhiraj Ray)

參考文件

  1. Spring Boot 2 Oauth how to implement Implicit Code Flow (CC BY‑SA 2.5/3.0/4.0)

#oauth-2.0 #OAuth #spring-boot #spring






相關問題

OAuth2 用戶映射和丟失我的 Cookie (OAuth2 User Mapping and Loosing my Cookies)

如何在打開 Facebook 登錄對話框之前告訴 iPhone 應用用戶會發生什麼 (How to tell an iphone app user what will happen before opening Facebook login dialogue)

帶有 spring-security 的 OAuth2 - 通過 HTTP 方法限制 REST 訪問 (OAuth2 with spring-security - limit REST access by HTTP method)

帶有Phonegap 2.3.0的Facebook oAuth沒有在成功url返回令牌作為url參數 (Facebook oAuth with Phonegap 2.3.0 not returning token as url param at success url)

Dwolla API Key、Client_id 和 Client_Secret 有什麼區別? (What is the different between Dwolla API Key, Client_id & Client_Secret?)

Linkedin 應用程序具有 OAuth 用戶令牌和 OAuth 用戶密鑰,它們會過期嗎? (Linkedin Application has OAuth User Token and OAuth User Secret, Do they Expire?)

OAuth2:保護非用戶資源 (OAuth2: Protecting non-user resources)

IOS的foursquare oauth2 (foursquare oauth2 for IOS)

Spring Boot 2 Oauth 如何實現隱式代碼流 (Spring Boot 2 Oauth how to implement Implicit Code Flow)

FusionAuth - 基於邀請的用戶登錄與社交登錄 (FusionAuth - Invite based user on-boarding with social logins)

為什麼每次發送請求時都刷新訪問令牌是個壞主意? (Why is it a bad idea to refresh access token every time when I sent request?)

如何配置必須使用“密碼”授權類型從授權服務器請求令牌的客戶端 Java 應用程序? (How do I configure a client Java application which must request a token from an authorization server using a 'password' grant type?)







留言討論