use of com.vmware.photon.controller.model.resources.SessionService.SessionState in project photon-model by vmware.
the class SessionUtil method retrieveExternalToken.
public static DeferredResult<AuthCredentialsServiceState> retrieveExternalToken(Service service, AuthorizationContext ctx) {
return service.sendWithDeferredResult(Operation.createGet(buildSessionURI(service, ctx)), SessionState.class).thenApply(sessionState -> {
AuthCredentialsServiceState creds = new AuthCredentialsServiceState();
creds.privateKey = sessionState.externalToken;
return creds;
});
}
Aggregations