-
1. Re: Unable to get private credentials
valsaraj007 Jan 23, 2015 1:04 PM (in response to valsaraj007)Do we need to configure any kind of policy permission in JBoss?
TRACE [org.jboss.security.audit] (default task-5) [Success]Source=org.jboss.security.plugins.javaee.EJBAuthorizationHelper;Action=authorization;Resource:=[org.jboss.security.authorization.resources.EJBResource:contextMap={policyRegistration=null}:method=public abstract java.lang.String org.app.core.AppPropertiesLocal.getProperty(java.lang.String):ejbMethodInterface=Local:ejbName=AppProperties:ejbPrincipal=org.wildfly.extension.undertow.security.AccountImpl$AccountPrincipal@1a3af:MethodRoles=Roles(<ANYBODY>,):securityRoleReferences=null:callerSubject=Subject:
Principal: org.wildfly.extension.undertow.security.AccountImpl$AccountPrincipal@1a3af
Principal: lt7
Principal: Roles(members:appAccountUserManager)
Public Credential: org.app.security.key.UserPublicKey@3a5e3bf4
Private Credential: org.app.security.key.MyPrivateKey@b22e1c
:callerRunAs=null:callerRunAs=null:ejbRestrictionEnforcement=false:ejbVersion=2.0];policyRegistration=null;
TRACE [org.jboss.security] (default task-5) PBOX000354: Setting security roles ThreadLocal: null
TRACE [org.jboss.security.audit] (default task-6) [Success]Source=org.jboss.as.security.service.SimpleSecurityManager;Action=authentication;principal=anonymous;
TRACE [org.jboss.security] (default task-6) PBOX000354: Setting security roles ThreadLocal: {}
DEBUG [org.jboss.security] (default task-6) PBOX000293: Exception caught: javax.naming.NameNotFoundException: policyRegistration -- service jboss.naming.context.java.policyRegistration
In this log, Principal: lt7 is what I added from login module. Also, the private credential can be seen which I am not able to retrieve. When compared to old JBoss version, it is same except Principal: org.wildfly.extension.undertow.security.AccountImpl$AccountPrincipal@1a3af which is an addition in WildFly.
-
2. Re: Unable to get private credentials
valsaraj007 Jan 30, 2015 5:12 AM (in response to valsaraj007)1 of 1 people found this helpfulWhen I added password as String, it worked.
String password = "xxxxxxxxxxxxxxx";
subject.getPrivateCredentials().add(password );
I am able to get this using, subject.getPrivateCredentials(String.class);
So I am wondering why Set<MyPrivateKey> myPrivateKeys = subject.getPrivateCredentials(MyPrivateKey.class); not worked. Is this because it is a user defined class? Do we need to add such classes to be able to retrieve them?