Пример #1
0
 public long CreateLogin(ExternalLogin login)
 {
     var inserted = _externalLoginsRepository.Insert(login);
     _unit.Commit();
     Log.InfoFormat("Created login for user.  LoginProvider={0} LoginId={1} UserName={2}", login.LoginProvider, login.Id, login.UserName);
     return inserted.Id;
 }
Пример #2
0
 public void RemoveLogin(ExternalLogin login)
 {
     _externalLoginsRepository.Delete(login);
     _unit.Commit();
     Log.InfoFormat("Removed login from user.  LoginProvider={0} LoginId={1} UserName={2}", login.LoginProvider, login.Id, login.UserName);
 }
Пример #3
0
 public IdentityUser FindUser(ExternalLogin login)
 {
     var externalLogin = _externalLoginsRepository.FirstOrDefault(l => l.ProviderKey == login.ProviderKey);
     if (externalLogin == null || externalLogin.User == null)
     {
         Log.ErrorFormat("Could not find IdentityUser by ExternalLogin.  LoginProvider={0} LoginId={1} UserName={2}", login.LoginProvider, login.Id, login.UserName);
     }
     return externalLogin.User;
 }