'Get unscoped token from VOMS proxy'

def _get_unscoped_token(self):

    data = {'auth': {'voms': True}}
    reqbody = json.dumps(data)
    response = self.request('/v2.0/tokens', data=reqbody, headers={'Content-Type': 'application/json'}, method='POST')
    if (response.status == httplib.UNAUTHORIZED):
        raise InvalidCredsError()
    elif (response.status in [httplib.OK, httplib.CREATED]):
        try:
            body = json.loads(response.body)
            return body['access']['token']['id']
        except Exception:
            e = sys.exc_info()[1]
            raise MalformedResponseError('Failed    to    parse    JSON', e)
    else:
        raise MalformedResponseError('Malformed    response', driver=self.driver)
