/// <summary> /// Authenticates via an OAuth2 authentication provider. /// </summary> /// <param name="identityProvider"></param> /// <returns></returns> public void OAuthAuthenticate(IdentityProvider identityProvider, string returnUrl) { // Only allow local URLs as return URLs if (returnUrl != null && !Url.IsLocalUrl(returnUrl)) { returnUrl = null; } Authentication.AuthenticateOrRedirect(identityProvider, returnUrl); }
/// <summary> /// Called by the Facebook server. /// </summary> /// <param name="returnUrl"></param> public void FacebookCallback(string returnUrl) { Authentication.AuthenticateOrRedirect(IdentityProvider.Facebook, returnUrl); }
/// <summary> /// Called by the Google server. /// </summary> /// <returns></returns> public void GoogleCallback() { Authentication.AuthenticateOrRedirect(IdentityProvider.Google, returnUrl: null); }