Topic
  • No replies
pi314
pi314
1 Post

Pinned topic Any standard type for javax.security.auth.login.Configuration in IBM Java?

‏2012-10-04T05:50:17Z |
Hello.

I am trying to use JAAS in IBM Java without WAS admin console setting(I mean standard way for other Web application servers too).

But I found there could be incompatibility to create javax.security.auth.login.Configuration instance between Oracle Java and IBM Java. I embedded simple sample code(test.java) which reproduce different behavior between them.
//. test.java
import javax.security.auth.login.*;

public class test{
public static void main(String[] args){
try{
Configuration conf = Configuration.getInstance( "JavaLoginConfig", null );
System.out.println( "conf = " + conf );
}catch( Exception e ){
e.printStackTrace();
}
}
}

You will see "java.security.NoSuchAlgorithmException: JavaLoginConfig" message when you run this code with IBM Java. On the other hand, you will see like "conf = javax.security.auth.login.Configuration$ConfigDelegate@********" (successful) message with Oracle Java or Open Java.

The first parameter of Configuration.getInstance, "JavaLoginConfig" is a standard/default type when creating this instance in Oracle Java:
http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Configuration

But as you see above, it causes Exception in IBM Java.
I would like to use same code/approach even in IBM Java, too, if possible.
Are there any same kind of standard type(alternate of "JavaLoginConfig") for javax.security.auth.login.Configuration in IBM Java?
Thanks for advance.

Attachments