[Java] fix runtime exception when there are multiple auth methods (#5530)

* fix runtime exception when there are multiple auth methods

* Refactor a bit so that it does not cause conflict with relative url token branch
This commit is contained in:
Sebastien Rosset
2020-03-10 10:22:56 -07:00
committed by GitHub
parent 6034c09130
commit b1aecaded0
3 changed files with 12 additions and 0 deletions

View File

@@ -143,6 +143,10 @@ public class ApiClient {
retryingOAuth
);
initHttpClient(Collections.<Interceptor>singletonList(retryingOAuth));
// Setup authentications (key: authentication name, value: authentication).
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
authentications.put("http_basic_test", new HttpBasicAuth());
// Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications);