[SccriptRunner] - Custom listener in login - Userfailedauthentication envent

Hi, I want to use the Custom listener on the UserAuthenticationfailedInvalidAuthenticationUser event. But I did not find any documentation on this event.

I would like to get some information on the login such as the username used to try to login

What method can I use with UserAuthenticationfailedInvalidAuthenticationUser event Object?

Can you help me?

Thank you

1 answer

1 accepted

Hi Cyril,

There are just a couple of thing you can get from a UserAuthenticationfailedInvalidAuthenticationUser event (Occurs whenever a user fails to authenticate). So for example you can get the username and the timestamp that the event happened

log.debug("User name who failed to login: ${event?.username}")
Date date = new Date(event?.getTimestamp())
log.debug ("Date and time event took place : ${date}")

hope that helps,

Thanos

Thank you for your answer. It is enough for my need, but for my curiosity where can i find all the attribute and method of the object UserAuthenticationfailedInvalidAuthenticationUser

In the link you sent to me, I did not find anything about "username" or "getTimestamps"

 

Thank you

There is a bug in the inline script of script runner.

when I  I use "event?.username", scriptrunner tells me :

No such property : username in the class com.atlassian.jira.event.issue.issueEvent

 But it works anyway.

The web interface shows the event object as com.atlassian.jira.event.issue.issueEvent object

and the logs shows the event object as com.atlassian.crowd.event.user.UserAuthenticationFailedInvalidAuthenticationEvent object

So if someone get his code underline, they should not consider the web interface error and execute the code to check in the logs

 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

184 views 1 17
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you