-
1. Re: Secure EJB: javax.ejb.EJBAccessException: JBAS013323: Invalid User
virchete Mar 16, 2015 10:35 AM (in response to virchete)The problem is in this line:
The problem is in the SimpleSecurityManager that is inside of wildfly-security:
public void authenticate(final String runAs, final String runAsPrincipal, final Set<String> extraRoles) {
SecurityContext context = SecurityContextAssociation.getSecurityContext();
SecurityContextUtil util = context.getUtil();
Object credential = util.getCredential();
Subject subject = null;
if (credential instanceof RemotingConnectionCredential) {
subject = ((RemotingConnectionCredential) credential).getSubject();
}
if (authenticate(context, subject) == false) {
throw SecurityMessages.MESSAGES.invalidUserException();
}
The Credential object is null. Then the subject is null and the authenticate(context,subject) fails.
I checked the identity object created and this is the content:
I checked how the Identity was created and it was created using:
Set<Object> credentials = subject.getPrivateCredentials(); Object credential = !credentials.isEmpty() ? credentials.iterator().next() : null; Identity identity = CredentialIdentityFactory.createIdentity(principal, credential, roleGroup);
The credential object is null in the creation. It is read from the privateCredentials from the subject. The subject is created like this:
final Subject subject = securityContext.getSubject(securityDomain);
This is the identity object created initially, that later on fails on the authentication. It fails because the privateCredentials from the subject are null.
Identity identity = CredentialIdentityFactory.createIdentity(principal, credential, roleGroup);
identity CredentialIdentityFactory$1 (id=12643)
val$cred null
val$principal SimplePrincipal (id=12625) -->Contains kermit
val$roles SimpleRoleGroup (id=12642) -->
-
2. Re: Secure EJB: javax.ejb.EJBAccessException: JBAS013323: Invalid User
virchete Mar 23, 2015 11:01 AM (in response to virchete)Any idea??