Currently I am implementing a custom identity asserter in WebLogic 14C environment. I have developed following components. An AuthenticationProvider.xml (which defines MBean Definition File elements)
<MBeanAttribute
Name = "ProviderClassName"
Type = "java.lang.String"
Writeable = "false"
Default = ""com.test.authentication.CustomAuthenticationProvider""
/>
<MBeanAttribute
Name = "SupportedTypes"
Type = "java.lang.String[]"
Writeable = "true"
Default = "new String[] {"CustomToken"}"
/>
<MBeanAttribute
Name= "ActiveTypes"
Type= "java.lang.String[]"
Writeable = "true"
Default = "new String[] {"CustomToken"}"
/>
I have also class that implements interfaces AuthenticationProviderV2, IdentityAsserterV2:
public class CustomAuthenticationProvider implements AuthenticationProviderV2, IdentityAsserterV2 {
@Override
public IdentityAsserterV2 getIdentityAsserter() {
return this;
}
public PrincipalValidator getPrincipalValidator() {
return new PrincipalValidatorImpl();
}
@Override
public CallbackHandler assertIdentity(String type, Object token, ContextHandler context) throws IdentityAssertionException {
System.out.println("NSPIRESOracleLoginModule.assertIdentity");
System.out.println("\tType\t\t= " + type);
System.out.println("\tToken\t\t= " + token);
return null;
}
}
I am calling this custom Identity asserter from a servlet like this:
Subject mySubject = Authentication.assertIdentity("CustomToken" , "username=test-user".getBytes());
I get following error when my servlet calls this method:
javax.security.auth.login.LoginException: [Security:090377]Identity Assertion Failed, weblogic.security.spi.IdentityAssertionException: [Security:090380]Identity Assertion Failed, Unsupported Token Type: CustomToken
From WebLogic's console I have configured custom provider and I can see that the my custom token is available in ActiveTypes list.
What do I need to fix this issue?
: WLS 14 Documentation link