Skip to content

Commit

Permalink
Add the pvt ket jwt config under ClientAuthenticationConfiguration.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpmadhavig committed Jun 28, 2024
1 parent 36414b3 commit 93c9ab1
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class ClientAuthenticationConfiguration {

private String tokenEndpointAuthMethod;
private String tokenEndpointAuthSigningAlg;
private Boolean tokenEndpointAllowReusePvtKeyJwt;
private String tlsClientAuthSubjectDn;

/**
Expand Down Expand Up @@ -66,6 +67,30 @@ public void setTokenEndpointAuthSigningAlg(String tokenEndpointAuthSigningAlg) {
this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlg;
}

/**
* Allow reuse of the private key for JWT generation at the token endpoint.
*
* @param tokenEndpointAllowReusePvtKeyJwt Allow reuse of the private key for JWT generation at the token endpoint.
* @return ClientAuthenticationConfiguration object.
**/
public ClientAuthenticationConfiguration tokenEndpointAllowReusePvtKeyJwt(
Boolean tokenEndpointAllowReusePvtKeyJwt) {

this.tokenEndpointAllowReusePvtKeyJwt = tokenEndpointAllowReusePvtKeyJwt;
return this;
}

@ApiModelProperty(example = "false", value = "")
@JsonProperty("tokenEndpointAllowReusePvtKeyJwt")
@Valid
public Boolean isTokenEndpointAllowReusePvtKeyJwt() {
return tokenEndpointAllowReusePvtKeyJwt;
}

public void setTokenEndpointAllowReusePvtKeyJwt(Boolean tokenEndpointAllowReusePvtKeyJwt) {
this.tokenEndpointAllowReusePvtKeyJwt = tokenEndpointAllowReusePvtKeyJwt;
}

/**
**/
public ClientAuthenticationConfiguration tlsClientAuthSubjectDn(String tlsClientAuthSubjectDn) {
Expand Down Expand Up @@ -94,14 +119,20 @@ public boolean equals(java.lang.Object o) {
return false;
}
ClientAuthenticationConfiguration clientAuthenticationConfiguration = (ClientAuthenticationConfiguration) o;
return Objects.equals(this.tokenEndpointAuthMethod, clientAuthenticationConfiguration.tokenEndpointAuthMethod) &&
Objects.equals(this.tokenEndpointAuthSigningAlg, clientAuthenticationConfiguration.tokenEndpointAuthSigningAlg) &&
Objects.equals(this.tlsClientAuthSubjectDn, clientAuthenticationConfiguration.tlsClientAuthSubjectDn);
return Objects.equals(this.tokenEndpointAuthMethod,
clientAuthenticationConfiguration.tokenEndpointAuthMethod) &&
Objects.equals(this.tokenEndpointAuthSigningAlg,
clientAuthenticationConfiguration.tokenEndpointAuthSigningAlg) &&
Objects.equals(this.tlsClientAuthSubjectDn, clientAuthenticationConfiguration.tlsClientAuthSubjectDn) &&
Objects.equals(this.tokenEndpointAllowReusePvtKeyJwt,
clientAuthenticationConfiguration.tokenEndpointAllowReusePvtKeyJwt);
}

@Override
public int hashCode() {
return Objects.hash(tokenEndpointAuthMethod, tokenEndpointAuthSigningAlg, tlsClientAuthSubjectDn);

return Objects.hash(tokenEndpointAuthMethod, tokenEndpointAuthSigningAlg, tokenEndpointAllowReusePvtKeyJwt,
tlsClientAuthSubjectDn);
}

@Override
Expand All @@ -112,6 +143,8 @@ public String toString() {

sb.append(" tokenEndpointAuthMethod: ").append(toIndentedString(tokenEndpointAuthMethod)).append("\n");
sb.append(" tokenEndpointAuthSigningAlg: ").append(toIndentedString(tokenEndpointAuthSigningAlg)).append("\n");
sb.append(" tokenEndpointAllowReusePvtKeyJwt: ").append(toIndentedString(tokenEndpointAllowReusePvtKeyJwt))
.append("\n");
sb.append(" tlsClientAuthSubjectDn: ").append(toIndentedString(tlsClientAuthSubjectDn)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ private void updateClientAuthenticationConfigurations(OAuthConsumerAppDTO appDTO
if (clientAuthentication != null) {
appDTO.setTokenEndpointAuthMethod(clientAuthentication.getTokenEndpointAuthMethod());
appDTO.setTokenEndpointAuthSignatureAlgorithm(clientAuthentication.getTokenEndpointAuthSigningAlg());
appDTO.setTokenEndpointAllowReusePvtKeyJwt(clientAuthentication.isTokenEndpointAllowReusePvtKeyJwt());
appDTO.setTlsClientAuthSubjectDN(clientAuthentication.getTlsClientAuthSubjectDn());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ private ClientAuthenticationConfiguration buildClientAuthenticationConfiguration
return new ClientAuthenticationConfiguration()
.tokenEndpointAuthMethod(appDTO.getTokenEndpointAuthMethod())
.tokenEndpointAuthSigningAlg(appDTO.getTokenEndpointAuthSignatureAlgorithm())
.tokenEndpointAllowReusePvtKeyJwt(appDTO.isTokenEndpointAllowReusePvtKeyJwt())
.tlsClientAuthSubjectDn(appDTO.getTlsClientAuthSubjectDN());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3689,6 +3689,9 @@ components:
tokenEndpointAuthMethod:
type: string
example: 'client_secret_basic'
tokenEndpointAllowReusePvtKeyJwt:
type: boolean
example: false
tokenEndpointAuthSigningAlg:
type: string
example: 'PS256'
Expand Down Expand Up @@ -3955,6 +3958,9 @@ components:
$ref: '#/components/schemas/MetadataProperty'
tokenEndpointAuthMethod:
$ref: '#/components/schemas/ClientAuthenticationMethodMetadata'
tokenEndpointAllowReusePvtKeyJwt:
type: boolean
default: false
tokenEndpointSignatureAlgorithm:
$ref: '#/components/schemas/MetadataProperty'
idTokenSignatureAlgorithm:
Expand Down

0 comments on commit 93c9ab1

Please sign in to comment.