Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUTH_HEADER_PREFIX #248

Open
kennedyngigi4 opened this issue Apr 19, 2021 · 1 comment
Open

AUTH_HEADER_PREFIX #248

kennedyngigi4 opened this issue Apr 19, 2021 · 1 comment

Comments

@kennedyngigi4
Copy link

I am trying to set my AUTH_HEADER_PREFIX to Bearer but fails with Error 401 (Unauthorized). My frontend fails to get the Token.

@NeilduToit13
Copy link

Made the mistake earlier of trying to put the settings variables flat in the settings file. If you look at the top of the page on the documentation, it shows that you have to put them in a dictionary like this:
REST_KNOX = {
'SECURE_HASH_ALGORITHM': 'cryptography.hazmat.primitives.hashes.SHA512',
'AUTH_TOKEN_CHARACTER_LENGTH': 64,
'TOKEN_TTL': timedelta(hours=10),
'USER_SERIALIZER': 'knox.serializers.UserSerializer',
'TOKEN_LIMIT_PER_USER': None,
'AUTO_REFRESH': False,
'EXPIRY_DATETIME_FORMAT': api_settings.DATETME_FORMAT,
}
That fix your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants