public ApiOperationBuilder <TApiClientOptions> JwtOrKey(ApiKeyParameters apiKeyParameters = null) { var user = requestContext.User; if (user != null) { return(Jwt()); } return(Key(apiKeyParameters)); }
public ApiOperationBuilder <TApiClientOptions> Key(ApiKeyParameters apiKeyParameters = null) { if (apiKeyParameters == null) { apiKeyParameters = options.ApiKey; } if (!httpClient.DefaultRequestHeaders.Contains(apiKeyParameters.Name)) { httpClient.DefaultRequestHeaders.Add(apiKeyParameters.Name, apiKeyParameters.Value); } return(this); }
protected ApiClientOptionsBase() { Token = new JwtTokenParameters(); ApiKey = new ApiKeyParameters(); }