Authenticate against a RainMachine device.
761697
async def login(
        host: str,
        password: str,
        websession: ClientSession,
        *,
        port: int = 8080,
        ssl: bool = True,
        request_timeout: int = DEFAULT_TIMEOUT) -> Controller:
    """"""
    print('regenmaschine.client.login() is deprecated; see documentation!')
    client = Client(websession, request_timeout)
    await client.load_local(host, password, port, ssl)
    return next(iter(client.controllers.values()))
880397
def authenticate(credentials, sock_info):
    """"""
    mechanism = credentials.mechanism
    auth_func = _AUTH_MAP.get(mechanism)
    auth_func(credentials, sock_info)
1218542
def authenticated(viewfunc):
    """"""
    @wraps(viewfunc)
    def wrapper(*args, **kwargs):
        ctx = stack.top
        if ctx and hasattr(ctx, 'htauth'):
            auth_header = request.headers.get('Authorization', None)
            if not auth_header:
                return _unauthorized_response()

            if not auth_header.startswith('Basic '):
                raise RuntimeError('Flask-HTAuth supports only Basic auth.')

            auth_header = auth_header.replace('Basic ', '')
            auth_header = base64.b64decode(auth_header)
            username, password = auth_header.split(':', 1)

            if not username in ctx.htauth['users']:
                return _unauthorized_response()

            if not check_password(password, ctx.htauth['users'][username]):
                return _unauthorized_response()

            g.htauth_user = username

        return viewfunc(*args, **kwargs)

    return wrapper
96568
def authenticate(user=None):  # noqa: E501
    
    if connexion.request.is_json:
        user = UserAuth.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'
478208
async def login(
            self, stage_1_access_token: str, sprinkler_id: str,
            password: str) -> None:
        """"""
        auth_resp = await self._client_request(
            'post',
            'https://my.rainmachine.com/devices/login-sprinkler',
            access_token=stage_1_access_token,
            json={
                'sprinklerId': sprinkler_id,
                'pwd': password,
            })

        self._access_token = auth_resp['access_token']
        self._host = URL_BASE_REMOTE.format(sprinkler_id)
568997
def authenticate(self, username="", password="", **kwargs):
        """"""
        try:
            user = get_user_model().objects.filter(email__iexact=username)[0]
            if check_password(password, user.password):
                return user
            else:
                return None
        except IndexError:
            # No user was found, return None - triggers default login failed
            return None
915867
def authenticate(self):
        ''''''

        if not hasattr(self, 'client'):
            self.client = uservoice.Client(self.subdomain,
                                           self.api_key,
                                           self.api_secret)
711477
def _authenticate(self):
        """"""
        self.cleanup_headers()
        url = LOGIN_ENDPOINT
        data = self.query(
            url,
            method='POST',
            extra_params={
                'email': self.__username,
                'password': self.__password
            })

        if isinstance(data, dict) and data.get('success'):
            data = data.get('data')
            self.authenticated = data.get('authenticated')
            self.country_code = data.get('countryCode')
            self.date_created = data.get('dateCreated')
            self.__token = data.get('token')
            self.userid = data.get('userId')

            # update header with the generated token
            self.__headers['Authorization'] = self.__token
850253
def authenticate(self):
        """"""
        if self.__token:
            try:
                resp = self._refresh_token()
            except exceptions.TVDBRequestException as err:
                # if a 401 is the cause try to login
                if getattr(err.response, 'status_code', 0) == 401:
                    resp = self._login()
                else:
                    raise
        else:
            resp = self._login()

        self.__token = resp.get('token')
        self._token_timer = timeutil.utcnow()
476815
def authenticationRequest():
    """"""
    a = TpPd(pd=0x5)
    b = MessageType(mesType=0x12)  # 00010010
    c = CiphKeySeqNrAndSpareHalfOctets()
    d = AuthenticationParameterRAND()
    packet = a / b / c / d
    return packet
195364
def _verify_authentication(self, handler, args, kwargs):
        
        if not self.user_manager.session_logged_in():
            raise APIForbidden()
        return handler(*args, **kwargs)
885683
def authenticate(self, callback=None):
        '''
        
        '''
        # if an auth is in flight-- and not done-- just pass that back as the future to wait on
        if hasattr(self, '_authenticate_future') and not self._authenticate_future.done():
            future = self._authenticate_future
        else:
            future = tornado.concurrent.Future()
            self._authenticate_future = future
            self.io_loop.add_callback(self._authenticate)

        if callback is not None:
            def handle_future(future):
                response = future.result()
                self.io_loop.add_callback(callback, response)
            future.add_done_callback(handle_future)

        return future
1324992
def authenticate_glance_admin(self, keystone, force_v1_client=False):
        """"""
        self.log.debug('Authenticating glance admin...')
        ep = keystone.service_catalog.url_for(service_type='image',
                                              interface='adminURL')
        if not force_v1_client and keystone.session:
            return glance_clientv2.Client("2", session=keystone.session)
        else:
            return glance_client.Client(ep, token=keystone.auth_token)
486991
def authenticate(timestamp_grace = 600)
      raise ArgumentError, "Block required" unless block_given?
      key = @auth_hash['auth_key']
      raise AuthenticationError, "Missing parameter: auth_key" unless key
      token = yield key
      unless token
        raise AuthenticationError, "Unknown auth_key"
      end
      authenticate_by_token!(token, timestamp_grace)
      return token
    end
14485
private function authenticate()
    {
        self::assertValidAuthType();

        $this->client
            ->getEmitter()
            ->attach(new $this->authenticators[$this->authType]($this));
    }
455542
def authenticate(self, api_key):
        """"""
        self._api_key = api_key

        # Attach auth to session.
        self._session.auth = ('', self._api_key)

        return self._verify_api_key()
846925
def authenticate(self, dn='', password=''):
        
        try:
            self.connection.simple_bind_s(dn, password)
        except tuple(self.failed_authentication_exceptions):
            return False
        else:
            return True