use of org.platformlayer.auth.model.CheckServiceAccessResponse in project platformlayer by platformlayer.
the class ServicesResource method checkServiceAccess.
@POST
@Path("check")
public CheckServiceAccessResponse checkServiceAccess(CheckServiceAccessRequest request) {
try {
requireSystemAccess();
} catch (AuthenticatorException e) {
log.warn("Error while checking system token", e);
throwInternalError();
}
ServiceAccountEntity serviceAccount = null;
try {
serviceAccount = systemAuthenticator.authenticate(request.chain);
} catch (AuthenticatorException e) {
log.warn("Error while authenticating chain", e);
throwInternalError();
}
CheckServiceAccessResponse response = new CheckServiceAccessResponse();
if (serviceAccount != null) {
response.serviceAccount = serviceAccount.subject;
}
return response;
}
Aggregations