I recorded my script in badboy and convert it in JMeter. My script like: enter image description here
when run this script for 1 user then application is not authorizing the user and following exception thrown in logs:
DEBUG: access.intercept.FilterSecurityInterceptor - Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@0: RemoteIpAddress: ; SessionId: ; Granted Authorities: ROLE_ANONYMOUS DEBUG: access.vote.AffirmativeBased - Voter: org.springframework.security.access.vote.RoleVoter@514020c0, returned: -1 DEBUG: access.vote.AffirmativeBased - Voter: org.springframework.security.access.vote.AuthenticatedVoter@502dc360, returned: 0 DEBUG: web.access.ExceptionTranslationFilter - Access is denied (user is anonymous); redirecting to authentication entry point org.springframework.security.access.AccessDeniedException: Access is denied
And when i access the web application and login with same user then it authorizing the same user and print following trace in log:
DEBUG: access.intercept.FilterSecurityInterceptor - Previously Authenticated: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@: Principal: com.A.B.C.D.User@6d513c13; Credentials: [PROTECTED]; Authenticated: true; Details: com.A.B.C.D.E.UserAuthenticationDetails@0: RemoteIpAddress: ; SessionId: ; Granted Authorities: LEARNER DEBUG: access.vote.AffirmativeBased - Voter: org.springframework.security.access.vote.RoleVoter@514020c0, returned: 1 DEBUG: access.intercept.FilterSecurityInterceptor - Authorization successful DEBUG: access.intercept.FilterSecurityInterceptor - RunAsManager did not change Authentication object
But in JMeter my test was not marked fail and all the samplers went successful and return 200.
Could anyone please help me! thanks.