ユーザーを得たが、私は次のコントローラに行くときの認証後、私はrequest.getUserPrincipal()
ヌルを得ました。私はwebsphere 7を使用しています。私のアプリケーションはspring mvcです。request.getUserPrincipal()は正常に認証ヌル
System.out.println("subject.getPrincipals(): " + subject.getPrincipals());
WSSubject.setRunAsSubject(subject);
ログインコントローラsubject.getPrincipalsにおける認証()元本を返しますが、私は次のコントローラに行くとき、私はrequest.getUserPrincipal()
ヌルを得た後。
web.xmlの
<security-role>
<role-name>Administrator</role-name>
</security-role>
<security-constraint>
<display-name>manager_Service</display-name>
<web-resource-collection>
<web-resource-name>manageservice</web-resource-name>
<url-pattern>/manageServiceList.htm</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Administrator</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
application.xmlの
<security-role>
<role-name>Administrator</role-name>
</security-role>
IBM-アプリケーション-bnd.xml
<security-role name="Administrator">
<group name="Administrator" />
</security-role>
会社erは管理者グループに属します。私のすべてのデプロイメント記述子はうまくセットアップされています。私が間違っているところは?
他のリソースがあります。しかし、これは私の問題ではありません。保護されたリソースにアクセスするか保護されないかは、プリンシパルが存在する必要があります。 –
それはあなたの望むものかもしれませんが、それはうまくいかないかもしれません:私が正しく覚えていれば、あなたは人口原理を使ってリクエストを得るためにリソースを守る必要があります。しかし、もちろん、制限なしにリソースを守ることは合法です(すべて許可する)。 – Ralph
私の質問を参照してください:「)(ログインコントローラsubject.getPrincipalsで認証した後に元本を返しますが、私は次のコントローラに行くとき、私はrequest.getUserPrincipal()はnullを得ました」。何が問題ですか?なぜ私はそれがnullになったのですか? –