Exemple #1
0
 def refresh(self):
     """
     Create a new token while retaining the refresh token.
     """
     if self.refresh_token is not None:
         self.token = newid()
         self.secret = newsecret()
Exemple #2
0
 def refresh(self):
     """
     Create a new token while retaining the refresh token.
     """
     if self.refresh_token is not None:
         self.token = newid()
         self.secret = newsecret()
Exemple #3
0
def oauth_make_auth_code(client, scope, redirect_uri):
    """
    Make an auth code for a given client. Caller must commit
    the database session for this to work.
    """
    authcode = AuthCode(user=g.user, session=g.usersession, client=client, scope=scope, redirect_uri=redirect_uri)
    authcode.code = newsecret()
    db.session.add(authcode)
    return authcode.code
Exemple #4
0
def oauth_make_auth_code(client, scope, redirect_uri):
    """
    Make an auth code for a given client. Caller must commit
    the database session for this to work.
    """
    authcode = AuthCode(user=g.user, client=client, scope=scope, redirect_uri=redirect_uri)
    authcode.code = newsecret()
    db.session.add(authcode)
    return authcode.code
Exemple #5
0
 def __init__(self, **kwargs):
     super(PasswordResetRequest, self).__init__(**kwargs)
     self.reset_code = newsecret()
Exemple #6
0
 def __init__(self, email, **kwargs):
     super(UserEmailClaim, self).__init__(**kwargs)
     self.verification_code = newsecret()
     self._email = email
     self.md5sum = md5(self._email).hexdigest()
Exemple #7
0
 def __init__(self, **kwargs):
     super(AuthToken, self).__init__(**kwargs)
     self.token = newid()
     if self.user:
         self.refresh_token = newid()
     self.secret = newsecret()
Exemple #8
0
 def __init__(self, **kwargs):
     super(PasswordResetRequest, self).__init__(**kwargs)
     self.reset_code = newsecret()
Exemple #9
0
 def __init__(self, email, **kwargs):
     super(UserEmailClaim, self).__init__(**kwargs)
     self.verification_code = newsecret()
     self._email = email
     self.md5sum = md5(self._email).hexdigest()
Exemple #10
0
 def __init__(self, **kwargs):
     super(AuthToken, self).__init__(**kwargs)
     self.token = newid()
     if self.user:
         self.refresh_token = newid()
     self.secret = newsecret()