Exemple #1
0
def load_request_token(token):
    """
    This function loads a request token given the token.
    Request token & verifier getters and setters are required. They are used in the authorization flow.
    """
    grant = RequestToken.findFirst(token, SESSION)
    return grant
Exemple #2
0
def save_verifier(token, verifier, *args, **kwargs):
    """
    Adds a verifier token.
    Request token & verifier getters and setters are required. They are used in the authorization flow.
    """
    tok = RequestToken.findFirst(token)
    tok.verifier = verifier["oauth_verifier"]
    tok.user = getCurrentUser()
    SESSION.add(tok)
    SESSION.commit()
    return tok
Exemple #3
0
def load_verifier(verifier, token):
    """
    Loads a verifier token.
    Request token & verifier getters and setters are required. They are used in the authorization flow.
    """
    return RequestToken.findFirst(token, SESSION, verifier=verifier)