Skip to content

Commit

Permalink
remove bearer prefix from token when decoding user profile (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
barrettMCW authored Jun 3, 2024
1 parent 6656663 commit ef0fcbd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sources/orthanc_auth_service/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ def get_user_profile(user_profile_request: UserProfileRequest):
if user_profile_request.token_key == "api-key" and api_keys is not None:
response = api_keys.get_user_profile_from_api_key(api_key=user_profile_request.token_value)
else:
response = keycloak.get_user_profile_from_token(user_profile_request.token_value)
token = user_profile_request.token_value
if token.startswith("Bearer "):
token = token.replace("Bearer ", "")
response = keycloak.get_user_profile_from_token(token)

else:
return anonymous_profile
Expand Down

0 comments on commit ef0fcbd

Please sign in to comment.