Search in sources :

Example 1 with GetAutoLoginAuthenticationCodeRequest

use of org.cloudfoundry.uaa.serverinformation.GetAutoLoginAuthenticationCodeRequest in project cf-java-client by cloudfoundry.

the class ReactorServerInformation method getAuthenticationCode.

@Override
public Mono<GetAutoLoginAuthenticationCodeResponse> getAuthenticationCode(GetAutoLoginAuthenticationCodeRequest request) {
    return post(request, GetAutoLoginAuthenticationCodeResponse.class, builder -> builder.pathSegment("autologin"), 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 : GetAutoLoginAuthenticationCodeResponse(org.cloudfoundry.uaa.serverinformation.GetAutoLoginAuthenticationCodeResponse) IdentityZones(org.cloudfoundry.uaa.identityzones.IdentityZones) AsciiString(io.netty.util.AsciiString) AutoLoginRequest(org.cloudfoundry.uaa.serverinformation.AutoLoginRequest) Mono(reactor.core.publisher.Mono) TokenProvider(org.cloudfoundry.reactor.TokenProvider) Base64(java.util.Base64) ServerInformation(org.cloudfoundry.uaa.serverinformation.ServerInformation) GetInfoResponse(org.cloudfoundry.uaa.serverinformation.GetInfoResponse) GetInfoRequest(org.cloudfoundry.uaa.serverinformation.GetInfoRequest) ConnectionContext(org.cloudfoundry.reactor.ConnectionContext) AbstractUaaOperations(org.cloudfoundry.reactor.uaa.AbstractUaaOperations) GetAutoLoginAuthenticationCodeRequest(org.cloudfoundry.uaa.serverinformation.GetAutoLoginAuthenticationCodeRequest) AUTHORIZATION(io.netty.handler.codec.http.HttpHeaderNames.AUTHORIZATION) GetAutoLoginAuthenticationCodeResponse(org.cloudfoundry.uaa.serverinformation.GetAutoLoginAuthenticationCodeResponse) AsciiString(io.netty.util.AsciiString) AsciiString(io.netty.util.AsciiString)

Aggregations

AUTHORIZATION (io.netty.handler.codec.http.HttpHeaderNames.AUTHORIZATION)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 IdentityZones (org.cloudfoundry.uaa.identityzones.IdentityZones)1 AutoLoginRequest (org.cloudfoundry.uaa.serverinformation.AutoLoginRequest)1 GetAutoLoginAuthenticationCodeRequest (org.cloudfoundry.uaa.serverinformation.GetAutoLoginAuthenticationCodeRequest)1 GetAutoLoginAuthenticationCodeResponse (org.cloudfoundry.uaa.serverinformation.GetAutoLoginAuthenticationCodeResponse)1 GetInfoRequest (org.cloudfoundry.uaa.serverinformation.GetInfoRequest)1 GetInfoResponse (org.cloudfoundry.uaa.serverinformation.GetInfoResponse)1 ServerInformation (org.cloudfoundry.uaa.serverinformation.ServerInformation)1 Mono (reactor.core.publisher.Mono)1