public void VstsAadSetCredentialsTest()
        {
            TargetUri             targetUri         = DefaultTargetUri;
            VstsAadAuthentication aadAuthentication = GetVstsAadAuthentication("aad-set");
            Credential            credentials       = DefaultCredentials;

            aadAuthentication.SetCredentials(targetUri, credentials);

            Assert.Null(aadAuthentication.PersonalAccessTokenStore.ReadCredentials(targetUri));
            Assert.Null(credentials = aadAuthentication.GetCredentials(targetUri));
        }
        public async Task VstsAadSetCredentialsTest()
        {
            TargetUri             targetUri         = DefaultTargetUri;
            VstsAadAuthentication aadAuthentication = GetVstsAadAuthentication(RuntimeContext.Default, "aad-set");
            Credential            credentials       = DefaultCredentials;

            await aadAuthentication.SetCredentials(targetUri, credentials);

            Assert.Null(await aadAuthentication.PersonalAccessTokenStore.ReadCredentials(targetUri));
            Assert.Null(credentials = await aadAuthentication.GetCredentials(targetUri));
        }
Exemplo n.º 3
0
        public void VstsAadSetCredentialsTest()
        {
            TargetUri             targetUri         = DefaultTargetUri;
            VstsAadAuthentication aadAuthentication = GetVstsAadAuthentication("aad-set");
            Credential            credentials       = DefaultCredentials;

            aadAuthentication.SetCredentials(targetUri, credentials);

            Assert.IsNull(aadAuthentication.PersonalAccessTokenStore.ReadCredentials(targetUri), "Personal Access Token unexpectedly found in store.");
            Assert.IsNull(credentials = aadAuthentication.GetCredentials(targetUri), "Credentials were retrieved unexpectedly.");
        }
Exemplo n.º 4
0
        public void VstsAadSetCredentialsTest()
        {
            TargetUri             targetUri         = DefaultTargetUri;
            VstsAadAuthentication aadAuthentication = GetVstsAadAuthentication("aad-set");
            Credential            credentials       = DefaultCredentials;

            Credential personalAccessToken;
            Token      azureToken;

            Assert.IsFalse(aadAuthentication.SetCredentials(targetUri, credentials), "Credentials were unexpectedly set.");

            Assert.IsFalse(aadAuthentication.PersonalAccessTokenStore.ReadCredentials(targetUri, out personalAccessToken), "Personal Access Token unexpectedly found in store.");
            Assert.IsFalse(aadAuthentication.AdaRefreshTokenStore.ReadToken(targetUri, out azureToken), "ADA Refresh Token unexpectedly found in store.");
            Assert.IsFalse(aadAuthentication.GetCredentials(targetUri, out credentials), "Credentials were retrieved unexpectedly.");
        }