1
I am using STS authentication, and given certain configuration in web.config
I can’t get my (Sign In) action to perform what it should.
to elute follows code:
[AllowAnonymous]
public class SegurancaController : SecurityController
{
public ActionResult Index()
{
....
}
[ValidateInput(false)]
[HttpPost]
[ActionName("Index")]
public ActionResult IndexPost()
{
....
}
}
Securitycontroller:
[AllowAnonymous]
public ActionResult SignIn(string issuer)
{
var wSFederationAuthenticationModule = FederatedAuthentication.WSFederationAuthenticationModule;
string str = null;
if (!base.User.Identity.IsAuthenticated)
{
str =
new SignInRequestMessage(new Uri(string.IsNullOrEmpty(issuer) ? wSFederationAuthenticationModule.Issuer : issuer),
wSFederationAuthenticationModule.Realm, wSFederationAuthenticationModule.Reply).WriteQueryString();
}
return new RedirectResult(str ?? wSFederationAuthenticationModule.Reply);
}
And Web.config
<authentication mode="Forms">
<forms loginUrl="~/Seguranca" name=".ASPXFORMSAUTH" timeout="2880" defaultUrl="~/home" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
NOTE: If tags <authorization><deny users="?" /></authorization>
are commented I can run the Normalmante URL... but I miss the check if the user is logged in.
What I get FUDID* is that the guys instead of participating, go around giving downvote...
– okevinlira
And it’s not just you.
– Leonel Sanches da Silva