Esempio n. 1
0
def get_auth_url(backend, redirect_uri, *args, **kwargs):
    uri = redirect_uri
    if uri and not uri.startswith('/'):
        uri = url_for(uri, backend=backend)

    g.strategy = load_strategy()
    g.backend = load_backend(g.strategy, backend, redirect_uri=uri,
                             *args, **kwargs)
    resp = do_auth(g.backend)
    return resp.location
Esempio n. 2
0
def get_username(backend, redirect_uri):
    g.strategy = load_strategy()
    g.backend = load_backend(g.strategy, backend, redirect_uri=redirect_uri)
    do_complete(g.backend, login=do_login)
    return g.user.username