Adds an OAuth2 {@link Authorizer} for the given {@code header}.
166139
public HttpAuthServiceBuilder addOAuth2(Authorizer<? super OAuth2Token> authorizer, AsciiString header) {
        return addTokenAuthorizer(new OAuth2TokenExtractor(requireNonNull(header, "header")),
                                  requireNonNull(authorizer, "authorizer"));
    }
493361
public Request authorization(String authorizationValue){
        final String authorization = RequestHeaderFields.AUTHORIZATION.getName();
        return this.setHeader(authorization, authorizationValue);
    }
704288
public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) {
    for(Authentication auth : authentications.values()) {
      if (auth instanceof OAuth) {
        OAuth oauth = (OAuth) auth;
        oauth.getTokenRequestBuilder()
              .setClientId(clientId)
              .setClientSecret(clientSecret)
              .setRedirectURI(redirectURI);
        oauth.getAuthenticationRequestBuilder()
              .setClientId(clientId)
              .setRedirectURI(redirectURI);
        return;
      }
    }
  }
256277
@PUT
  @Path("{user}")
  @Consumes(MediaType.TEXT_PLAIN)
  public Response addUser(@PathParam("user") String username, @HeaderParam("Authorization") @DefaultValue("no token") String auth, String message) throws Exception {
    if(!this.isAuth(auth)) {
      throw new Exception("Unauthorized!");
    }
    if( realm != null ){
      AuthenticationManagerRequest req = new AuthenticationManagerRequest();
      req.setAccountName(username);
      req.setPassword(message);
      req.setRequestType(RequestType.ADD);
      
      sendMessage(req);
      return Response.created(new URI("")).build();
    }
    return Response.status(Status.NOT_FOUND).build();
  }
504003
private Map<String, String> getHttpHeaderStrong() throws Exception {
        
        final OAuthToken token = root.getOAuthTokenManager().getToken();
        
        if (token == null || token.getAccessToken().length() == 0 || token.getTokenType().length() == 0)
            throw new Exception ("OAuth token is not created (or is invalid) for strong authentication");
                
        return new HashMap<String, String>(){{
            put("Authorization", token.getTokenType() + " " + token.getAccessToken());
        }};
    }
46210
protected static HttpClientBuilder addAuthentication(final HttpClientBuilder builder, 
            final URI uri, final String username,
            String password) {
        if (isNotBlank(username)) {
            CredentialsProvider provider = new BasicCredentialsProvider();
            AuthScope scope = new AuthScope(uri.getHost(), uri.getPort(), "realm");
            UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(username, password);
            provider.setCredentials(scope, credentials);
            builder.setDefaultCredentialsProvider(provider);

            builder.addInterceptorFirst(new PreemptiveAuth());
        }
        return builder;
    }
1110145
def add_auth(f):
    """"""

    def add_auth_decorator(*args, **kwargs):
        token = get_user_token()
        if 'headers' not in kwargs:
            kwargs['headers'] = {}
        kwargs['headers']['Authorization'] = "Bearer %s" % token
        return f(*args, **kwargs)

    return add_auth_decorator
1206296
public static void authorize(Subject user, Class<?> protocol) 
  throws AuthorizationException {
    Permission permission = protocolToPermissionMap.get(protocol);
    if (permission == null) {
      permission = new ConnectionPermission(protocol);
      protocolToPermissionMap.put(protocol, permission);
    }
    
    checkPermission(user, permission);
  }
1252511
private void addProxyConfig(RequestConfig.Builder requestConfigBuilder, HttpClientSettings settings) {
        if (settings.isProxyEnabled() && settings.isAuthenticatedProxy() && settings.getProxyAuthenticationMethods() != null) {
            List<String> apacheAuthenticationSchemes = new ArrayList<String>();

            for (ProxyAuthenticationMethod authenticationMethod : settings.getProxyAuthenticationMethods()) {
                apacheAuthenticationSchemes.add(toApacheAuthenticationScheme(authenticationMethod));
            }

            requestConfigBuilder.setProxyPreferredAuthSchemes(apacheAuthenticationSchemes);
        }
    }
130370
public FoxHttpRequestBuilder addRequestHeader(HeaderEntry headerField) {
        foxHttpRequest.getRequestHeader().addHeader(headerField.getName(), headerField.getValue());
        return this;
    }
335191
public void addHeader(String key, String value) {
        if (key.equals("As-User")) {
            for (int i = 0; i < this.headers.size(); i++) {
                if (this.headers.get(i).getKey().equals("As-User")) {
                    this.headers.remove(i);
                }
            }
        }
        if (key.equals("X-Box-UA")) {
            throw new IllegalArgumentException("Altering the X-Box-UA header is not permitted");
        }
        this.headers.add(new RequestHeader(key, value));
    }
982624
public HttpClientVerifyBuilder withHeader(String header, Matcher<String> matcher) {
        ruleBuilder.addCondition(new HeaderCondition(header, matcher));
        return this;
    }
1178746
public RequestHeader withUri(URI uri) {
        return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, principal, headers, lowercaseHeaders);
    }
94692
public CustomHeadersInterceptor addHeader(String name, String value) {
        if (!this.headers.containsKey(name)) {
            this.headers.put(name, new ArrayList<String>());
        }
        this.headers.get(name).add(value);
        return this;
    }
178984
public RequestHeader withAcceptedResponseProtocols(PSequence<MessageProtocol> acceptedResponseProtocols) {
        return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, principal, headers, lowercaseHeaders);
    }
893515
public function addAuthorizer($authorizer)
    {
        if (!$authorizer instanceof LibBaseDomainAuthorizerAbstract) {
            if (is_string($authorizer) && strpos($authorizer, '.') === false) {
                //create identifier
                $identifier = clone $this->_repository->getIdentifier();
                $identifier->path = array('domain','authorizer');
                $identifier->name = $authorizer;
                register_default(array('identifier' => $identifier, 'prefix' => $this->_repository->getClone()));
            } else {
                $identifier = AnService::getIdentifier($authorizer);
            }

            $authorizer = $identifier;

            $authorizer = AnService::get($authorizer);
        }

        array_unshift($this->_authorizers, $authorizer);
    }
888685
public B addHeader(final String headerName, final String headerValue) {
        httpParams.addHeader(headerName, headerValue);
        return self();
    }