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

paramter algorithms will be required in the future #1346

Merged
merged 1 commit into from Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion privacyidea/api/auth.py
Expand Up @@ -293,7 +293,7 @@ def get_auth_token():
"authtype": authtype,
"exp": datetime.utcnow() + validity,
"rights": rights},
secret)
secret, algorithm='HS256')

# Add the role to the response, so that the WebUI can make decisions
# based on this (only show selfservice, not the admin part)
Expand Down
2 changes: 1 addition & 1 deletion privacyidea/api/lib/prepolicy.py
Expand Up @@ -1113,7 +1113,7 @@ def api_key_required(request=None, action=None):
if not auth_token:
auth_token = request.headers.get('Authorization')
try:
r = jwt.decode(auth_token, current_app.secret_key)
r = jwt.decode(auth_token, current_app.secret_key, algorithms=['HS256'])
g.logged_in_user = {"username": r.get("username", ""),
"realm": r.get("realm", ""),
"role": r.get("role", "")}
Expand Down
2 changes: 1 addition & 1 deletion privacyidea/api/lib/utils.py
Expand Up @@ -280,7 +280,7 @@ def verify_auth_token(auth_token, required_role=None):
raise AuthError(_("Authentication failure. Missing Authorization header."),
id=ERROR.AUTHENTICATE_AUTH_HEADER)
try:
r = jwt.decode(auth_token, current_app.secret_key)
r = jwt.decode(auth_token, current_app.secret_key, algorithms=['HS256'])
except jwt.DecodeError as err:
raise AuthError(_("Authentication failure. Error during decoding your token: {0!s}").format(err),
id=ERROR.AUTHENTICATE_DECODING_ERROR)
Expand Down