:returns: Account provided as the authenticating account
        :rtype: AccountContext
430220
def account(self):
        
        if self._account is None:
            self._account = AccountContext(self, self.domain.twilio.account_sid)
        return self._account
1040914
def login(self):
        
        auth_data = dict()
        auth_data['apikey'] = self.api_key
        auth_data['username'] = self.username
        auth_data['userkey'] = self.account_identifier

        auth_resp = requests_util.run_request('post', self.API_BASE_URL + '/login', data=json.dumps(auth_data),
                                              headers=self.__get_header())

        if auth_resp.status_code == 200:
            auth_resp_data = self.parse_raw_response(auth_resp)
            self.__token = auth_resp_data['token']
            self.__auth_time = datetime.now()
            self.is_authenticated = True
        else:
            raise AuthenticationFailedException('Authentication failed!')
1310666
def get_account_details(self, account):
        
        result = {}
        try:
            luser = self._get_account(account.username)
            luser = preload(luser, database=self._database)
        except ObjectDoesNotExist:
            return result

        for i, j in luser.items():
            if i != 'userPassword' and j is not None:
                result[i] = j

        return result
957213
def authenticate(self, username=None, password=None, **kwargs):
        
        try:
            user = User.objects.get(email=username)
            if user.check_password(password):
                return user
        except (User.DoesNotExist, User.MultipleObjectsReturned):
            logging.warning('Unsuccessful login attempt using username/email: {0}'.format(username))

        return None
718052
public static Authentication getCurrentAuthentication() {
        RequestContext context = RequestContext.getCurrent();
        if (context != null) {
            return getAuthentication(context.getRequest());
        } else {
            return null;
        }
    }
910483
def get(self, sid):
        
        return KeyContext(self._version, account_sid=self._solution['account_sid'], sid=sid, )
1361636
def get(self):
        
        return EngagementContextContext(
            self._version,
            flow_sid=self._solution['flow_sid'],
            engagement_sid=self._solution['engagement_sid'],
        )
1015271
def get_account_details(self):
        
        return self.make_api_request(
            'Account',
            'getAccountDetails',
            utils.get_kwargs(locals()),
            model=models.AccountDetailsResponse,
        )
708122
def get_account(self, username):
        
        try:
            account = self.model.objects.get(
                **self._filter_user_by(username)
            )
        except self.model.DoesNotExist:
            return None
        return account
1059039
def get_account(self, account):
        
        selector = account.to_selector()
        resp = self.request_single('GetAccount', {'account': selector})
        return zobjects.Account.from_dict(resp)
840271
def acc_security(self):
        
        if self._acc_security is None:
            self._acc_security = AccSecurity(self)
        return self._acc_security
1244235
def authenticate(self):
        
        resp = self.session.get(self.api_url, auth=self.auth)
        resp = self._process_response(resp)
        return resp
986351
def get(self, sid):
        
        return QueueContext(self._version, account_sid=self._solution['account_sid'], sid=sid, )
145211
def authenticate_credentials(self, userid, password):
        
        credentials = {
            get_user_model().USERNAME_FIELD: userid,
            'password': password
        }
        user = authenticate(**credentials)

        if user is None:
            raise exceptions.AuthenticationFailed(_('Invalid username/password.'))

        if not user.is_active:
            raise exceptions.AuthenticationFailed(_('User inactive or deleted.'))

        return (user, None)
1316034
def account(self, id):
        
        id = self.__unpack_id(id)
        url = '/api/v1/accounts/{0}'.format(str(id))
        return self.__api_request('GET', url)
540912
def authenticated(self, user_token, **validation_context):
        
        token = self.token_storage.get(user_token)
        if token and token.validate(user_token, **validation_context):
            return True

        return False
420713
def authenticate(self, provider=None, identifier=None):
        ""
        provider_q = Q(provider__name=provider)
        if isinstance(provider, Provider):
            provider_q = Q(provider=provider)
        try:
            access = AccountAccess.objects.filter(
                provider_q, identifier=identifier
            ).select_related('user')[0]
        except IndexError:
            return None
        else:
            return access.user