Skip to content

Commit f76af9a

Browse files
mattcreaserharsh62
andauthored
Remove support for setting query parameters for the tokens endpoint (#3669)
Co-authored-by: Harsh <6162866+harsh62@users.noreply.github.com>
1 parent 4a6b0b3 commit f76af9a

File tree

2 files changed

+2
-42
lines changed

2 files changed

+2
-42
lines changed

aws-android-sdk-mobile-client/src/main/java/com/amazonaws/mobile/client/AWSMobileClient.java

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3359,18 +3359,6 @@ public void run() {
33593359
return;
33603360
}
33613361
}
3362-
if (hostedUIOptions.getTokenQueryParameters() != null) {
3363-
try {
3364-
JSONObject tokenParams = new JSONObject();
3365-
for (Map.Entry<String, String> e : hostedUIOptions.getTokenQueryParameters().entrySet()) {
3366-
tokenParams.put(e.getKey(), e.getValue());
3367-
}
3368-
hostedUIJSON.put("TokenQueryParameters", tokenParams);
3369-
} catch (JSONException e1) {
3370-
callback.onError(new Exception("Failed to construct token query parameters", e1));
3371-
return;
3372-
}
3373-
}
33743362

33753363
mStore.set(HOSTED_UI_KEY, hostedUIJSON.toString());
33763364

@@ -3389,21 +3377,15 @@ public void run() {
33893377
throw new RuntimeException("Failed to construct authorization url for OAuth", e);
33903378
}
33913379

3392-
Uri.Builder tokensUriBuilder;
3380+
final Uri tokensUri;
33933381
final Map<String, String> tokensBody = new HashMap<String, String>();
33943382
try {
3395-
tokensUriBuilder = Uri.parse(hostedUIJSON.getString("TokenURI")).buildUpon();
3396-
if (hostedUIOptions.getTokenQueryParameters() != null) {
3397-
for (Map.Entry<String, String> e : hostedUIOptions.getTokenQueryParameters().entrySet()) {
3398-
tokensUriBuilder.appendQueryParameter(e.getKey(), e.getValue());
3399-
}
3400-
}
3383+
tokensUri = Uri.parse(hostedUIJSON.getString("TokenURI"));
34013384
tokensBody.put("client_id", hostedUIJSON.getString("AppClientId"));
34023385
tokensBody.put("redirect_uri", hostedUIJSON.getString("SignInRedirectURI"));
34033386
} catch (Exception e) {
34043387
throw new RuntimeException("Failed to construct tokens url for OAuth", e);
34053388
}
3406-
final Uri tokensUri = tokensUriBuilder.build();
34073389

34083390
mOAuth2Client.authorize(authorizeUriBuilder.build(), new Callback<AuthorizeResponse>() {
34093391
@Override
@@ -3492,18 +3474,6 @@ public void run() {
34923474
return;
34933475
}
34943476
}
3495-
if (hostedUIOptions.getTokenQueryParameters() != null) {
3496-
try {
3497-
JSONObject tokenParams = new JSONObject();
3498-
for (Map.Entry<String, String> e : hostedUIOptions.getTokenQueryParameters().entrySet()) {
3499-
tokenParams.put(e.getKey(), e.getValue());
3500-
}
3501-
hostedUIJSON.put("TokenQueryParameters", tokenParams);
3502-
} catch (JSONException e1) {
3503-
callback.onError(new Exception("Failed to construct token query parameters", e1));
3504-
return;
3505-
}
3506-
}
35073477

35083478
mStore.set(HOSTED_UI_KEY, hostedUIJSON.toString());
35093479

aws-android-sdk-mobile-client/src/main/java/com/amazonaws/mobile/client/HostedUIOptions.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ public Map<String, String> getSignOutQueryParameters() {
3838
return builder.signOutQueryParameters;
3939
}
4040

41-
public Map<String, String> getTokenQueryParameters() {
42-
return builder.tokenQueryParameters;
43-
}
44-
4541
public static Builder builder() {
4642
return new Builder();
4743
}
@@ -54,7 +50,6 @@ public static class Builder {
5450
private String federationProviderName;
5551
private Map<String, String> signInQueryParameters;
5652
private Map<String, String> signOutQueryParameters;
57-
private Map<String, String> tokenQueryParameters;
5853

5954
public Builder() { }
6055

@@ -68,11 +63,6 @@ public Builder signOutQueryParameters(final Map<String, String> signOutQueryPara
6863
return this;
6964
}
7065

71-
public Builder tokenQueryParameters(final Map<String, String> tokenQueryParameters) {
72-
this.tokenQueryParameters = tokenQueryParameters;
73-
return this;
74-
}
75-
7666
public Builder scopes(final String... scopes) {
7767
this.scopes = scopes;
7868
return this;

0 commit comments

Comments
 (0)