Esempio n. 1
0
 public RemoteServiceHttpClientAuthenticateContext(
     HttpClient client,
     HttpRequestMessage request,
     RemoteServiceConfiguration remoteService)
 {
     Client        = client;
     Request       = request;
     RemoteService = remoteService;
 }
    public static RemoteServiceConfiguration SetUseCurrentAccessToken([NotNull] this RemoteServiceConfiguration configuration, [CanBeNull] bool?value)
    {
        if (value == null)
        {
            configuration.Remove(UseCurrentAccessTokenName);
        }
        else
        {
            configuration[UseCurrentAccessTokenName] = value.Value.ToString().ToLowerInvariant();
        }

        return(configuration);
    }
    public static bool?GetUseCurrentAccessToken([NotNull] this RemoteServiceConfiguration configuration)
    {
        Check.NotNullOrEmpty(configuration, nameof(configuration));

        var value = configuration.GetOrDefault(UseCurrentAccessTokenName);

        if (value == null)
        {
            return(null);
        }

        return(bool.Parse(value));
    }
 public static RemoteServiceConfiguration SetIdentityClient([NotNull] this RemoteServiceConfiguration configuration, [CanBeNull] string value)
 {
     configuration[IdentityClientName] = value;
     return(configuration);
 }
    public static string GetIdentityClient([NotNull] this RemoteServiceConfiguration configuration)
    {
        Check.NotNullOrEmpty(configuration, nameof(configuration));

        return(configuration.GetOrDefault(IdentityClientName));
    }