Hi! I refactored and moved a lot of things but the functionality is the same:
Settings module:
In the settings module there was an error on AUTH0_CLIENT_SECRET, when CLIENT_SECRET_BASE64_ENCODEDis Falseit's not necessary to do replace("_", "/").replace("-", "+")
Added new USERNAME_FIELDto settings, this allows to specify which scope field in the token is to be used as a username
Refactored JWT_PAYLOAD_GET_USERNAME_HANDLER as an import string to avoid circular dependencies
Settings module:
Removed unnecessary functions: authenticate and get_jwt_value
@Snake575 manually tested, merged to master and uploaded updated version to pypi ;)
in the following weeks i'll be adding some tests(continuous integration) to this package.
Hi! I refactored and moved a lot of things but the functionality is the same:
Settings module:
In the settings module there was an error on
AUTH0_CLIENT_SECRET
, whenCLIENT_SECRET_BASE64_ENCODED
isFalse
it's not necessary to doreplace("_", "/").replace("-", "+")
Added new
USERNAME_FIELD
to settings, this allows to specify which scope field in the token is to be used as a usernameRefactored
JWT_PAYLOAD_GET_USERNAME_HANDLER
as an import string to avoid circular dependenciesSettings module:
Removed unnecessary functions:
authenticate
andget_jwt_value
Refactored
Auth0JSONWebTokenAuthentication
, now it inherits fromdjango.contrib.auth.backends.RemoteUserBackend
, it' has a very similar functionality with the original implementationUtils module:
Removed unnecessary functions:
jwt_decode_handler
get_jwt_value
now uses JWT'sJSONWebTokenAuthentication
implementationChanged get_group to group's', as token payload contains a group array instead of a single group
Same for get_role to get_role's'
Thanks for stating this project by the way!
Greetings from Antofagasta :grin: