Exemple #1
0
        public async Task RefreshTokenShouldUseRefreshTokenUrl()
        {
            _discoveryResponse.OperatorUrls.RefreshTokenUrl = "http://refresh";
            _discoveryResponse.OperatorUrls.RequestTokenUrl = "http://request";
            _restClient.QueueParallelResponses(Tuple.Create <string, object>(_discoveryResponse.OperatorUrls.RefreshTokenUrl, _responses["token"]),
                                               Tuple.Create <string, object>(_discoveryResponse.OperatorUrls.RequestTokenUrl, _responses["error"]));

            var result = await _mobileConnect.RefreshTokenAsync("token", _discoveryResponse);

            Assert.AreEqual(MobileConnectResponseType.Complete, result.ResponseType);
        }
        private async void RefreshButton_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(_token.RefreshToken))
            {
                return;
            }

            var response = await _mobileConnect.RefreshTokenAsync(_token.RefreshToken, _discoveryResponse);

            await HandleResponse(response);
        }