Dears,
I've already created a discussion about this at AS7 forum, i've used a code like this but it doesn't work :
SecurityContext securityContext = SecurityFactory.establishSecurityContext("java:/jaas/MyRealm");
AuthenticationManager authManager = securityContext.getAuthenticationManager();
Principal principal = new SimplePrincipal(credentials.getUsername());
Subject subject = new Subject();
if(authManager.isValid(principal, credentials.getPassword().toCharArray(), subject)) {
securityContext.getUtil().createSubjectInfo(principal, credentials.getPassword().toCharArray(), subject);
}
note : isValid returns true when credentials is correct but user is not authenticated at application level.
regards.