Ejemplo n.º 1
0
 internal VisualStudioCodeCredential(string tenantId, CredentialPipeline pipeline, MsalPublicClient client, IFileSystemService fileSystem, IVisualStudioCodeAdapter vscAdapter)
 {
     _tenantId   = tenantId ?? "common";
     _pipeline   = pipeline;
     _client     = client ?? pipeline.CreateMsalPublicClient(ClientId);
     _fileSystem = fileSystem ?? FileSystemService.Default;
     _vscAdapter = vscAdapter ?? GetVscAdapter();
 }
        internal InteractiveBrowserCredential(string tenantId, string clientId, CredentialPipeline pipeline, bool attachSharedCache)
        {
            if (clientId is null)
            {
                throw new ArgumentNullException(nameof(clientId));
            }

            _pipeline = pipeline;

            _client = _pipeline.CreateMsalPublicClient(clientId, tenantId, "http://localhost", attachSharedCache);
        }
Ejemplo n.º 3
0
        internal InteractiveBrowserCredential(string tenantId, string clientId, CredentialPipeline pipeline, TokenCredentialOptions options)
        {
            if (clientId is null)
            {
                throw new ArgumentNullException(nameof(clientId));
            }

            _pipeline = pipeline;

            _client = _pipeline.CreateMsalPublicClient(clientId, tenantId, "http://localhost", options as ITokenCacheOptions);
        }
 internal VisualStudioCodeCredential(string tenantId, CredentialPipeline pipeline, IFileSystemService fileSystem, IVisualStudioCodeAdapter vscAdapter)
     : this(tenantId, pipeline, pipeline.CreateMsalPublicClient(ClientId), fileSystem, vscAdapter)
 {
 }
 internal UsernamePasswordCredential(string username, string password, string tenantId, string clientId, CredentialPipeline pipeline, TokenCredentialOptions options = default)
     : this(username, password, pipeline, pipeline.CreateMsalPublicClient(clientId, tenantId, cacheOptions : options as ITokenCacheOptions))
 {
 }
 internal SharedTokenCacheCredential(string tenantId, string username, CredentialPipeline pipeline)
     : this(tenantId : tenantId, username : username, pipeline : pipeline, client : pipeline.CreateMsalPublicClient(Constants.DeveloperSignOnClientId, tenantId : tenantId, attachSharedCache : true))
 {
 }
Ejemplo n.º 7
0
 internal UsernamePasswordCredential(string username, string password, string tenantId, string clientId, CredentialPipeline pipeline)
     : this(username, password, pipeline, pipeline.CreateMsalPublicClient(clientId, tenantId))
 {
 }
Ejemplo n.º 8
0
 internal SharedTokenCacheCredential(string tenantId, string username, CredentialPipeline pipeline, TokenCredentialOptions options)
     : this(tenantId : tenantId, username : username, pipeline : pipeline, client : pipeline.CreateMsalPublicClient(Constants.DeveloperSignOnClientId, tenantId : tenantId, cacheOptions : (options as ITokenCacheOptions) ?? s_DefaultCacheOptions))
 {
 }
 internal DeviceCodeCredential(Func <DeviceCodeInfo, CancellationToken, Task> deviceCodeCallback, string tenantId, string clientId, CredentialPipeline pipeline, TokenCredentialOptions options)
     : this(deviceCodeCallback, clientId, pipeline, pipeline.CreateMsalPublicClient(clientId, tenantId, redirectUrl : KnownAuthorityHosts.GetDeviceCodeRedirectUri(pipeline.AuthorityHost).ToString(), options as ITokenCacheOptions))
 {
 }
 internal DeviceCodeCredential(Func <DeviceCodeInfo, CancellationToken, Task> deviceCodeCallback, string tenantId, string clientId, CredentialPipeline pipeline)
     : this(deviceCodeCallback, clientId, pipeline, pipeline.CreateMsalPublicClient(clientId, tenantId, redirectUrl : "https://login.microsoftonline.com/common/oauth2/nativeclient"))
 {
 }