Authorization Plugin doesn't like bearer prefix

Hey all! Been working hard on getting the auth plugin to work with keycloak and integrate into all the plugins. Think I finally have it working though!
Users are enumerated and given roles, OHIF works well, and when I manually use the api dicomweb works as well.
Problem is that DicomWeb doesn’t seem to appreciate any dicomweb client I throw at it.
Seems to be because of the bearer prefix on Authorization
For example this works fine:

curl -H 'Authorization: $token' 'https://$domain/dicom-web/studies?$params' 

However this gives me a 403:

curl -H 'Authorization: Bearer $token' 'https://$domain/dicom-web/studies?$params' 

Adding the Bearer prefix is the proper way to do oauth2 tokens, and every dicomweb client I’ve come across adds it, making them all pretty useless for this deployment.
Does anyone have any experience or ideas for getting around this? Worst case would it be difficult to attempt to strip the Bearer prefix in the auth service?
Thanks!

Hi Michael,

I have accepted your fix in the auth-service.

Thanks for your contribution,

Alain

1 Like