How to add external login to an existing Identity Framework account

I am trying to add an external login (facebook / twitter) to an existing account using the api / Account / AddExternalLogin method from the WebAPI2 template, but the method always returns 500 status because this ticket is null:

AuthenticationTicket ticket = AccessTokenFormat.Unprotect(model.ExternalAccessToken);

Maybe I'm doing something wrong?

First I call api / Account / ExternalLogin , then api / Account / RegisterExternal . These methods create an account by adding a link to an external login.

Then I log in with another service, get the access token and send it as a parameter to api / Account / ExternalLogin

+4
source share

All Articles