Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the CredentialDetails class.
        /// </summary>
        public CredentialDetails(CredentialsBase credentialsBase, PrivacyLevel privacyLevel, EncryptedConnection encryptedConnection, ICredentialsEncryptor credentialsEncryptor = null, bool?useEndUserOAuth2Credentials = default(bool?))
            : this(privacyLevel, encryptedConnection, credentialsEncryptor, useEndUserOAuth2Credentials)
        {
            var credentials = new CredentialsRequest
            {
                CredentialData = credentialsBase.CredentialData.Select((pair) => new NameValuePair(pair.Key, pair.Value))
            };

            var credentialsJson = JsonConvert.SerializeObject(credentials);

            if (credentialsEncryptor != null)
            {
                credentialsJson = credentialsEncryptor.EncodeCredentials(credentialsJson);
            }

            Credentials    = credentialsJson;
            CredentialType = credentialsBase.CredentialType;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the CredentialDetails class.
 /// </summary>
 protected CredentialDetails(PrivacyLevel privacyLevel, EncryptedConnection encryptedConnection, ICredentialsEncryptor credentialsEncryptor, bool?useEndUserOAuth2Credentials = default(bool?))
 {
     EncryptedConnection         = encryptedConnection;
     EncryptionAlgorithm         = credentialsEncryptor != null ? EncryptionAlgorithm.RSAOAEP : EncryptionAlgorithm.None;
     PrivacyLevel                = privacyLevel;
     UseCallerAADIdentity        = false;
     UseEndUserOAuth2Credentials = useEndUserOAuth2Credentials;
     CustomInit();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the CredentialDetails class.
 /// </summary>
 protected CredentialDetails(PrivacyLevel privacyLevel, EncryptedConnection encryptedConnection, ICredentialsEncryptor credentialsEncryptor)
 {
     EncryptedConnection  = encryptedConnection;
     EncryptionAlgorithm  = credentialsEncryptor != null ? EncryptionAlgorithm.RSAOAEP : EncryptionAlgorithm.None;
     PrivacyLevel         = privacyLevel;
     UseCallerAADIdentity = false;
     CustomInit();
 }