Settings
auto generated using
pydoc_markdown
GqlAuthSettings¶
@dataclass
class GqlAuthSettings()
ALLOW_LOGIN_NOT_VERIFIED¶
LOGIN_FIELDS¶
These fields would be used to authenticate with SD-jwt
authenticate
function. This function will call each of ourAUTHENTICATION_BACKENDS
, And will return the user from one of them unlessPermissionDenied
was raised. You can pass any fields that would be accepted by your backends.Note that
password field
is mandatory and cannot be removed.
LOGIN_REQUIRE_CAPTCHA¶
Whether login will require captcha verification.
CI_MODE¶
Whether to enable CI mode, this will disable captcha validation (although the fields would still be required).
REGISTER_MUTATION_FIELDS¶
Fields on register, plus password1 and password2, can be a dict like UPDATE_MUTATION_fieldS setting.
REGISTER_REQUIRE_CAPTCHA¶
Whether register will require captcha verification.
CAPTCHA_EXPIRATION_DELTA¶
captcha stuff captcha expiration delta.
CAPTCHA_MAX_RETRIES¶
max number of attempts for one captcha.
CAPTCHA_TEXT_FACTORY¶
A callable with no arguments that returns a string.
This will be used to generate the captcha image.
CAPTCHA_TEXT_VALIDATOR¶
A callable that will receive the original string vs user input and returns a boolean.
FORCE_SHOW_CAPTCHA¶
Whether to show the captcha image after it has been created for debugging purposes.
CAPTCHA_SAVE_IMAGE¶
If True, an png representation of the captcha will be saved under MEDIA_ROOT/captcha/
/ .png.
UPDATE_MUTATION_FIELDS¶
Fields on update account mutation.
ALLOW_DELETE_ACCOUNT¶
If True, DeleteAcount mutation will permanently delete the user.
ALLOW_PASSWORDLESS_REGISTRATION¶
Whether to allow registration with no password.
JWT_SECRET_KEY¶
Key used to sign the JWT token.
JWT_ALGORITHM¶
Algorithm used for signing the token.
JWT_TIME_FORMAT¶
A valid 'strftime' string that will be used to encode the token payload.
JWT_PAYLOAD_HANDLER¶
A custom function to generate the token datatype, its up to you to encode the token.
JWT_PAYLOAD_PK¶
Field that will be used to generate the token from a user instance and retrieve user based on the decoded token. The default value is the username field of the User model. If you want to change it to id, for example, you can use the id_field defined in gqlauth.settings_type and change it like JWT_PAYLOAD_PK=id_field.
This filed must be unique in the database
JWT_TOKEN_FINDER¶
A hook called by
GqlAuthRootField
to find the token. Accepts the request object (might be channels scope dict or django request object)remember to strip the "JWT " prefix if you override this.
JWT_EXPIRATION_DELTA¶
Timedelta added to
utcnow()
to set the expiration time.When this ends you will have to create a new token by logging in or using the refresh token.
JWT_LONG_RUNNING_REFRESH_TOKEN¶
Whether to enable refresh tokens to be used as an alternative to login every time the token is expired.
JWT_REFRESH_TOKEN_N_BYTES¶
Number of bytes for long running refresh token.
JWT_REFRESH_EXPIRATION_DELTA¶
Refresh token expiration time delta.