What I ended up doing was moving the Logout logic into a Model class
public class LogoutHandler
{
public string Signout()
{
// Load Identity Configuration
FederationConfiguration config = FederatedAuthentication.FederationConfiguration;
// Get wtrealm from WsFederationConfiguation Section
string wtrealm = config.WsFederationConfiguration.Realm;
string wreply;
wreply = wtrealm;
// Read the ACS Ws-Federation endpoint from web.Config
string wsFederationEndpoint = ConfigurationManager.AppSettings["ida:Issuer"];
SignOutRequestMessage signoutRequestMessage = new SignOutRequestMessage(new Uri(wsFederationEndpoint));
signoutRequestMessage.Parameters.Add("wreply", wreply);
signoutRequestMessage.Parameters.Add("wtrealm", wtrealm);
FederatedAuthentication.SessionAuthenticationModule.SignOut();
return signoutRequestMessage.WriteQueryString();
}
}
And having my logout action call that class to return the URL, and then Redirect to it. All worked well then, though I don't know if there is anything to take into account with mobile
public ActionResult Logout()
{
string signoutUrl = new LogoutHandler().Signout();
return Redirect(signoutUrl);
}