Critical: Need urgent assistance for Confluence Plugin - Unauthenticated Access to Admin Section"

Hi,
I have developed a custom Confluence plugin that includes a servlet with a specific URL. However, I’ve noticed that users, even those without authentication, can directly access this page via a direct link. As this page contains administrative sections, I want to secure it so that only authenticated users (preferably Confluence admins or registered users) can access it. The ideal behavior would be to redirect users to the login page if they attempt to access the URL without authentication. How can I implement this security measure in my Confluence plugin to ensure that users are authenticated before accessing the page directly?

Thanks & Regards,
Ajit

Hello
You can implement servlet filter that blocks/redirects users to another page.

DOCS: https://developer.atlassian.com/server/jira/platform/servlet-filter/

this situation is covered by the starter documentation here: https://developer.atlassian.com/server/framework/atlassian-sdk/creating-an-admin-configuration-form/