I’m trying to write a small plugin that will do some bespoke authentication/authorisation.
I’ve managed to extend ‘hudson.security.SecurityRealm’ and can now successfully write a simple authenticator plugin.
My issue is that there is an MFA step which requires notifying the user of a two digit code (microsoft authenticator app).
So while I’m in the ‘authenticate(Authentication authentication)’ method I wan to alert the user.
I though at first about adding some ajax to the ‘loginLink.jelly’
But then I realised that Jenkins has the two notification icons near the login link (the warning, and info icons).
How can I notify the user in real time? Is there a mechanism for this I can just use already?
The 2 notification icons are not the right thing. Those a notifications from the administrative monitors.
So I think you will have to add some javascript code to show a dialog (see Dialogs [Jenkins])
Do you intend to publish the plugin?
No. I’m not going to publish the plugin (at least there are no plans) it’s for a few internal jenkins servers and it’s pretty specific to us. I may make the source code available on github for anyone who wants to see how this sort of thing is done.
Thank you. I’ll ready about Dialogs… I have looked at some of the MFA plugins, they seem to be intercepting the filter chain, but I don’t want to go into all that hassle if I can get away with it.