I have written custom servlet and REST module for JIRA. I want user to authenticate before using those servlet or REST API if user has not done authentication yet. Do I need to written servlet filter for authentication or JIRA provides something out of the box for custom REST plugin or Servelt plugin.
If I have to write my own authentication servlet filter, is there any example available for it
Hello,
For a servlet you can check if a user is logged in and if not, then redirect to the login page. You can find an example here:
Your REST endpoint must require login. The @AnonymousAllowed annotation does the opposite.
You can also create a servlet-filter, which would redirect to the login page as it is in the servlet example.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.