public bool OAuthLogin(OAuthAccount account, bool remember) { AuthenticationClientData oauthProvider = _authenticationClients[account.Provider]; HttpContextBase context = _applicationEnvironment.AcquireContext(); var securityManager = new OpenAuthSecurityManager(context, oauthProvider.AuthenticationClient, this); bool success = securityManager.Login(account.ProviderUserId, remember); if (success) { return(true); } User user = GetUserByEmailAddress(account.Username); if (user == null) { return(false); } user.OAuthAccounts.Add(account); _userCollection.Save(user); return(securityManager.Login(account.ProviderUserId, remember)); }
public static void RegisterClient(IAuthenticationClient client, string displayName, IDictionary<string, object> extraData) { var clientData = new AuthenticationClientData(client, displayName, extraData); _authenticationClients.Add(client.ProviderName, clientData); }
public static void RegisterClient(IAuthenticationClient client, string displayName, IDictionary <string, object> extraData) { var clientData = new AuthenticationClientData(client, displayName, extraData); _authenticationClients.Add(client.ProviderName, clientData); }
public void RequestOAuthAuthentication(string provider, string returnUrl) { AuthenticationClientData client = _authenticationClients[provider]; _applicationEnvironment.RequestAuthentication(client.AuthenticationClient, this, returnUrl); }