I have built a winforms app in c# to request an auth token from ADFS (windowsmixed), which works fine, and I'm issued a token. I'm using WIF/ThinkTecture IdentityModel.
What is the best way to cache/save the token locally and then re-load the token (so i can then validate)?
I'm issued a token in the form of a GenericXmlSecurityToken object. Whats the best way to save/cache this to a file and then reload/serialize it into a new GenericXmlSecurityToken object?
I can convert the token to string and save:
string strToken = ((GenericXmlSecurityToken)genericToken).TokenXml.OuterXml;
But I'm not sure how to re-serializer this string back into GenericXmlSecurityToken or even if this is the best approach (I appreciate extra security is required when saving the token to disk, thats a future task).