Can we enforce User Re-Authentication on Workflow State Transition?

I am developing a jira-plugin where a user should be asked to enter their jira-credentials every time he /she adds an attachment to a ticket . I want to know if user re-authentication can be achieved upon a button click on a ticket. Or if there is any other way by which we can achieve the user re-authentication functionality .