Skip to content

Instantly share code, notes, and snippets.

Demo showing how to hook up custom callbacks for token creation and validation.
Extending anti-forgery tokens in ASP.NET Core
Creating a custom ticket store
Demos showcasing data protection capabilities of ASP.NET Identity Core
The second demo shows how to extend authorization using the custom user info.
@conwid
conwid / 01Extending user info
Last active May 16, 2023 16:43
Data model extensions
The first demo shows how to extend the user information stored in the database.
@conwid
conwid / IniFormatter.cs
Last active May 16, 2023 14:37
More complete IFormatter implementation reference for students preparing for MS 70-483
public class IniFormatter : IFormatter
{
public class IniTypeBinder : SerializationBinder
{
public override Type BindToType(string assemblyName, string typeName) => Type.GetType(typeName.Split('=')[1]);
public override void BindToName(Type serializedType, out string assemblyName, out string typeName)
{
assemblyName = $"{IniFormatter.AssemblyNameKey}={serializedType.Assembly.FullName}";
typeName = $"{IniFormatter.ClassNameKey}={serializedType.AssemblyQualifiedName}";
}