web-resource-collection without authorization #1674
-
I am implementing a new module under the /manager/api folder that would expose an endpoint without need of authorization. I've tried to add this endpoint in the web.xml file without a auth-constraint like this: There is a way that I could accomplish this? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Are you trying to add an extra JAX-RS resource to the Manager API? If you check out the 3.x branch you might get some inspiration on how to achieve this. For example: https://github.com/apiman/apiman/blob/3.x/manager/api/war/tomcat8/src/main/webapp/WEB-INF/web.xml#L104-L184 I think if you simply don't provide a constraint it should not be protected 🤔. It's part of the Java EE specification (aka Jakarta EE), so you should be able to follow that standard. |
Beta Was this translation helpful? Give feedback.
-
Check out https://docs.oracle.com/cd/E19798-01/821-1841/bncbk/index.html -- 'Specifying an Authorization Constraint' |
Beta Was this translation helpful? Give feedback.
-
@msavy thanks for your reply! There is a way to create a role that doesn't need authorization? |
Beta Was this translation helpful? Give feedback.
-
Sounds more like your extra JAX-RS resource/service isn't being picked up. You likely need to register it. Check out https://github.com/apiman/apiman/blob/master/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/ApiManagerApplication.java#L60-L70 |
Beta Was this translation helpful? Give feedback.
-
@msavy |
Beta Was this translation helpful? Give feedback.
Are you trying to add an extra JAX-RS resource to the Manager API?
If you check out the 3.x branch you might get some inspiration on how to achieve this.
For example: https://github.com/apiman/apiman/blob/3.x/manager/api/war/tomcat8/src/main/webapp/WEB-INF/web.xml#L104-L184
I think if you simply don't provide a constraint it should not be protected 🤔. It's part of the Java EE specification (aka Jakarta EE), so you should be able to follow that standard.