geonode.security.oauth2_validators
Attributes
Classes
Module Contents
- class geonode.security.oauth2_validators.OIDCValidator[source]
Bases:
oauth2_provider.oauth2_validators.OAuth2ValidatorExample
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