internal static void SetBrokerResult(Intent data, int resultCode)
        {
            if (resultCode != BrokerResponseCode.ResponseReceived)
            {
                resultEx = new AuthenticationResultEx
                {
                    Exception =
                        new AdalException(data.GetStringExtra(BrokerConstants.ResponseErrorCode),
                                          data.GetStringExtra(BrokerConstants.ResponseErrorMessage))
                };
            }
            else
            {
                var tokenResponse = new TokenResponse
                {
                    // Authority = data.GetStringExtra(BrokerConstants.AccountAuthority),
                    AccessToken   = data.GetStringExtra(BrokerConstants.AccountAccessToken),
                    IdTokenString = data.GetStringExtra(BrokerConstants.AccountIdToken),
                    TokenType     = "Bearer",
                    ExpiresOn     = data.GetLongExtra(BrokerConstants.AccountExpireDate, 0)
                };

                resultEx = tokenResponse.GetResult(BrokerProxy.ConvertFromTimeT(tokenResponse.ExpiresOn),
                                                   BrokerProxy.ConvertFromTimeT(tokenResponse.ExpiresOn));
            }

            readyForResponse.Release();
        }
        internal static void SetBrokerResult(Intent data, int resultCode)
        {
            if (resultCode != BrokerResponseCode.ResponseReceived)
            {
                resultEx = new AuthenticationResultEx
                {
                    Exception =
                        new AdalException(data.GetStringExtra(BrokerConstants.ResponseErrorCode),
                                          data.GetStringExtra(BrokerConstants.ResponseErrorMessage))
                };
            }
            else
            {
                string         accessToken = data.GetStringExtra(BrokerConstants.AccountAccessToken);
                DateTimeOffset expiresOn   = BrokerProxy.ConvertFromTimeT(data.GetLongExtra(BrokerConstants.AccountExpireDate, 0));
                UserInfo       userInfo    = BrokerProxy.GetUserInfoFromBrokerResult(data.Extras);
                resultEx = new AuthenticationResultEx
                {
                    Result = new AuthenticationResult("Bearer", accessToken, expiresOn)
                    {
                        UserInfo = userInfo
                    }
                };
            }

            readyForResponse.Release();
        }