/// <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; }
/// <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(); }
/// <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(); }