def get_authorization_data(self, request):
        authorization = request.META.get('HTTP_AUTHORIZATION', '')

        if not authorization:
            raise ValueError('Authorization header missing or empty.')

        try:
            auth_type, data = authorization.split(' ', 1)
        except:
            raise ValueError('Authorization header must have a space separating auth_type and data.')

        if auth_type.lower() != self.auth_type:
            raise ValueError('auth_type is not "%s".' % self.auth_type)

        return data
Verifies that the HTTP Authorization header has the right auth type
dataset/ETHPy150Open django-tastypie/django-tastypie/tastypie/authentication.py/Authentication.get_authorization_data