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). http://developer.apple.com/library/ios/documentation/cocoa/reference/foundation/Classes/NSURLConnection_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/connection:didReceiveAuthenticationChallenge: 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

Twitter Call back URL

I had the same problem and the TwitterKit documentation is not accurate or Twitter has changed their policies. In any case, on the Twitter Apps site, the callback URL has to be set very specifically. The callback URL should be in the format: twitterkit-{consumer/api key}:// For example: twitterkit-128238aKjqlp123AKdasdf:// Also, this needs to be registered in … Read more