Return the "Authorization" HTTP header value to use for this URL.
334943
def negotiate_header(url):
    
    hostname = urlparse(url).hostname
    _, krb_context = kerberos.authGSSClientInit('HTTP@%s' % hostname)
    # authGSSClientStep goes over the network to the KDC (ie blocking).
    yield threads.deferToThread(kerberos.authGSSClientStep,
                                krb_context, '')
    negotiate_details = kerberos.authGSSClientResponse(krb_context)
    defer.returnValue('Negotiate ' + negotiate_details)
989137
def make_auth_headers(self, content_type):
        """"""
        headers = self.make_headers(content_type)
        headers['Authorization'] = 'Basic {}'.format(self.get_auth_string())
        return headers
1361549
public java.lang.String getAuthorizationUrl() {
    java.lang.Object ref = authorizationUrl_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      authorizationUrl_ = s;
      return s;
    }
  }
1029753
def headers(self, url):
        
        if self._token and url.lower().startswith('https'):
            return {'Authorization': 'Bearer {}'.format(self._token)}
        else:
            return None
899803
def info_authn(self):
        
        authz_header = request.headers.get('Authorization', '[none]')
        if (not authz_header.startswith('Bearer ')):
            return False
        token = authz_header[7:]
        return self.access_token_valid(
            token, "info_authn: Authorization header")
873498
def get_request(self, request):
        """"""
        request.headers['authenticate'] = {
            'username': self.username,
            'apiKey': self.api_key,
        }
        return request
659125
def get_req(url):
    """"""
    request = urllib.request.Request(url)
    request.add_header('Authorization', 'token %s' % API_TOKEN)
    try:
        response = urllib.request.urlopen(request).read().decode('utf-8')
        return response
    except urllib.error.HTTPError:
        exception()
        sys.exit(0)
835554
def _default_headers(self):
        """"""
        headers = {
            "Authorization": 'Bearer {}'.format(self.api_key),
            "User-agent": self.useragent,
            "Accept": 'application/json'
        }
        if self.impersonate_subuser:
            headers['On-Behalf-Of'] = self.impersonate_subuser

        return headers
546313
def get_authorization_header(request):
    
    auth = request.META.get('HTTP_AUTHORIZATION', b'')

    if isinstance(auth, type('')):
        # Work around django test client oddness
        auth = auth.encode('iso-8859-1')

    return auth
367062
def _http_headers(self):
        
        if not self.usertag:
            return {}

        creds = u'{}:{}'.format(
            self.usertag,
            self.password or ''
        )
        token = base64.b64encode(creds.encode())
        return {
            'Authorization': 'Basic {}'.format(token.decode())
        }
747793
def _get_auth_header(self):
        '''  '''
        realm = 'realm="{realm}"'.format(realm=self.realm)
        params = ['{k}="{v}"'.format(k=k, v=quote(str(v), safe=''))
                  for k, v in self.oauth_params.items()]
        return 'OAuth ' + ','.join([realm] + params)
857283
def getHeaders(self):
        
        basicauth = base64.encodestring(b(self.user + ':' + self.password)).strip()
        return {
            "Depth": "1",
            "Authorization": 'Basic ' + _decode_utf8(basicauth),
            "Accept": "*/*"
        }
1060482
def extract_access_token(request):
    
    auth_header = request.META.get('HTTP_AUTHORIZATION', '')

    if re.compile('^[Bb]earer\s{1}.+$').match(auth_header):
        access_token = auth_header.split()[1]
    else:
        access_token = request.GET.get('access_token', '')

    return access_token
745401
def authentication_url(self):
        """"""
        params = {
            'client_id': self.client_id,
            'response_type': self.type,
            'redirect_uri': self.callback_url
        }
        return AUTHENTICATION_URL + "?" + urlencode(params)
665077
private String getAuthHeader() {
        String base64ClientIdSec = DatatypeConverter.printBase64Binary((oauth2Config.getClientId() + ":" + oauth2Config.getClientSecret()).getBytes());
        return "Basic " + base64ClientIdSec;
    }
429822
def get_header(self, name, default=None):
        
        return self._handler.headers.get(name, default)
1109603
def __get_basic_auth_header(self):
        
        if self.secret_key is None:
            return {}

        # encode/decode for py2/py3 compatibility
        auth_b64 = "%s:%s" % (self.client_id, self.secret_key)
        auth_b64 = base64.b64encode(auth_b64.encode('utf-8'))
        auth_b64 = auth_b64.decode('utf-8')

        return {'Authorization': 'Basic %s' % auth_b64}