Migrate from SecurityContext to TokenStorage

Fix #300