2
My application authenticates users through STS. Authentication can go to STS and validate the user PIN on the card. But how do I have it redirected to the "home" page of my site after authentication?
Addendum:
- I don’t have access to the STS admin;
- I use the component
FederatedPassiveSignIn
contained in:Microsoft.IdentityModel.Web.Controls
; - I Tried Using the Method
Signed_in
to try to capture the moment after authentication to STS but it did not work; - The way I was able to redirect earlier was by using Event
Load
, however, this is executed every time the page is loaded (obvious).
Follows Code:
<div style="margin-left: 360px; margin-top: 100px; margin-bottom: 100px;">
<wif:FederatedPassiveSignIn ID="FederatedPassiveSignIn1" runat="server"
Issuer="<%$AppSettings:CORP.STS.Certificado%>"
RequireHttps="False" Realm="<%$AppSettings:CORP.STS.UrlCliente%>"
UseFederationPropertiesFromConfiguration="false" RememberMeText="Lembre minha Senha."
SignInImageUrl="~/Images/ec_b.gif" TitleText="Autenticar Certificado Digital" OnSignedIn="FederatedPassiveSignIn1_SignedIn" >
<SignInButtonStyle Height="80px" />
</wif:FederatedPassiveSignIn>
<div id="errorMessage">
<asp:Label Text="text" ID="lblError" runat="server" Visible="false" ForeColor="Red" style="margin-left:-200px;" />
</div>
</div>
and on the part of code Behind:
protected void FederatedPassiveSignIn1_SignedIn(object sender, EventArgs e)
{
Response.Redirect("MinhaPagina.aspx");
}
Unable to perform an Ajax routine that returns if the user is logged in?
– Tiago César Oliveira
no. I will only know if the user is logged in if STS tells me yes or no.
– okevinlira
So... Isn’t it possible to do a periodic query to the method that returns login status, and take the relevant action from that moment on? You would have a server side that would just return the status, and would be in charge of Javascript, via AJAX, check the login status of the user and redirect it, if applicable.
– Tiago César Oliveira
It works like this, Passive authentication, goes to STS, does what you have to do for it. and returns me a Token saying whether it is authenticated or not. The point is: Where do I check the token? in which event? from that point I will know how to redirect to page. There is no way to see this via JS, as I have to see the Chain of Claims that STS returned to me.
– okevinlira
It is expensive, unfortunately in this case I will not be able to help you... I do not understand the architecture you are using. Let’s hope there’s someone more enlightened around here!
– Tiago César Oliveira
@okevinlira You can put the complete code of your class
FederatedPassiveSignIn
? I suspect the event is not being fired.– Leonel Sanches da Silva
Gypsy, Federatedpassivesignin is a class of Microsoft.IdentityModel.Web.Controls; there’s no way I can give you her code rs,
– okevinlira
@Kenny Rafael, it’s a C# Yes! although I don’t have (large) C# code in the body of the question, how would I solve a Windows Federation Authentication (WIF) authentication if it wasn’t for C#?
– okevinlira
it wasn’t I who removed the c tag#...
– Kenny Rafael
Vish, it was bad then, is that appeared your name in the revision, anyway, whoever it is, did wrong...
– okevinlira