Search in sources :

Example 1 with CheckTokenResponse

use of org.cloudfoundry.uaa.tokens.CheckTokenResponse in project cf-java-client by cloudfoundry.

the class ReactorTokens method check.

@Override
public Mono<CheckTokenResponse> check(CheckTokenRequest request) {
    return post(request, CheckTokenResponse.class, builder -> builder.pathSegment("check_token"), outbound -> outbound.map(r -> {
        String encoded = Base64.getEncoder().encodeToString(new AsciiString(request.getClientId()).concat(":").concat(request.getClientSecret()).toByteArray());
        r.requestHeaders().set(AUTHORIZATION, BASIC_PREAMBLE + encoded);
        return r;
    })).checkpoint();
}
Also used : GetTokenByOneTimePasscodeRequest(org.cloudfoundry.uaa.tokens.GetTokenByOneTimePasscodeRequest) GetTokenKeyResponse(org.cloudfoundry.uaa.tokens.GetTokenKeyResponse) ResponseType(org.cloudfoundry.uaa.ResponseType) CLIENT_CREDENTIALS(org.cloudfoundry.uaa.tokens.GrantType.CLIENT_CREDENTIALS) AsciiString(io.netty.util.AsciiString) PASSWORD(org.cloudfoundry.uaa.tokens.GrantType.PASSWORD) GetTokenByAuthorizationCodeResponse(org.cloudfoundry.uaa.tokens.GetTokenByAuthorizationCodeResponse) GetTokenByAuthorizationCodeRequest(org.cloudfoundry.uaa.tokens.GetTokenByAuthorizationCodeRequest) GetTokenKeyRequest(org.cloudfoundry.uaa.tokens.GetTokenKeyRequest) GetTokenByClientCredentialsResponse(org.cloudfoundry.uaa.tokens.GetTokenByClientCredentialsResponse) GetTokenByOneTimePasscodeResponse(org.cloudfoundry.uaa.tokens.GetTokenByOneTimePasscodeResponse) AUTHORIZATION_CODE(org.cloudfoundry.uaa.tokens.GrantType.AUTHORIZATION_CODE) AbstractUaaOperations(org.cloudfoundry.reactor.uaa.AbstractUaaOperations) CheckTokenRequest(org.cloudfoundry.uaa.tokens.CheckTokenRequest) RefreshTokenResponse(org.cloudfoundry.uaa.tokens.RefreshTokenResponse) Mono(reactor.core.publisher.Mono) Tokens(org.cloudfoundry.uaa.tokens.Tokens) GetTokenByOpenIdResponse(org.cloudfoundry.uaa.tokens.GetTokenByOpenIdResponse) GetTokenByPasswordResponse(org.cloudfoundry.uaa.tokens.GetTokenByPasswordResponse) RefreshTokenRequest(org.cloudfoundry.uaa.tokens.RefreshTokenRequest) GetTokenByPasswordRequest(org.cloudfoundry.uaa.tokens.GetTokenByPasswordRequest) ListTokenKeysRequest(org.cloudfoundry.uaa.tokens.ListTokenKeysRequest) CheckTokenResponse(org.cloudfoundry.uaa.tokens.CheckTokenResponse) GetTokenByClientCredentialsRequest(org.cloudfoundry.uaa.tokens.GetTokenByClientCredentialsRequest) TokenProvider(org.cloudfoundry.reactor.TokenProvider) ListTokenKeysResponse(org.cloudfoundry.uaa.tokens.ListTokenKeysResponse) Base64(java.util.Base64) HttpClientRequest(reactor.ipc.netty.http.client.HttpClientRequest) CONTENT_TYPE(io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE) APPLICATION_X_WWW_FORM_URLENCODED(io.netty.handler.codec.http.HttpHeaderValues.APPLICATION_X_WWW_FORM_URLENCODED) REFRESH_TOKEN(org.cloudfoundry.uaa.tokens.GrantType.REFRESH_TOKEN) ConnectionContext(org.cloudfoundry.reactor.ConnectionContext) GetTokenByOpenIdRequest(org.cloudfoundry.uaa.tokens.GetTokenByOpenIdRequest) AUTHORIZATION(io.netty.handler.codec.http.HttpHeaderNames.AUTHORIZATION) AsciiString(io.netty.util.AsciiString) CheckTokenResponse(org.cloudfoundry.uaa.tokens.CheckTokenResponse) AsciiString(io.netty.util.AsciiString)

Aggregations

AUTHORIZATION (io.netty.handler.codec.http.HttpHeaderNames.AUTHORIZATION)1 CONTENT_TYPE (io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE)1 APPLICATION_X_WWW_FORM_URLENCODED (io.netty.handler.codec.http.HttpHeaderValues.APPLICATION_X_WWW_FORM_URLENCODED)1 AsciiString (io.netty.util.AsciiString)1 Base64 (java.util.Base64)1 ConnectionContext (org.cloudfoundry.reactor.ConnectionContext)1 TokenProvider (org.cloudfoundry.reactor.TokenProvider)1 AbstractUaaOperations (org.cloudfoundry.reactor.uaa.AbstractUaaOperations)1 ResponseType (org.cloudfoundry.uaa.ResponseType)1 CheckTokenRequest (org.cloudfoundry.uaa.tokens.CheckTokenRequest)1 CheckTokenResponse (org.cloudfoundry.uaa.tokens.CheckTokenResponse)1 GetTokenByAuthorizationCodeRequest (org.cloudfoundry.uaa.tokens.GetTokenByAuthorizationCodeRequest)1 GetTokenByAuthorizationCodeResponse (org.cloudfoundry.uaa.tokens.GetTokenByAuthorizationCodeResponse)1 GetTokenByClientCredentialsRequest (org.cloudfoundry.uaa.tokens.GetTokenByClientCredentialsRequest)1 GetTokenByClientCredentialsResponse (org.cloudfoundry.uaa.tokens.GetTokenByClientCredentialsResponse)1 GetTokenByOneTimePasscodeRequest (org.cloudfoundry.uaa.tokens.GetTokenByOneTimePasscodeRequest)1 GetTokenByOneTimePasscodeResponse (org.cloudfoundry.uaa.tokens.GetTokenByOneTimePasscodeResponse)1 GetTokenByOpenIdRequest (org.cloudfoundry.uaa.tokens.GetTokenByOpenIdRequest)1 GetTokenByOpenIdResponse (org.cloudfoundry.uaa.tokens.GetTokenByOpenIdResponse)1 GetTokenByPasswordRequest (org.cloudfoundry.uaa.tokens.GetTokenByPasswordRequest)1