私が考えることができる回避策は、がorg.apache.catalina.authenticator.FormAuthenticator
に拡張され、/server/default/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml
に登録することです。 Jboss AS 7では、CustomAuthenticator
をjboss-web.xml
iteselfに登録できるバルブコンセプトを導入しました。
public class CustomFormAuthenticator extends FormAuthenticator {
@override
public boolean authenticate(Request request, Response response, LoginConfig config) throws IOException {
boolean authenticate = super.authenticate(request, response, config);
//here you might need to keep track whether your custom/static code executed once or not,
//just to avoid executing the same code again and again.
if(authenticate) {
int i = CustomSingleton.getInstnce().getExecuteCount();
if(i <= 0) {
//invoke custom code.
//increment the count
CustomSingleton.getInstnce().incrementExecuteCount();
}
}
}
}
今
何かのようには.. entry
セクションauthenticators
に、次の/server/default/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml
追加でserver
でこれを登録する必要があります。
<entry>
<key>CUSTOM-FORM</key>
<value>full.qaulified.CustomFormAuthenticator</value>
</entry>
次に、web.xmlにこのことができますCUSTOM-FORM
<login-config>
<auth-method>CUSTOM-FORM</auth-method>
<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/login-error.html</form-error-page>
</form-login-config>
<login-config>
auth-method
として希望..
春は 'acegi'が成功のログインとログアウトのためのフックやイベントを提供していますが、わかりません回避策とは別にプレーンな 'JAAS'を使用した単純な解決策です。あなたが春のacegiに切り替えることができれば、それはより簡単でしょう。 –
@ Rp-残念ながら、このアプリケーションスタックにはSpringはありません。SpringとJBossのEJBがよく一緒に動かない傾向があることを考えれば、私はそのパスを下回らない方がよいでしょう... – Erica
私が考えることができる回避策は、 'org.apache.catalina.authenticator.FormAuthenticator'を拡張して'/server/default/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml'に登録する 'CustomFormAuthenticator'です。 Jboss AS 7では、jboss-web.xml iteselfに 'CustomAuthenticator'を登録できる' valve'コンセプトが導入されました。 –