Exemple #1
0
def is_authenticated_oidc():
    """
    Is the user authenticated with OpenID Connect?
    """
    if 'userid' in session and 'screenname' in session:
        return True  # I don't care if Google's OIDC token expires
    if request.cookies.get(OIDC.id_token_cookie_name, None) is None:
        # Otherwise OIDC gets a little confused
        return False
    else:
        return OIDC.authenticate_or_redirect() is None
Exemple #2
0
 def decorated(*args, **kwargs):
     if 'userid' not in session and 'screenname' not in session:
         response = OIDC.authenticate_or_redirect()
         if response is not None:
             return response
     return view_func(*args, **kwargs)