sets the Authorization  header for the request
@param authorizationValue   : header field value to add
@return : Request Object with authorization header value set
493361
public Request authorization(String authorizationValue){
        final String authorization = RequestHeaderFields.AUTHORIZATION.getName();
        return this.setHeader(authorization, authorizationValue);
    }
659214
def get_jwt(self, request):
        
        try:
            authorization = request.authorization
        except ValueError:
            return None
        if authorization is None:
            return None
        authtype, token = authorization
        if authtype.lower() != self.auth_header_prefix.lower():
            return None
        return token
1095384
def _auth_header(self, type, **options):
        """"""
        return '%s %s' % (type.title(), ', '.join((
            '%s=%s' % (key, quote_header_value(
                value, allow_token=key not in _require_quoting))
            for key, value in options.items()
        )))
42940
def set_authorization_password(self, password):
        
        self.authorization_password = password
        self.changed_event.emit(self)
358636
public BaseServerResponseException addResponseHeader(String theName, String theValue) {
		Validate.notBlank(theName, "theName must not be null or empty");
		Validate.notBlank(theValue, "theValue must not be null or empty");
		if (getResponseHeaders().containsKey(theName) == false) {
			getResponseHeaders().put(theName, new ArrayList<>());
		}
		getResponseHeaders().get(theName).add(theValue);
		return this;
	}
54383
public HttpMessage header(final String headerName, final Object headerValue) {
        return (HttpMessage) super.setHeader(headerName, headerValue);
    }
230491
public void setAuthorizationRules(java.util.Collection<AuthorizationRule> authorizationRules) {
        if (authorizationRules == null) {
            this.authorizationRules = null;
            return;
        }

        this.authorizationRules = new com.amazonaws.internal.SdkInternalList<AuthorizationRule>(authorizationRules);
    }
575666
private void authorizationRequestSend(final Context context, String path, AuthorizationRequestManager.RequestOptions options, ResponseListener listener) {
        try {
            AuthorizationRequestManager authorizationRequestManager = new AuthorizationRequestManager();
            authorizationRequestManager.initialize(context, listener);
            authorizationRequestManager.sendRequest(path, options);
        } catch (Exception e) {
            throw new RuntimeException("Failed to send authorization request", e);
        }
    }
960403
public static void addAuthorizationHeader(URLConnection urlConnection, String header) {
        if (header != null) {
            urlConnection.setRequestProperty(AUTHORIZATION_HEADER, header);
        }
    }
1198703
@Override
    public void addRequestHeader(String headerName, String headerValue) {
        addRequestHeader(new Header(headerName, headerValue));
    }
920649
def HeaderAuthSourceInitializer(
    secret,
    salt='sanity.header.'
):
    

    @implementer(IAuthSourceService)
    class HeaderAuthSource(object):
        vary = ['Authorization']

        def __init__(self, context, request):
            self.request = request
            self.cur_val = None

            serializer = JSONSerializer()
            self.serializer = SignedSerializer(
                secret,
                salt,
                serializer=serializer,
                )

        def _get_authorization(self):
            try:
                type, token = self.request.authorization

                return self.serializer.loads(token)
            except Exception:
                return None

        def _create_authorization(self, value):
            try:
                return self.serializer.dumps(value)
            except Exception:
                return ''

        def get_value(self):
            if self.cur_val is None:
                self.cur_val = self._get_authorization() or [None, None]

            return self.cur_val

        def headers_remember(self, value):
            if self.cur_val is None:
                self.cur_val = None

            token = self._create_authorization(value)
            auth_info = native_(b'Bearer ' + token, 'latin-1', 'strict')
            return [('Authorization', auth_info)]

        def headers_forget(self):
            if self.cur_val is None:
                self.cur_val = None

            return []

    return HeaderAuthSource
179662
public Request referer(String refererValue){
        final String referer = RequestHeaderFields.REFERER.getName();
        return this.setHeader(referer, refererValue);
    }
335161
def _add_bearer_token(self, uri, http_method='GET', body=None,
                          headers=None, token_placement=None):
        """"""
        if token_placement == AUTH_HEADER:
            headers = tokens.prepare_bearer_headers(self.access_token, headers)

        elif token_placement == URI_QUERY:
            uri = tokens.prepare_bearer_uri(self.access_token, uri)

        elif token_placement == BODY:
            body = tokens.prepare_bearer_body(self.access_token, body)

        else:
            raise ValueError("Invalid token placement.")
        return uri, headers, body
765094
def resolve(self, authorization: http.Header):
        
        from django_apistar.authentication.models import Token

        if authorization is None:
            return None

        scheme, token = authorization.split()
        if scheme.lower() != 'bearer':
            return None

        try:
            user = Token.objects.get(key=token).user
        except Token.DoesNotExist:
            return None

        return user
741483
def _encodeHeader(headerValue):
    
    try:
        return headerValue.encode('ascii', 'strict')
    except UnicodeError:
        encoded = headerValue.encode("utf-8")
        return header.Header(encoded, "UTF-8").encode()
428347
def set_auth_request(self, interface_id, address=None):
        
        self.interface.set_auth_request(interface_id, address)
        self._engine.update()
876527
public HttpAuthServiceBuilder addBasicAuth(Authorizer<? super BasicToken> authorizer, AsciiString header) {
        return addTokenAuthorizer(new BasicTokenExtractor(requireNonNull(header, "header")),
                                  requireNonNull(authorizer, "authorizer"));
    }