最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - WebLogic 14C Custom Identity Asserter - Unsupported Token Type Error - Stack Overflow

programmeradmin1浏览0评论

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       = "&quot;com.test.authentication.CustomAuthenticationProvider&quot;"
  />  
  <MBeanAttribute 
  Name = "SupportedTypes"
  Type = "java.lang.String[]"
  Writeable = "true"
  Default = "new String[] {&quot;CustomToken&quot;}"
  />
  <MBeanAttribute 
  Name= "ActiveTypes"
  Type= "java.lang.String[]"
  Writeable = "true"
  Default = "new String[] {&quot;CustomToken&quot;}"
  />

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

发布评论

评论列表(0)

  1. 暂无评论