Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove filtering headers and params and rely on filtering at core based on server level configs #2549

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,6 @@
*/
public class TokenRequest extends Request {

private static final List<String> headersToAvoid = new ArrayList<>();
private static final List<String> paramsToAvoid = new ArrayList<>();

static {
headersToAvoid.add("authorization");
headersToAvoid.add("cookie");
headersToAvoid.add("set-cookie");
headersToAvoid.add("accept-encoding");
headersToAvoid.add("accept-language");
headersToAvoid.add("content-length");
headersToAvoid.add("content-type");
// parameters from authorization code grant
paramsToAvoid.add("code");
paramsToAvoid.add("redirect_uri");
paramsToAvoid.add("grant_type");
paramsToAvoid.add("scope");
// parameters from password grant
paramsToAvoid.add("username");
paramsToAvoid.add("password");
// parameters from refresh token grant
paramsToAvoid.add("refresh_token");
// parameters used for client authentication for token endpoint
paramsToAvoid.add("client_id");
paramsToAvoid.add("client_secret");
paramsToAvoid.add("client_assertion_type");
paramsToAvoid.add("client_assertion");
}

private final String clientId;
private final String grantType;
private final String redirectUri;
Expand Down Expand Up @@ -133,17 +105,13 @@ public Builder scopes(List<String> scopes) {

public Builder addAdditionalHeader(String key, String[] value) {

if (!headersToAvoid.contains(key.toLowerCase())) {
this.additionalHeaders.put(key, value);
}
this.additionalHeaders.put(key, value);
return this;
}

public Builder addAdditionalParam(String key, String[] value) {

if (!paramsToAvoid.contains(key)) {
this.additionalParams.put(key, value);
}
this.additionalParams.put(key, value);
return this;
}

Expand Down
Loading