RetrievePassword() public method

public RetrievePassword ( ) : void
return void
Ejemplo n.º 1
0
 private HttpClient client; // need to use same client to keep the cookies (for now)
 
 public MUConnector(PasswordCredential p)
 {
     user = p.UserName.ToLower(); //netid must be lowercase (yeah idk either)
     p.RetrievePassword();
     password = p.Password;
     InitClient();
 }
Ejemplo n.º 2
0
        public ICredentials GetCredentials()
        {
            PasswordCredential credentials = new PasswordCredential();

            try
            {
                // If FindAllByResource returns no results an exception is thrown instead of return NULL so this must be in the try/catch
                credentials = this._passwordVault.FindAllByResource("WANDAppCredentials").FirstOrDefault();
                credentials.RetrievePassword();
            }
            catch (Exception e)
            {
                credentials = null;
            }

            if (credentials == null)
                return null;
            else
                return new NetworkCredential(credentials.UserName, credentials.Password);
        }
Ejemplo n.º 3
0
        public void Add(PasswordCredential credential)
        {
            while (true)
            {
                var capture  = _credentials;
                var existing = capture.FirstOrDefault(c => Comparer.Instance.Equals(c, credential));

                ImmutableList <PasswordCredential> updated;
                if (existing == null)
                {
                    updated = capture.Add(credential);
                }
                else
                {
                    existing.RetrievePassword();
                    credential.RetrievePassword();

                    if (existing.Password == credential.Password)
                    {
                        // no change, abort update!
                        return;
                    }

                    updated = capture.Replace(existing, credential);
                }

                lock (_updateGate)
                {
                    if (capture == _credentials)
                    {
                        Persist(updated);
                        _credentials = updated;

                        return;
                    }
                }
            }
        }
Ejemplo n.º 4
0
 public static bool IsCachedCredentialsAvailable(PasswordCredential credential)
 {
     if (credential == null)
         return false;
         var user = new MobileServiceUser(credential.UserName);
         credential.RetrievePassword();
         user.MobileServiceAuthenticationToken = credential.Password;
         if (App.MobileService.IsTokenExpired(user))
             return false;
         return true;
     
         
     
 }
Ejemplo n.º 5
0
 public PclPasswordCredential(PasswordCredential credential)
 {
     Credential = credential;
     Credential.RetrievePassword();
 }