ontoportal-lirmm / annotators

Web service to add functionalities to the http://bioportal.bioontology.org and similar ontology annotators
5 stars 6 forks source link

Annotation proxy reports 401 error when using HTTP Authorization request headers #26

Closed jvendetti closed 5 years ago

jvendetti commented 5 years ago

We're working on trying to get the AnnotatorPlus up and running within Stanford's BioPortal application. Alex set up an instance of the annotation proxy and we've noticed that we get 401 errors if we try to access the /annotatorplus endpoint with an HTTP Authorization request header. Screen shot with particulars in Postman:

screenshot 2018-10-09 12 19 31

The same call succeeds if the BioPortal API key is provided in the query string instead of the Authorization header:

screenshot 2018-10-09 12 21 34

There does appear to be code that looks for the Authorization header. Wondering if there's any information you could provide to assist us in getting this working?

twktheainur commented 5 years ago

@jvendetti Which commit and branch did Alex clone from? There is code that should handle this case, but I suspect it may do so only for POST requests. I am investigating the issue.

twktheainur commented 5 years ago

It's not restricted to POST requests, if there are authorization headers, they should be transferred to the proxy request. That's the case in the master branch anyway. I see that the ncbo_annotatorplus branch is a few commits behind master, where there is an older version of the request forwarding code running. Merging with master may fix it. Once I know which branch this occurs on, I will attempt to reproduce in debug mode and see where it goes wrong more precisely.

jvendetti commented 5 years ago

Thanks @twktheainur. I've asked Alex to get you this information.

alexskr commented 5 years ago

I used ncbo_annotator branch should we use ncbo_annotatorplus instead?

twktheainur commented 5 years ago

ncbo_annotator is an old branch that's been last updated in 2015, before my overhaul, which is probably why this issue arose. ncbo_annotatorplus is the one I created during my visit if I remember correctly. That being said, I have since updated the master branch with maven profiles for each of the deployment targets.

So if you get HEAD master and build with mvn install -P ncboannotatorplus, it should build the war properly.

If you need to change the settings, you can modify sifr-bioportal-annotator-proxy/src/main/resources/ncboannotatorplus/annotatorProxy.properties

alexskr commented 5 years ago

that was the issue. looks like I checked out the wrong branch in my local dev environment. Things are back in order.