sets the Web Site HTTP Authentication service.
514519
def set_http_service(domain = nil, username = nil, password = nil)
      self.domain    = domain
      self.user_name = username
      self.password  = password
      self.service   = Credential::Service::HTTP
    end
296704
@Nonnull
  public final UnifiedResponse setStatusUnauthorized (@Nullable final String sAuthenticate)
  {
    _setStatus (HttpServletResponse.SC_UNAUTHORIZED);
    if (StringHelper.hasText (sAuthenticate))
      m_aResponseHeaderMap.setHeader (CHttpHeader.WWW_AUTHENTICATE, sAuthenticate);
    return this;
  }
223411
public function setAuthenticationScopes()
    {

        $scopes = $this->verifyToken()['Scopes'];

        // Add the internal 'public' scope
        $scopes = $scopes . ' public';
        $this->authentication->scopes = explode(' ', $scopes);
    }
282322
@VisibleForTesting
  void setAuthenticationHeaders(Object soapClient, Map<String, Object> headerElements,
      AdWordsSession adWordsSession) throws AuthenticationException {
    authorizationHeaderHandler.setAuthorization(soapClient, adWordsSession);
  }
1253446
def authenticate(self):
        
        if request.headers.get('Authorization') or request.args.get('access_token'):
            realm = 'Bearer realm="%s", error="invalid_token"' % __package__
        else:
            realm = 'Bearer realm="%s"' % __package__
        resp = Response(None, 401, {'WWW-Authenticate': realm})
        abort(401, description='Please provide proper credentials', response=resp)
1350712
def set_webhook(self, *args, **kwargs):
        """"""
        return set_webhook(*args, **self._merge_overrides(**kwargs)).run()
6707
def set_basic_auth(self, username, password, realm):
    
    self._passmgr.add_password(realm, self._base_url, username, password)
    return self
804639
def addSSLService(self):
        ""
        https_port = self.options['https_port']
        self.tls_service = HendrixTCPServiceWithTLS(https_port, self.hendrix.site, self.key, self.cert,
                                                    self.context_factory, self.context_factory_kwargs)
        self.tls_service.setServiceParent(self.hendrix)
985258
def authenticate(api_key, api_url, **kwargs):
    """"""

    muddle = Muddle(**kwargs)

    # Login.
    muddle.authenticate(api_key, api_url)
    return muddle
563219
def _setup_http_session(self):
        
        headers = {"Content-type": "application/json"}
        if (self._id_token):
            headers.update({"authorization": "Bearer {}".format(
                self._id_token)})
        self._session.headers.update(headers)
        # TODO is this unsafe????
        self._session.verify = False
811682
private void requestAuthorization(HttpServletResponse resp) throws IOException {

        // Authorisation is required for the requested action.
        resp.setHeader(CmsRequestUtil.HEADER_WWW_AUTHENTICATE, "Basic realm=\"" + BASIC_REALM + "\"");

        resp.sendError(HttpServletResponse.SC_UNAUTHORIZED);
    }
1207178
def set_basic_auth(self, username, password):
        
        from requests.auth import HTTPBasicAuth
        self.auth = HTTPBasicAuth(username, password)
        return self
219363
def set_basic_auth(self, username, password):
        """"""
        credentials = str(b64encode('{}:{}'.format(username, password).encode('utf-8')), 'utf-8')
        self.authorization = 'Basic {}'.format(credentials)
975086
public Principal authenticate(String username,
                                  Object credentials,
                                  HttpRequest request)
    {
        KnownUser user;
        synchronized (this)
        {
            user = (KnownUser)super.get(username);
        }
        if (user==null)
            return null;

        if (user.authenticate(credentials))
            return user;
        
        return null;
    }
471302
def SetCredentials(api_username,api_passwd):
	""""""
	global V2_API_USERNAME
	global V2_API_PASSWD
	global _V2_ENABLED
	_V2_ENABLED = True
	V2_API_USERNAME = api_username
	V2_API_PASSWD = api_passwd
71634
private void addHttpBasicAuth(final ChannelHandlerContext ctx, final HttpRequest request) {
    ByteBuf raw = ctx.alloc().buffer(username.length() + password.length() + 1);
    raw.writeBytes((username + ":" + password).getBytes(CharsetUtil.UTF_8));
    ByteBuf encoded = Base64.encode(raw, false);
    request.headers().add(HttpHeaders.Names.AUTHORIZATION, "Basic " + encoded.toString(CharsetUtil.UTF_8));
    encoded.release();
    raw.release();
  }
513963
def add_http_basic_auth(url,
                        user=None,
                        password=None,
                        https_only=False):
    '''
    
    '''
    if user is None and password is None:
        return url
    else:
        urltuple = urlparse(url)
        if https_only and urltuple.scheme != 'https':
            raise ValueError('Basic Auth only supported for HTTPS')
        if password is None:
            netloc = '{0}@{1}'.format(
                user,
                urltuple.netloc
            )
            urltuple = urltuple._replace(netloc=netloc)
            return urlunparse(urltuple)
        else:
            netloc = '{0}:{1}@{2}'.format(
                user,
                password,
                urltuple.netloc
            )
            urltuple = urltuple._replace(netloc=netloc)
            return urlunparse(urltuple)