JAX-RS and custom authorization

前端 未结 2 721
伪装坚强ぢ
伪装坚强ぢ 2021-02-04 18:41

I\'m trying to secure the JAX-RS endpoint and am currently trying to figure out how the authentication and authorization work. Most examples are quite simple as they only piggyb

2条回答
  •  天涯浪人
    2021-02-04 19:29

    Disclaimer: Don't role your own security framework unless you really, really, really, need one.

    Look at what the OAuth filter in Jersey does. It reads the Authorization header which holds credentials in a different format than those normally understood (HTTP Basic). It'll turn those credentials into roles which you can then use to implement security (@RolesAllowed) if you add in the Roles Allowed Filter which does the actually enforcement. Try looking at how those filters work.

提交回复
热议问题