forked from loafle/openapi-generator-original
[Java][okhttp-gson] Fix bug when performing OAuth token retry (#1576)
* Fix access token retry bug * Update petstore samples * Remove newline * Import Pair and List in RetryingOAuth template * Update petstore samples * Update petstore samples
This commit is contained in:
committed by
William Cheng
parent
8ee1553654
commit
0a33ad465f
@@ -1 +1 @@
|
||||
3.3.3
|
||||
3.3.4-SNAPSHOT
|
||||
@@ -139,7 +139,7 @@ public class ApiClient {
|
||||
/**
|
||||
* Get base path
|
||||
*
|
||||
* @return Baes path
|
||||
* @return Base path
|
||||
*/
|
||||
public String getBasePath() {
|
||||
return basePath;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import com.squareup.okhttp.Interceptor;
|
||||
import com.squareup.okhttp.OkHttpClient;
|
||||
import com.squareup.okhttp.Request;
|
||||
@@ -17,6 +19,7 @@ import org.apache.oltu.oauth2.common.message.types.GrantType;
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
private OAuthClient oAuthClient;
|
||||
@@ -162,4 +165,10 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) {
|
||||
this.tokenRequestBuilder = tokenRequestBuilder;
|
||||
}
|
||||
|
||||
// Applying authorization to parameters is performed in the retryingIntercept method
|
||||
@Override
|
||||
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
|
||||
// No implementation necessary
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user