~nataliabidart/ubuntu/natty/ubuntu-sso-client/ubuntu-sso-client-1.1.8

« back to all changes in this revision

Viewing changes to ubuntu_sso/account.py

  • Committer: Sebastien Bacher
  • Date: 2010-12-17 20:25:51 UTC
  • mfrom: (21.1.1 ubuntu-sso-client-1.1.7)
  • Revision ID: seb128@ubuntu.com-20101217202551-8loiktkqu2vmdhy1
Tags: 1.1.7-0ubuntu1
releasing version 1.1.7-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
                     'token_name: %r', credentials['consumer_key'], token_name)
173
173
        return credentials
174
174
 
175
 
    def is_validated(self, email, password, token_name, sso_service=None):
 
175
    def is_validated(self, token, sso_service=None):
176
176
        """Return if user with 'email' and 'password' is validated."""
 
177
        logger.debug('is_validated: requesting accounts.me() info.')
177
178
        if sso_service is None:
178
 
            token = self.login(email=email, password=password,
179
 
                               token_name=token_name)
180
 
 
181
179
            oauth_token = oauth.OAuthToken(token['token'],
182
180
                                           token['token_secret'])
183
181
            authorizer = OAuthAuthorizer(token['consumer_key'],
189
187
        key = 'preferred_email'
190
188
        result = key in me_info and me_info[key] != None
191
189
 
192
 
        logger.debug('is_validated: email: %r token_name: %r, result: %r.',
193
 
                     email, token_name, result)
 
190
        logger.info('is_validated: consumer_key: %r, result: %r.',
 
191
                    token['consumer_key'], result)
194
192
        return result
195
193
 
196
194
    def validate_email(self, email, password, email_token, token_name):