Пример #1
0
        internal static string LoadPassword(GitCredentials.Entry entry)
        {
            string pass = null;

            if (SeletedAdapter != null)
            {
                try
                {
                    if (!SeletedAdapter.LoadPassword(SeletedAdapter.FormatUrl(entry.URL), ref pass))
                    {
                        Debug.LogFormat("Could not load password with URL: {0} from {1}", entry.URL, GetAdapterName(SeletedAdapter));
                    }
                }
                catch (Exception e)
                {
                    Debug.LogError("There was an error while trying to load credentials from Windows Credentials Manager");
                    Debug.LogException(e);
                }
            }

            return(pass ?? entry.DecryptPassword());
        }
Пример #2
0
        internal SecureString LoadPassword(GitCredential entry)
        {
            if (SeletedAdapter != null)
            {
                try
                {
                    SecureString pass;
                    if (SeletedAdapter.LoadPassword(entry.ManagerUrl, out pass))
                    {
                        return(pass);
                    }
                }
                catch (Exception e)
                {
                    logger.Log(LogType.Error, "There was an error while trying to load credentials from Windows Credentials Manager");
                    logger.LogException(e);
                }

                return(new SecureString());
            }

            return(entry.DecryptPassword());
        }