spring-cloud/spring-cloud-gateway

Allow setting the refresh token clock skew

開放

#2,079 建立於 2020年12月15日

 (1 則留言) (0 個反應) (0 位負責人)Java (3,204 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (4,284 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Describe the bug Spring Cloud Gateway didn't support refresh token until last milestone. (https://spring.io/blog/2020/11/18/spring-cloud-2020-0-0-m5-aka-ilford-is-available) I upgraded my project to support and use refresh token, and now i am using TokenRelay filter in spring-cloud-gateway, not in spring-cloud-security. But, access token is refreshed at every request although access token is not expired.

Sample Here is the sample log in my first request

2020-12-15 14:08:16.036 TRACE 10828 --- [ioEventLoop-7-2] o.s.w.r.f.client.ExchangeFunctions : [5bbf4c1f] HTTP POST http://localhost:8443/cas/oauth2.0/accessToken, headers={masked} 2020-12-15 14:08:16.041 TRACE 10828 --- [ctor-http-nio-8] o.s.http.codec.FormHttpMessageWriter : [5bbf4c1f] Writing form fields [grant_type, code, redirect_uri] (content masked) 2020-12-15 14:08:17.328 TRACE 10828 --- [ctor-http-nio-8] o.s.http.codec.json.Jackson2JsonDecoder : [5bbf4c1f] Decoded [{access_token=eyJ***.ey***.dD***, refresh_token=RT-2-b0yk***, token_type=bearer, expires_in=60, scope=custom_mod}]

the access token will expires in 60 seconds as you can see in log. But it is refreshing before expired.

2020-12-15 14:08:21.920 TRACE 10828 --- [ioEventLoop-7-2] o.s.w.r.f.client.ExchangeFunctions : [7a6b8bbd] HTTP POST http://localhost:8443/cas/oauth2.0/accessToken, headers={masked} 2020-12-15 14:08:21.922 TRACE 10828 --- [ctor-http-nio-8] o.s.http.codec.FormHttpMessageWriter : [7a6b8bbd] Writing form fields [grant_type, refresh_token] (content masked) 2020-12-15 14:08:22.737 TRACE 10828 --- [ctor-http-nio-8] o.s.http.codec.json.Jackson2JsonDecoder : [7a6b8bbd] Decoded [{access_token=ey***.ey***.5O***, token_type=bearer, expires_in=60, scope=custom_mod}]

貢獻者指南