public void VstsAadDeleteCredentialsTest()
        {
            TargetUri             targetUri         = DefaultTargetUri;
            VstsAadAuthentication aadAuthentication = GetVstsAadAuthentication("aad-delete");

            aadAuthentication.PersonalAccessTokenStore.WriteCredentials(targetUri, DefaultPersonalAccessToken);

            aadAuthentication.DeleteCredentials(targetUri);
            Assert.Null(aadAuthentication.PersonalAccessTokenStore.ReadCredentials(targetUri));

            aadAuthentication.DeleteCredentials(targetUri);
            Assert.Null(aadAuthentication.PersonalAccessTokenStore.ReadCredentials(targetUri));
        }
예제 #2
0
        public void VstsAadDeleteCredentialsTest()
        {
            TargetUri             targetUri         = DefaultTargetUri;
            VstsAadAuthentication aadAuthentication = GetVstsAadAuthentication("aad-delete", null);

            aadAuthentication.PersonalAccessTokenStore.WriteCredentials(targetUri, DefaultPersonalAccessToken);

            aadAuthentication.DeleteCredentials(targetUri);
            Assert.IsNull(aadAuthentication.PersonalAccessTokenStore.ReadCredentials(targetUri), "Personal Access Tokens were not deleted as expected");

            aadAuthentication.DeleteCredentials(targetUri);
            Assert.IsNull(aadAuthentication.PersonalAccessTokenStore.ReadCredentials(targetUri), "Personal Access Tokens were not deleted as expected");
        }
        public void VstsAadDeleteCredentialsTest()
        {
            TargetUri             targetUri         = DefaultTargetUri;
            VstsAadAuthentication aadAuthentication = GetVstsAadAuthentication("aad-delete");

            if (aadAuthentication.VstsAuthority is AuthorityFake fake)
            {
                fake.CredentialsAreValid = false;
            }

            aadAuthentication.PersonalAccessTokenStore.WriteCredentials(targetUri, DefaultPersonalAccessToken);

            aadAuthentication.DeleteCredentials(targetUri);
            Assert.Null(aadAuthentication.PersonalAccessTokenStore.ReadCredentials(targetUri));

            aadAuthentication.DeleteCredentials(targetUri);
            Assert.Null(aadAuthentication.PersonalAccessTokenStore.ReadCredentials(targetUri));
        }
예제 #4
0
        public void VstsAadDeleteCredentialsTest()
        {
            TargetUri             targetUri         = DefaultTargetUri;
            VstsAadAuthentication aadAuthentication = GetVstsAadAuthentication("aad-delete");

            aadAuthentication.PersonalAccessTokenStore.WriteCredentials(targetUri, DefaultPersonalAccessToken);
            aadAuthentication.AdaRefreshTokenStore.WriteToken(targetUri, DefaultAzureRefreshToken);

            Credential personalAccessToken;
            Token      azureToken;

            aadAuthentication.DeleteCredentials(targetUri);
            Assert.IsFalse(aadAuthentication.PersonalAccessTokenStore.ReadCredentials(targetUri, out personalAccessToken), "Personal Access Tokens were not deleted as expected");
            Assert.IsTrue(aadAuthentication.AdaRefreshTokenStore.ReadToken(targetUri, out azureToken), "Refresh Token wasn't read as expected.");

            aadAuthentication.DeleteCredentials(targetUri);
            Assert.IsFalse(aadAuthentication.PersonalAccessTokenStore.ReadCredentials(targetUri, out personalAccessToken), "Personal Access Tokens were not deleted as expected");
            Assert.IsFalse(aadAuthentication.AdaRefreshTokenStore.ReadToken(targetUri, out azureToken), "Refresh Token were not deleted as expected.");
        }