How can I use persisted cookies from a file using phantomjs

Phantom JS and cookies –cookies-file=cookies.txt will only store non-session cookies in the cookie jar. Login and authentication is more commonly based on session cookies. What about session cookies? To save these is quite simple, but you should consider that they will likely expire quickly. You need to write your program logic to consider this. For … Read more

How does OpenID authentication work?

What is OpenID? OpenID is an open, decentralized, free framework for user-centric digital identity. OpenID takes advantage of already existing internet technology (URI, HTTP, SSL, Diffie-Hellman) and realizes that people are already creating identities for themselves whether it be at their blog, photostream, profile page, etc. With OpenID you can easily transform one of these … Read more

Multiple IdentityServer Federation : Error Unable to unprotect the message.State

I believe you are getting the Unable to unprotect the message.State error because one of your OIDC providers is trying to decrypt/unprotect the message state of the other one. (The message state is just a random string to help with security.) I suggest that you name the AuthenticationSchemes for each OIDC provider like oidc-demo and … Read more

How to use Client Certificate Authentication in iOS App

Your NSURLConnection delegate should respond to the connection:didReceiveAuthenticationChallenge: delegate method (see link below). It should respond by asking the challenge for its ‘sender’ and providing it with an appropriate credential. Something like: – (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { id sender = [challenge sender]; // create a credential from a certificate // see doco for … Read more

ASP.NET MVC 3 using Authentication

Save the UserID in the UserData property of the FormsAuthentication ticket in the authorization cookie when the user logs on: string userData = userID.ToString(); FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, user.Email, DateTime.Now, DateTime.Now.AddMinutes(FormsAuthentication.Timeout.TotalMinutes), createPersistentCookie, userData); string hashedTicket = FormsAuthentication.Encrypt(ticket); HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, hashedTicket); HttpContext.Current.Response.Cookies.Add(cookie); You can read it back in the PostAuthenticateRequest method in … Read more