SAML2 Service Provider Web アプリケーションを .NET MVC でビルドします (3)。認証には、Shibboleth SPではなく、 ComponentSpace の SAML2 ライブラリを使用しています。関連するコントローラーロジックは次のとおりです。
public class SignOnController : Controller
{
// constructor-inject _services
[HttpPost]
public ActionResult SendAuthnRequest(string userName, string returnUrl)
{
// this users ComponentSpace internally to push user to IdP
_services.SamlServiceProvider.SendAuthnRequest(args);
return new EmptyResult();
}
[HttpPost]
public ActionResult ReceiveAuthnResponse()
{
var samlResponse = _services.SamleServiceProvider
.ReceiveSamlResponse(args);
// ...
return Redirect(samlResponse.RelayResourceUrl ?? defaultUrl);
}
}
最終的に、ユーザーはリレー URL またはデフォルトのログイン ページに到達します。ただし、リンクをクリックして [戻る] ボタンをクリックすると、ブラウザーは Shibboleth IdP サーバーのエラー ページに戻ります。その後、ブラウザの進むボタンと戻るボタンは最終的に役に立たなくなります。
上記の方法のいずれかで何か間違っていますか? 送信時に EmptyResult() ではなく View() を返す必要がありますか? IdP へのポストバックが繰り返されるのを防ぐためにブラウザの履歴をリセットする方法はありますか? これは、ComponentSpace の実装で構成できるものですか?