Skip to content

Commit e092c78

Browse files
committed
Fix client credentials grant token invalidation
- Fixes gh-1335 - Cherry-picked from 5.x.x branch (6c81106) Signed-off-by: Daniel Garnier-Moiroux <daniel.garnier-moiroux@broadcom.com>
1 parent badb304 commit e092c78

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/tokenprovider/AbstractUaaTokenProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public abstract class AbstractUaaTokenProvider implements TokenProvider {
7474

7575
private static final ZoneId UTC = ZoneId.of("UTC");
7676

77-
private final ConcurrentMap<ConnectionContext, Mono<String>> accessTokens =
77+
protected final ConcurrentMap<ConnectionContext, Mono<String>> accessTokens =
7878
new ConcurrentHashMap<>(1);
7979

8080
private final ConcurrentMap<ConnectionContext, RefreshToken> refreshTokenStreams =

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/tokenprovider/_ClientCredentialsGrantTokenProvider.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.cloudfoundry.reactor.tokenprovider;
1818

19+
import org.cloudfoundry.reactor.ConnectionContext;
1920
import org.cloudfoundry.reactor.TokenProvider;
2021
import org.immutables.value.Value;
2122
import reactor.netty.http.client.HttpClientForm;
@@ -36,4 +37,9 @@ void tokenRequestTransformer(HttpClientRequest request, HttpClientForm form) {
3637
.attr("response_type", "token");
3738
}
3839

40+
@Override
41+
public void invalidate(ConnectionContext connectionContext) {
42+
this.accessTokens.remove(connectionContext);
43+
}
44+
3945
}

0 commit comments

Comments
 (0)