現時点で、私たちのアプリケーションをWAS 8.0からリバティー・プロファイルに移行しようとしています。 私たちのアプリケーションでは、ユーザーのパスワードを使わずにプログラムによるログインを行う必要があります。残念ながら、クラスContextManagerFactoryはリバティで知られていないパスワードなしのリバース・プロファイルによるプログラム・ログイン
import com.ibm.websphere.security.auth.WSSubject;
import com.ibm.ws.security.core.ContextManagerFactory;
import com.ibm.websphere.security.auth.callback.WSCallbackHandlerImpl;
public class SecurityConfigJaasWasImpl implements ISecurityConfig {
public Object doAsWithoutPwd(String user, String[] roles, final ISecuredCode code) throws Exception {
final String mName ="doAs(String, String[], ISecuredCode)";
Object ret = null;
try {
if (code != null) {
ret = WSSubject.doAs(ContextManagerFactory.getInstance().login("REALM", user), new PrivilegedExceptionAction() {
/* (non-Javadoc)
* @see java.security.PrivilegedExceptionAction#run()
*/
public Object run() throws Exception {
return code.run();
}
});
}
} catch (LoginException e) {
throw new SecurityConfigException("Error login user " + user);
}
}
: では、これは次のコードスニペットで行われた8.0でした。 リバース・プロファイルを使用したプログラムによるログインの例では、WSCallbackHandlerImplを使用してJaasログインを実行しています。しかし、そのために私はユーザーのパスワードを知る必要があります。
リバティー・プロファイルのWAS 8.0コードと同様のことはありますか?