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

feat(jans-auth-server): introduced additional_token_endpoint_auth_method client's property #3473 #4033

Merged
merged 7 commits into from
Mar 7, 2023
Prev Previous commit
Next Next commit
feat(jans-auth-server): added additional_token_endpoint_auth_method t…
…o registration request #3473
  • Loading branch information
yuriyz committed Mar 3, 2023
commit 048189b4ede62ca0f9e67ce76ff6bc777815e3d1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import java.util.*;
import java.util.function.BiFunction;
import java.util.stream.Collectors;

import static io.jans.as.client.util.ClientUtil.*;
import static io.jans.as.model.register.RegisterRequestParam.*;
Expand Down Expand Up @@ -108,6 +109,7 @@ public class RegisterRequest extends BaseRequest {
private KeyEncryptionAlgorithm requestObjectEncryptionAlg;
private BlockEncryptionAlgorithm requestObjectEncryptionEnc;
private AuthenticationMethod tokenEndpointAuthMethod;
private List<AuthenticationMethod> additionalTokenEndpointAuthMethods;
private SignatureAlgorithm tokenEndpointAuthSigningAlg;
private Integer defaultMaxAge;
private List<String> defaultAcrValues;
Expand Down Expand Up @@ -1022,6 +1024,14 @@ public void setTokenEndpointAuthMethod(AuthenticationMethod tokenEndpointAuthMet
this.tokenEndpointAuthMethod = tokenEndpointAuthMethod;
}

public List<AuthenticationMethod> getAdditionalTokenEndpointAuthMethods() {
return additionalTokenEndpointAuthMethods;
}

public void setAdditionalTokenEndpointAuthMethods(List<AuthenticationMethod> additionalTokenEndpointAuthMethods) {
this.additionalTokenEndpointAuthMethods = additionalTokenEndpointAuthMethods;
}

/**
* Returns the Requested Client Authentication method for the Token Endpoint.
*
Expand Down Expand Up @@ -1618,6 +1628,7 @@ public static RegisterRequest fromJson(JSONObject requestObject) throws JSONExce
result.setRequestObjectEncryptionAlg(KeyEncryptionAlgorithm.fromName(requestObject.optString(REQUEST_OBJECT_ENCRYPTION_ALG.toString())));
result.setRequestObjectEncryptionEnc(BlockEncryptionAlgorithm.fromName(requestObject.optString(REQUEST_OBJECT_ENCRYPTION_ENC.toString())));
result.setTokenEndpointAuthMethod(AuthenticationMethod.fromString(requestObject.optString(TOKEN_ENDPOINT_AUTH_METHOD.toString())));
result.setAdditionalTokenEndpointAuthMethods(AuthenticationMethod.fromList(extractListByKey(requestObject, ADDITIONAL_TOKEN_ENDPOINT_AUTH_METHODS.toString())));
result.setTokenEndpointAuthSigningAlg(SignatureAlgorithm.fromString(requestObject.optString(TOKEN_ENDPOINT_AUTH_SIGNING_ALG.toString())));
result.setRedirectUris(extractListByKey(requestObject, REDIRECT_URIS.toString()));
result.setScope(extractListByKey(requestObject, SCOPE.toString()));
Expand Down Expand Up @@ -1789,6 +1800,9 @@ public void getParameters(BiFunction<String, Object, Void> function) {
if (tokenEndpointAuthMethod != null) {
function.apply(TOKEN_ENDPOINT_AUTH_METHOD.toString(), tokenEndpointAuthMethod.toString());
}
if (additionalTokenEndpointAuthMethods != null) {
function.apply(ADDITIONAL_TOKEN_ENDPOINT_AUTH_METHODS.toString(), toJSONArray(additionalTokenEndpointAuthMethods.stream().map(AuthenticationMethod::toString).collect(Collectors.toList())));
}
if (tokenEndpointAuthSigningAlg != null) {
function.apply(TOKEN_ENDPOINT_AUTH_SIGNING_ALG.toString(), tokenEndpointAuthSigningAlg.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ public enum RegisterRequestParam {
*/
TOKEN_ENDPOINT_AUTH_METHOD("token_endpoint_auth_method"),

/**
* Requested authentication methods for the Token Endpoint.
*/
ADDITIONAL_TOKEN_ENDPOINT_AUTH_METHODS("additional_token_endpoint_auth_methods"),

/**
* JWS alg algorithm (JWA) that MUST be used for signing the JWT used to authenticate the Client at the
* Token Endpoint for the private_key_jwt and client_secret_jwt authentication methods.
Expand Down