class ServiceAuthenticationServiceImpl implements ServiceAuthenticationService {

    public Authentication getAuthentication(InstanceInfo instanceInfo) {
        final Map<String, String> metadata = instanceInfo.getMetadata();

        final Authentication out = new Authentication();
        out.setApplid(metadata.get(AUTHENTICATION_APPLID));
        out.setScheme(AuthenticationScheme.fromScheme(metadata.get(AUTHENTICATION_SCHEME)));
        return out;
    }

}