onInteractiveAuthenticationSuccessEvent is not firing after login
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
### Steps to Reproduce
1. Install spring security core plugin version 4.0.3
2. Execute `grails s2-quickstart com.yourapp User Role`
3. Enable security event listener and turn on both onAuthenticationSuccessEvent and onInteractiveAuthenticationSuccessEvent callback within application.groovy
**application.groovy**
```
// Added by the Spring Security Core plugin:
grails.plugin.springsecurity.userLookup.userDomainClassName = 'iam.User'
grails.plugin.springsecurity.userLookup.authorityJoinClassName = 'iam.UserRole'
grails.plugin.springsecurity.authority.className = 'iam.Role'
grails.plugin.springsecurity.auth.loginFormUrl = '/#/login'
grails.plugin.springsecurity.rest.token.storage.jwt.expiration = 3600 //seconds
//enable event listener
grails.plugin.springsecurity.useSecurityEventListener = true
grails.plugin.springsecurity.onAuthenticationSuccessEvent = { e, appCtx ->
// handle AuthenticationSuccessEvent
println("authentication success event")
}
grails.plugin.springsecurity.onInteractiveAuthenticationSuccessEvent = { e, appCtx ->
// handle InteractiveAuthenticationSuccessEvent
println("interactive authentication success event")
}
```
### Expected Behaviour
1. Login with username and password through `http://localhost:8080/APP/api/login`
2. Printout both line after authentication went through
- "authentication success event"
- "interactive authentication success event"
### Actual Behaviour
Printout from console
```
authentication success event
authentication success event
authentication success event
authentication success event
authentication success event
authentication success event
```
The line "interactive authentication success event" wasn't printout
### Environment Information
OS: Mac BigSur
Grails: 4.0.4
JDK: OpenJDK Runtime Environment (Zulu 8.54.0.21-CA-macosx) (build 1.8.0_292-b10)
Plugin Version: spring-security-core:4.0.3
Contributor guide
Research direction
Start with the security event listener configuration in application.groovy and reproduce the login through /APP/api/login using the listed Grails and spring-security-core versions. Compare the handling of onAuthenticationSuccessEvent with onInteractiveAuthenticationSuccessEvent. Done means one login produces both expected callback messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, spring
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100