internal async Task <Microsoft.Azure.Management.Graph.RBAC.Fluent.IServicePrincipal> RefreshCredentialsAsync(CancellationToken cancellationToken = default(CancellationToken)) { IEnumerable <KeyCredential> keyCredentials = await manager.Inner.ServicePrincipals.ListKeyCredentialsAsync(Id(), cancellationToken); this.cachedCertificateCredentials = new Dictionary <string, ICertificateCredential>(); if (keyCredentials != null) { foreach (var cred in keyCredentials) { ICertificateCredential cert = new CertificateCredentialImpl <IServicePrincipal>(cred); this.cachedCertificateCredentials.Add(cert.Id, cert); } } IEnumerable <Models.PasswordCredential> passwordCredentials = await manager.Inner.ServicePrincipals.ListPasswordCredentialsAsync(Id(), cancellationToken); this.cachedPasswordCredentials = new Dictionary <string, IPasswordCredential>(); if (passwordCredentials != null) { foreach (var cred in passwordCredentials) { IPasswordCredential cert = new PasswordCredentialImpl <IServicePrincipal>(cred); this.cachedPasswordCredentials.Add(cert.Id, cert); } } return(this); }
public ActiveDirectoryApplicationImpl WithCertificateCredential <T>(CertificateCredentialImpl <T> credential) where T : class { if (IsInCreateMode()) { if (createParameters.KeyCredentials == null) { createParameters.KeyCredentials = new List <KeyCredential>(); } createParameters.KeyCredentials.Add(credential.Inner); } else { if (updateParameters.KeyCredentials == null) { updateParameters.KeyCredentials = new List <KeyCredential>(); } updateParameters.KeyCredentials.Add(credential.Inner); } return(this); }
internal async Task <Microsoft.Azure.Management.Graph.RBAC.Fluent.IActiveDirectoryApplication> RefreshCredentialsAsync(CancellationToken cancellationToken = default(CancellationToken)) { IEnumerable <KeyCredential> keyCredentials = await manager.Inner.Applications.ListKeyCredentialsAsync(Id(), cancellationToken); this.cachedCertificateCredentials = new Dictionary <string, ICertificateCredential>(); foreach (var cred in keyCredentials) { ICertificateCredential cert = new CertificateCredentialImpl <IActiveDirectoryApplication>(cred); this.cachedCertificateCredentials.Add(cert.Name, cert); } IEnumerable <Models.PasswordCredential> passwordCredentials = await manager.Inner.Applications.ListPasswordCredentialsAsync(Id(), cancellationToken); this.cachedPasswordCredentials = new Dictionary <string, IPasswordCredential>(); foreach (var cred in passwordCredentials) { IPasswordCredential cert = new PasswordCredentialImpl <IActiveDirectoryApplication>(cred); this.cachedPasswordCredentials.Add(cert.Name, cert); } return(this); }
public ServicePrincipalImpl WithCertificateCredential <T>(CertificateCredentialImpl <T> credential) where T : class { this.certificateCredentialsToCreate.Add(credential); return(this); }
/// <summary> /// Attach a credential to this model. /// </summary> /// <param name="credential">The credential to attach to.</param> /// <return>The interface itself.</return> IUpdate Microsoft.Azure.Management.Graph.RBAC.Fluent.IHasCredential <IUpdate> .WithCertificateCredential(CertificateCredentialImpl <IUpdate> credential) { return(this.WithCertificateCredential(credential) as Microsoft.Azure.Management.Graph.RBAC.Fluent.ServicePrincipalImpl); }
/// <summary> /// Attach a credential to this model. /// </summary> /// <param name="credential">The credential to attach to.</param> /// <return>The interface itself.</return> IWithCreate Microsoft.Azure.Management.Graph.RBAC.Fluent.IHasCredential <IWithCreate> .WithCertificateCredential(CertificateCredentialImpl <IWithCreate> credential) { return(this.WithCertificateCredential(credential)); }
/// <summary> /// Attach a credential to this model. /// </summary> /// <param name="credential">The credential to attach to.</param> /// <return>The interface itself.</return> IWithCreate Microsoft.Azure.Management.Graph.RBAC.Fluent.IHasCredential <IWithCreate> .WithCertificateCredential(CertificateCredentialImpl <IWithCreate> credential) { return(this.WithCertificateCredential(credential) as Microsoft.Azure.Management.Graph.RBAC.Fluent.ActiveDirectoryApplicationImpl); }