示例#1
0
        public void SignIn(string customReturnUrl = null)
        {
            var httpClient = _hostHttpClient.CreateHttpClient();
            var returnUrl  = customReturnUrl != null?_navigation.ToAbsoluteUri(customReturnUrl).ToString() : null;

            var encodedReturnUrl = Uri.EscapeDataString(returnUrl ?? new Uri(_navigation.Uri).PathAndQuery);
            var logInUrl         = new Uri(httpClient.BaseAddress, $"{LogInPath}?returnUrl={encodedReturnUrl}");
            //            var logInUrl = _navigation.ToAbsoluteUri($"{LogInPath}?returnUrl={encodedReturnUrl}");
            var sLoginUrl = logInUrl.ToString();

            _navigation.NavigateTo(logInUrl.ToString(), true);
        }
示例#2
0
 public AuthStatusService(
     ILogger <AuthStatusService> logger,
     IHostHttpClient hostHttpClient)
 {
     _logger     = logger;
     _httpClient = hostHttpClient.CreateHttpClient();
 }
示例#3
0
 public FetchAuthStatusService(IHostHttpClient hostHttpClient)
 {
     _httpClient = hostHttpClient.CreateHttpClient();
 }
示例#4
0
 public FetchWeatherForecastService(IHostHttpClient hostHttpClient)
 {
     _httpClient = hostHttpClient.CreateHttpClient();
 }
 public FetchAuthStatusService(IHostHttpClient hostHttpClient,
                               OAuth2.TokenManagement.Client.ITokenManager tokenManager)
 {
     _httpClient   = hostHttpClient.CreateHttpClient();
     _tokenManager = tokenManager;
 }