diff --git a/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/action/model/TokenRequest.java b/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/action/model/TokenRequest.java index 7e0472607c..f0125da3a8 100644 --- a/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/action/model/TokenRequest.java +++ b/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/action/model/TokenRequest.java @@ -32,34 +32,6 @@ */ public class TokenRequest extends Request { - private static final List headersToAvoid = new ArrayList<>(); - private static final List 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; @@ -133,17 +105,13 @@ public Builder scopes(List 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; }