Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.springframework.http.HttpHeaders
- import org.springframework.http.MediaType
- import org.springframework.web.reactive.function.BodyInserters
- import org.springframework.web.reactive.function.client.WebClient
- import reactor.core.publisher.Mono
- fun revokeToken(accessToken: String, clientId: String): Mono<Void> {
- val client = WebClient.create("https://api/revoke") // Replace with actual revoke endpoint
- val body = BodyInserters.fromFormData("token", accessToken)
- .with("token_type_hint", "access_token")
- .with("client_id", clientId)
- return client.post()
- .contentType(MediaType.APPLICATION_FORM_URLENCODED)
- .body(body)
- .retrieve()
- .toBodilessEntity()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement