OAuth-Apis / apis

OAuth Authorization as a Service
Apache License 2.0
594 stars 301 forks source link

Purpose of "v1" servlet mapping #44

Open sfitts opened 10 years ago

sfitts commented 10 years ago

I noticed that the server war provides a servlet mapping under three roots:

However the code behind the various resources makes assumptions about which filters will actually be applied. For example, the resource manager code (such as ResourceServerResource.java) expects that the access will have been authorized and thus a verified token will be available. This isn't in this case, so the result is an NPE on any access. What is the intended purpose of the v1 mapping?

A related question is why all 3 mappings actually give you access to the same resource URIs (so you could issue "admin/authorize" or "oauth2/resourceServer" as valid URIs, though they may or may not work properly). Seems like a more precise set of mappings would be better to avoid confusion and spurious errors (or accidental success).

hanswesterbeek commented 10 years ago

Sean, I think you make a convincing case for doing this refactoring. I'll take a look ASAP.