How to resolve the error "Context not found for the workflow 'Identity_CreateUser'..." while using the self-registration feature?

The error message is the following when a the Self-Registration is attempted using the Register.cshtml.
“Context not found for the workflow ‘Identity_CreateUser’ Parameter name: name Actual value was Id.”

The problem is caused by not having the latest version of Security package.

Upgrading the security package alone did not solve the problem.

The following further steps were needed:

  1. User manager configuration in Startup.cs has to be adapted
  2. The configuration of application pool must be as described in the link
    Email Confirmation for a new user - can't create a confirmation token
  3. The “Invalid Token” error was caused as the token in confirmation URL wasn’t url encoded. This has been fixed in the build 2015.7.59

Another Issue:
If a user registers but does not confirm using the link and tries to re-register the following message comes up
“OrigamUser kann nicht hinzugefügt werden. Sie haben duplizierte Daten eingegeben. Daten können nicht gespeichert werden”

The application’s administrators do not have a way to manage the OrigamUser from the UI.
We have to delete the entry directly in the DB to allow the user to register again.