AuthenticationManager.GetExternalLoginInfoAsync() returns NULL

There is a problem when trying to use "GetExternalLoginInfoAsync()".

This is a problem when using wsFederation so if you setup federation following these instructions.

Then when trying the following:

[AllowAnonymous] public async Task<ActionResult> ExternalLoginCallback(string returnUrl) {

var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();

}

The only way you will get the loginInfo is using the following:

var loginInfo = await AuthenticationManager.AuthenticateAsync(AuthenticationTypes.Federation)

There are other examples using externalCookie out in the wilds.

If you debug and look at the AuthenticationManager you will find what authentication type is being used. I have found that if using "wsFederation" then "AuthenticationTypes.Federation" is the key to use to not get NULL above.