Exemple #1
0
        protected AcquireTokenHandlerBase(RequestData requestData)
        {
            this.Authenticator     = requestData.Authenticator;
            this.CallState         = CreateCallState(this.Authenticator.CorrelationId);
            brokerHelper.CallState = this.CallState;

            CallState.Logger.Information(null, string.Format(CultureInfo.CurrentCulture,
                                                             "ADAL {0} with assembly version '{1}', file version '{2}' and informational version '{3}' is running...",
                                                             platformInformation.GetProductName(), AdalIdHelper.GetAdalVersion(),
                                                             AdalIdHelper.GetAssemblyFileVersion(), AdalIdHelper.GetAssemblyInformationalVersion()));

            CallState.Logger.Information(this.CallState,
                                         string.Format(CultureInfo.CurrentCulture,
                                                       "=== Token Acquisition started:\n\tAuthority: {0}\n\tResource: {1}\n\tClientId: {2}\n\tCacheType: {3}\n\tAuthentication Target: {4}\n\t",
                                                       requestData.Authenticator.Authority, requestData.Resource, requestData.ClientKey.ClientId,
                                                       (tokenCache != null)
                        ? tokenCache.GetType().FullName +
                                                       string.Format(CultureInfo.CurrentCulture, " ({0} items)", tokenCache.Count)
                        : "null",
                                                       requestData.SubjectType));

            this.tokenCache = requestData.TokenCache;

            if (string.IsNullOrWhiteSpace(requestData.Resource))
            {
                throw new ArgumentNullException("resource");
            }

            this.Resource         = (requestData.Resource != NullResource) ? requestData.Resource : null;
            this.ClientKey        = requestData.ClientKey;
            this.TokenSubjectType = requestData.SubjectType;

            this.LoadFromCache = (tokenCache != null);
            this.StoreToCache  = (tokenCache != null);
            this.SupportADFS   = false;

            this.brokerParameters              = new Dictionary <string, string>();
            brokerParameters["authority"]      = requestData.Authenticator.Authority;
            brokerParameters["resource"]       = requestData.Resource;
            brokerParameters["client_id"]      = requestData.ClientKey.ClientId;
            brokerParameters["correlation_id"] = this.CallState.CorrelationId.ToString();
            brokerParameters["client_version"] = AdalIdHelper.GetAdalVersion();
            this.ResultEx = null;

            CacheQueryData.ExtendedLifeTimeEnabled = requestData.ExtendedLifeTimeEnabled;
        }
 static AuthenticationContext()
 {
     PlatformPlugin.Logger.Information(null, string.Format("ADAL {0} with assembly version '{1}', file version '{2}' and informational version '{3}' is running...",
                                                           PlatformPlugin.PlatformInformation.GetProductName(), AdalIdHelper.GetAdalVersion(), AdalIdHelper.GetAssemblyFileVersion(), AdalIdHelper.GetAssemblyInformationalVersion()));
 }