Let's start with the first one:
[HttpGet("ExternalLogin/{provider}")]public IActionResult ExternalLogin(string provider, string returnUrl = null){ switch (provider.ToLower()) { case "facebook": // case "google": // case "twitter": // todo: add all supported providers here // Redirect the request to the external provider. var redirectUrl = Url.Action( nameof(ExternalLoginCallback), "Token", new { returnUrl }); var properties = SignInManager.ConfigureExternalAuthenticationProperties( provider, redirectUrl); return Challenge(properties, provider); default: // provider not supported return BadRequest(new { Error = String.Format("Provider '{0}' is not supported.", provider) }); }}
The code is quite straightforward. ...