I've spent a long time trying to convert an ASP.NET 5.0 app to ASP.NET Core 2 and I just can't find a few things. I'm trying to get the list of external providers (Google, Facebook, etc.) that are supported by the current installation. Pre Core, I would have used:
Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes()
Of course, I can't use that anymore due to the OWIN reference, but I haven't been able to find a similar function anywhere else either. I don't want to have to set it manually. Is there a sample of using this to create a nice social login page? Any help would be much appreciated!
Do you need SignInManager.GetExternalAuthenticationSchemesAsync?
var loginProviders = (await SignInManager.GetExternalAuthenticationSchemesAsync()).ToList();
<div>
<p>
@foreach (var provider in loginProviders)
{
<button type="submit" class="btn btn-default" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
}
</p>
</div>
</form>
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With