private void IssuedTokenWaitStop(
     VssCredentialsType credentialsType,
     Int32 providerId,
     Int32 issuedTokenId)
 {
     WriteEvent(17, (Int32)credentialsType, providerId, issuedTokenId);
 }
 private void AuthenticationSucceeded(VssCredentialsType credentialsType)
 {
     if (IsEnabled(EventLevel.Verbose, Keywords.Authentication))
     {
         WriteEvent(11, (Int32)credentialsType);
     }
 }
 private void IssuedTokenWaitStart(
     VssCredentialsType credentialsType,
     Int32 providerId,
     Guid waitForActivityId)
 {
     WriteEvent(16, (Int32)credentialsType, providerId, waitForActivityId);
 }
 private void WriteMessageEvent(
     VssCredentialsType param0,
     Int32 param1,
     String message,
     Action <VssCredentialsType, Int32, String> writeEvent)
 {
     writeEvent(param0, param1, message);
 }
 private void IssuedTokenProviderPromptRequired(
     VssCredentialsType credentialsType,
     Int32 providerId)
 {
     if (IsEnabled(EventLevel.Warning, Keywords.Authentication))
     {
         WriteEvent(29, (Int32)credentialsType, providerId);
     }
 }
 private void IssuedTokenAcquiring(
     VssCredentialsType credentialsType,
     Int32 providerId)
 {
     if (IsEnabled(EventLevel.Verbose, Keywords.Authentication))
     {
         WriteEvent(15, (Int32)credentialsType, providerId);
     }
 }
 private void AuthenticationError(
     VssCredentialsType credentialsType,
     Int32 providerId,
     String message)
 {
     if (IsEnabled(EventLevel.Error, Keywords.Authentication))
     {
         WriteEvent(27, (Int32)credentialsType, providerId, message);
     }
 }
 private void IssuedTokenRetrievedFromCache(
     VssCredentialsType credentialsType,
     Int32 providerId,
     Int32 issuedTokenId)
 {
     if (IsEnabled(EventLevel.Verbose, Keywords.Authentication))
     {
         WriteEvent(22, (Int32)credentialsType, providerId, issuedTokenId);
     }
 }
 private void IssuedTokenProviderRemoved(
     VssCredentialsType credentialsType,
     Int32 providerId,
     String parameters)
 {
     if (IsEnabled(EventLevel.Verbose, Keywords.Authentication))
     {
         WriteEvent(14, (Int32)credentialsType, providerId, parameters);
     }
 }
 private void IssuedTokenProviderCreated(
     VssCredentialsType credentialsType,
     Int32 providerId,
     String parameters)
 {
     if (IsEnabled())
     {
         WriteEvent(13, (Int32)credentialsType, providerId, parameters);
     }
 }
Example #11
0
        public void RetrieveToken_UnitTest()
        {
            Uri serverUrl = default(Uri);
            VssCredentialsType credentialType = default(VssCredentialsType);

            ExecuteMethod(
                () => { return((ITfsClientCredentialStorage)GetInstance()); },
                instance =>
            {
                serverUrl      = default(Uri);                //No Type
                credentialType = default(VssCredentialsType); //No Type
                RetrieveToken_PreCondition(instance, ref serverUrl, ref credentialType);
            },
                instance => { instance.RetrieveToken(serverUrl, credentialType); },
                instance => { RetrieveToken_PostValidate(instance, serverUrl, credentialType); });
        }
Example #12
0
        /// <summary>
        /// Retrieves the token.
        /// </summary>
        /// <param name="serverUrl">The server URL.</param>
        /// <param name="credentialsType">Type of the credentials.</param>
        /// <returns>The <see cref="IssuedToken"/></returns>
        public override IssuedToken RetrieveToken(Uri serverUrl, VssCredentialsType credentialsType)
        {
            var token = base.RetrieveToken(serverUrl, credentialsType);

            if (token != null)
            {
                bool expireToken = this.IsTokenExpired(token);
                if (expireToken)
                {
                    base.RemoveToken(serverUrl, token);
                    token = null;
                }
                else
                {
                    // if retrieving the token before it is expired,
                    // refresh the lease period.
                    this.RefreshLeaseAndStoreToken(serverUrl, token);
                    token = base.RetrieveToken(serverUrl, credentialsType);
                }
            }

            return(token);
        }
Example #13
0
 partial void RetrieveToken_PreCondition(ITfsClientCredentialStorage instance, ref Uri serverUrl, ref VssCredentialsType credentialType);
Example #14
0
 partial void RetrieveToken_PostValidate(ITfsClientCredentialStorage instance, Uri serverUrl, VssCredentialsType credentialType);
Example #15
0
 /// <summary>
 ///     Retrieves the token.
 /// </summary>
 /// <param name="serverUrl">The server URL.</param>
 /// <param name="credentialType">Type of the credential.</param>
 /// <returns>IIssuedToken.</returns>
 /// <exception cref="DynCon.OSI.Core.Helpers.ToBeImplementedException"></exception>
 IIssuedToken ITfsClientCredentialStorage.RetrieveToken(Uri serverUrl, VssCredentialsType credentialType)
 {
     throw new ToBeImplementedException();
 }