NCEAS / metacat

Data repository software that helps researchers preserve, share, and discover data
https://knb.ecoinformatics.org/software/metacat
GNU General Public License v2.0
26 stars 12 forks source link

Unable to authenticate with UCNRS referral account #1007

Closed mbjones closed 6 years ago

mbjones commented 6 years ago

Author Name: ben leinfelder (ben leinfelder) Original Redmine Issue: 6405, https://projects.ecoinformatics.org/ecoinfo/issues/6405

Original Assignee: Jing Tao


Running the JUnit test:

MetaCatServletTest. testOtherReferralLogin

I noticed the UCNRS referral was not successful. http://localhost:8080/metacat/metacat?action=login&username=uid=testreferral,o=UCNRS,dc=ecoinformatics,dc=org&password=testreferral It works on the KNB: http://knb.ecoinformatics.org/knb/metacat?action=login&username=uid=testreferral,o=UCNRS,dc=ecoinformatics,dc=org&password=testreferral

But not on the trunk/localhost.

mbjones commented 6 years ago

Original Redmine Comment Author Name: Jing Tao (Jing Tao) Original Date: 2014-02-04T00:20:17Z


The issue was not in the authentication. It was in the method getUserInfo. In the getUserInfo method, it used a filter to combine the uid and organization. This part of code is not necessary since the search base is the dn. Moreover, this logical was overwritten by the assigning the filter by 'uid=user id'.

However, this part of code had an issue - it assumed the user dn should have a "," after "o=" if there is an "o=" in the dn. Our alias handing code dereferences the uid=testreferral,o=UCNRS,dc=ecoinformatics,dc=org to the uid=testreferral,ou=people,o=ucnrs.org. So even though the dereferenced user dn has "o=", but after "o=" there is no ",". So it broke the code.

After i removed this part code, the junit test works.