private Credentials GetSSOCredentials(string affiliate)
        {
            string      externalUsername;
            ISSOLookup1 lookup = new ISSOLookup1();

            string[] creds = lookup.GetCredentials(affiliate, 0, out externalUsername);

            return(new Credentials {
                Username = externalUsername, Password = creds[0]
            });
        }
Esempio n. 2
0
        /// <summary>
        /// Looks up a set of credentials for an affiliate application in SSO.
        /// </summary>
        /// <param name="affiliateApplication">The affiliate application for which credentials should be looked up in SSO.</param>
        /// <returns>The requested credentials.</returns>
        public static string LookupCredentials(string affiliateApplication, out string userId)
        {
            try
            {
                ISSOLookup1 ssoLookup = new ISSOLookup1();
                string[]    results   = ssoLookup.GetCredentials(affiliateApplication, SSOFlag.SSO_FLAG_REFRESH, out userId);

                //return password
                return(results[0]);
            }
            catch (Exception ex)
            {
                Logger.WriteWarning(ex.ToString());
                throw ex;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Retrieves the credentials to use.
        /// </summary>
        /// <param name="appName">The name of the affiliate application to represent the configuration container to access</param>
        /// <returns>Credentials to use.</returns>
        public static Credentials GetCredentials(string appName)
        {
            Credentials credentials;

            try
            {
                ISSOLookup1 ssoLookup = (ISSOLookup1) new SSOLookup();
                var         passwords = ssoLookup.GetCredentials(appName, 0, out credentials.Username);
                credentials.Password = passwords[0];
            }
            catch (Exception e)
            {
                System.Diagnostics.Trace.WriteLine(e.Message);
                throw;
            }
            return(credentials);
        }