geonode.security.oauth2_validators

Attributes

log

Classes

OIDCValidator

Module Contents

geonode.security.oauth2_validators.log[source]
class geonode.security.oauth2_validators.OIDCValidator[source]

Bases: oauth2_provider.oauth2_validators.OAuth2Validator

Example

Check if the username and password correspond to a valid and active User. If authentication fails, try Facebook token authentication.

Example method:

def validate_user(self, username, password, client, request, *args, **kwargs):
    u = authenticate(username=username, password=password)
    if u is None or not u.is_active:
        u = authenticate_with_facebook()

    if u is not None and u.is_active:
        request.user = u
        return True

    return False
get_authorization_code_nonce(client_id, code, redirect_uri, request)[source]
get_id_token(token, token_handler, request)[source]