Skip to content

Commit

Permalink
chore(jans-auth-server): renamed runIntrospectionScriptBeforeAccessTo…
Browse files Browse the repository at this point in the history
…kenAsJwtCreationAndIncludeClaims to runIntrospectionScriptBeforeJwtCreation #2387 (#2391)

docs: updated
#2387
  • Loading branch information
yuriyz authored Sep 15, 2022
1 parent c7b26e9 commit 739b939
Show file tree
Hide file tree
Showing 21 changed files with 48 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inum: %(jca_client_id)s
jansAccessTknAsJwt: false
jansAccessTknSigAlg: RS256
jansAppTyp: web
jansAttrs: {"tlsClientAuthSubjectDn": "", "runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false, "keepClientAuthorizationAfterExpiration": false, "allowSpontaneousScopes": false, "spontaneousScopes": [], "spontaneousScopeScriptDns": [], "backchannelLogoutUri": [], "backchannelLogoutSessionRequired": false, "additionalAudience": [], "postAuthnScripts": [], "consentGatheringScripts": [], "introspectionScripts": [], "rptClaimsScripts": []}
jansAttrs: {"tlsClientAuthSubjectDn": "", "runIntrospectionScriptBeforeJwtCreation": false, "keepClientAuthorizationAfterExpiration": false, "allowSpontaneousScopes": false, "spontaneousScopes": [], "spontaneousScopeScriptDns": [], "backchannelLogoutUri": [], "backchannelLogoutSessionRequired": false, "additionalAudience": [], "postAuthnScripts": [], "consentGatheringScripts": [], "introspectionScripts": [], "rptClaimsScripts": []}
jansClntSecret: %(jca_client_encoded_pw)s
jansDisabled: false
jansGrantTyp: authorization_code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inum: %(jca_client_id)s
jansAccessTknAsJwt: false
jansAccessTknSigAlg: RS256
jansAppTyp: web
jansAttrs: {"tlsClientAuthSubjectDn": "", "runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false, "keepClientAuthorizationAfterExpiration": false, "allowSpontaneousScopes": false, "spontaneousScopes": [], "spontaneousScopeScriptDns": [], "backchannelLogoutUri": [], "backchannelLogoutSessionRequired": false, "additionalAudience": [], "postAuthnScripts": [], "consentGatheringScripts": [], "introspectionScripts": [], "rptClaimsScripts": []}
jansAttrs: {"tlsClientAuthSubjectDn": "", "runIntrospectionScriptBeforeJwtCreation": false, "keepClientAuthorizationAfterExpiration": false, "allowSpontaneousScopes": false, "spontaneousScopes": [], "spontaneousScopeScriptDns": [], "backchannelLogoutUri": [], "backchannelLogoutSessionRequired": false, "additionalAudience": [], "postAuthnScripts": [], "consentGatheringScripts": [], "introspectionScripts": [], "rptClaimsScripts": []}
jansClntSecret: %(jca_client_encoded_pw)s
jansDisabled: false
jansGrantTyp: authorization_code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Getting access token for scope https://jans.io/oauth/config/openid/clients.reado
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false,
"runIntrospectionScriptBeforeJwtCreation": false,
"keepClientAuthorizationAfterExpiration": false,
"allowSpontaneousScopes": false,
"spontaneousScopes": null,
Expand Down Expand Up @@ -253,7 +253,7 @@ Getting access token for scope https://jans.io/oauth/config/openid/clients.reado
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false,
"runIntrospectionScriptBeforeJwtCreation": false,
"keepClientAuthorizationAfterExpiration": false,
"allowSpontaneousScopes": false,
"spontaneousScopes": null,
Expand Down Expand Up @@ -341,7 +341,7 @@ Getting access token for scope https://jans.io/oauth/config/openid/clients.reado
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false,
"runIntrospectionScriptBeforeJwtCreation": false,
"keepClientAuthorizationAfterExpiration": false,
"allowSpontaneousScopes": false,
"spontaneousScopes": null,
Expand Down Expand Up @@ -431,7 +431,7 @@ Getting access token for scope https://jans.io/oauth/config/openid/clients.reado
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false,
"runIntrospectionScriptBeforeJwtCreation": false,
"keepClientAuthorizationAfterExpiration": false,
"allowSpontaneousScopes": false,
"spontaneousScopes": null,
Expand Down Expand Up @@ -576,7 +576,7 @@ Calling with params limit=2
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false,
"runIntrospectionScriptBeforeJwtCreation": false,
"keepClientAuthorizationAfterExpiration": false,
"allowSpontaneousScopes": false,
"spontaneousScopes": null,
Expand Down Expand Up @@ -680,7 +680,7 @@ Calling with params limit=2
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false,
"runIntrospectionScriptBeforeJwtCreation": false,
"keepClientAuthorizationAfterExpiration": false,
"allowSpontaneousScopes": false,
"spontaneousScopes": null,
Expand Down Expand Up @@ -804,7 +804,7 @@ It contains a lot of properties. But, It's not important to fill each of these p
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": true,
"runIntrospectionScriptBeforeJwtCreation": true,
"keepClientAuthorizationAfterExpiration": true,
"allowSpontaneousScopes": false,
"spontaneousScopes": [],
Expand Down
10 changes: 5 additions & 5 deletions docs/admin/config-guide/jans-cli/im/im-openid-connect-clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Getting access token for scope https://jans.io/oauth/config/openid/clients.reado
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false,
"runIntrospectionScriptBeforeJwtCreation": false,
"keepClientAuthorizationAfterExpiration": false,
"allowSpontaneousScopes": false,
"spontaneousScopes": null,
Expand Down Expand Up @@ -247,7 +247,7 @@ Getting access token for scope https://jans.io/oauth/config/openid/clients.reado
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false,
"runIntrospectionScriptBeforeJwtCreation": false,
"keepClientAuthorizationAfterExpiration": false,
"allowSpontaneousScopes": false,
"spontaneousScopes": null,
Expand Down Expand Up @@ -346,7 +346,7 @@ Getting access token for scope https://jans.io/oauth/config/openid/clients.reado
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false,
"runIntrospectionScriptBeforeJwtCreation": false,
"keepClientAuthorizationAfterExpiration": false,
"allowSpontaneousScopes": false,
"spontaneousScopes": null,
Expand Down Expand Up @@ -605,7 +605,7 @@ Please wait while posting data ...
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false,
"runIntrospectionScriptBeforeJwtCreation": false,
"keepClientAuthorizationAfterExpiration": false,
"allowSpontaneousScopes": false,
"spontaneousScopes": null,
Expand Down Expand Up @@ -807,7 +807,7 @@ Getting access token for scope https://jans.io/oauth/config/openid/clients.reado
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false,
"runIntrospectionScriptBeforeJwtCreation": false,
"keepClientAuthorizationAfterExpiration": false,
"allowSpontaneousScopes": false,
"spontaneousScopes": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ To register a new OpenID connect client on the Janssen server, we will use `jans
"softwareStatement": null,
"attributes": {
"tlsClientAuthSubjectDn": null,
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": false,
"runIntrospectionScriptBeforeJwtCreation": false,
"keepClientAuthorizationAfterExpiration": false,
"allowSpontaneousScopes": false,
"spontaneousScopes": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def createClient(self, context):

# inorder to run introspection script
client.setAccessTokenAsJwt(True)
client.getAttributes().setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(True)
client.getAttributes().setRunIntrospectionScriptBeforeJwtCreation(True)
dnOfIntrospectionScript = "inum=CABA-2222,ou=scripts,o=jans"
client.getAttributes().getIntrospectionScripts().add(dnOfIntrospectionScript)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ The following are the ***mandatory*** functions which need to be implemented in
# 4. in order to run introspection script, assign it to run for this client
client.setAccessTokenAsJwt(True)
client.getAttributes().setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(True)
client.getAttributes().setRunIntrospectionScriptBeforeJwtCreation(True)
dnOfIntrospectionScript = "inum=CABA-2222,ou=scripts,o=jans"
client.getAttributes().getIntrospectionScripts().add(dnOfIntrospectionScript)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class RegisterRequest extends BaseRequest {
private String tlsClientAuthSubjectDn;
private Boolean allowSpontaneousScopes;
private List<String> spontaneousScopes;
private Boolean runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims;
private Boolean runIntrospectionScriptBeforeJwtCreation;
private Boolean keepClientAuthorizationAfterExpiration;
private SubjectType subjectType;
private String subjectIdentifierAttribute;
Expand Down Expand Up @@ -235,12 +235,12 @@ public void setAdditionalAudience(List<String> additionalAudience) {
this.additionalAudience = additionalAudience;
}

public Boolean getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims() {
return runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims;
public Boolean getRunIntrospectionScriptBeforeJwtCreation() {
return runIntrospectionScriptBeforeJwtCreation;
}

public void setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(Boolean runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims) {
this.runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims = runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims;
public void setRunIntrospectionScriptBeforeJwtCreation(Boolean runIntrospectionScriptBeforeJwtCreation) {
this.runIntrospectionScriptBeforeJwtCreation = runIntrospectionScriptBeforeJwtCreation;
}

public Boolean getKeepClientAuthorizationAfterExpiration() {
Expand Down Expand Up @@ -1390,7 +1390,7 @@ public static RegisterRequest fromJson(JSONObject requestObject) throws JSONExce
result.setTlsClientAuthSubjectDn(requestObject.optString(TLS_CLIENT_AUTH_SUBJECT_DN.toString()));
result.setAllowSpontaneousScopes(requestObject.optBoolean(ALLOW_SPONTANEOUS_SCOPES.toString()));
result.setSpontaneousScopes(extractListByKey(requestObject, SPONTANEOUS_SCOPES.toString()));
result.setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(requestObject.optBoolean(RUN_INTROSPECTION_SCRIPT_BEFORE_ACCESS_TOKEN_CREATION_AS_JWT_AND_INCLUDE_CLAIMS.toString()));
result.setRunIntrospectionScriptBeforeJwtCreation(requestObject.optBoolean(RUN_INTROSPECTION_SCRIPT_BEFORE_JWT_CREATION.toString()));
result.setKeepClientAuthorizationAfterExpiration(requestObject.optBoolean(KEEP_CLIENT_AUTHORIZATION_AFTER_EXPIRATION.toString()));
result.setRptAsJwt(requestObject.optBoolean(RPT_AS_JWT.toString()));
result.setAccessTokenAsJwt(requestObject.optBoolean(ACCESS_TOKEN_AS_JWT.toString()));
Expand Down Expand Up @@ -1653,8 +1653,8 @@ public void getParameters(BiFunction<String, Object, Void> function) {
if (spontaneousScopes != null && !spontaneousScopes.isEmpty()) {
function.apply(SPONTANEOUS_SCOPES.toString(), implode(spontaneousScopes, " "));
}
if (runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims != null) {
function.apply(RUN_INTROSPECTION_SCRIPT_BEFORE_ACCESS_TOKEN_CREATION_AS_JWT_AND_INCLUDE_CLAIMS.toString(), runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims.toString());
if (runIntrospectionScriptBeforeJwtCreation != null) {
function.apply(RUN_INTROSPECTION_SCRIPT_BEFORE_JWT_CREATION.toString(), runIntrospectionScriptBeforeJwtCreation.toString());
}
if (keepClientAuthorizationAfterExpiration != null) {
function.apply(KEEP_CLIENT_AUTHORIZATION_AFTER_EXPIRATION.toString(), keepClientAuthorizationAfterExpiration.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public enum RegisterRequestParam {
/**
* boolean property which indicates whether to run introspection script and then include claims from result into access_token as JWT
*/
RUN_INTROSPECTION_SCRIPT_BEFORE_ACCESS_TOKEN_CREATION_AS_JWT_AND_INCLUDE_CLAIMS("run_introspection_script_before_access_token_as_jwt_creation_and_include_claims"),
RUN_INTROSPECTION_SCRIPT_BEFORE_JWT_CREATION("run_introspection_script_before_jwt_creation"),

/**
* boolean property which indicates whether to keep client authorization after expiration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public class ClientAttributes implements Serializable {
@JsonProperty("tlsClientAuthSubjectDn")
private String tlsClientAuthSubjectDn;

@JsonProperty("runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims")
private Boolean runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims = false;
@JsonProperty("runIntrospectionScriptBeforeJwtCreation")
private Boolean runIntrospectionScriptBeforeJwtCreation = false;

@JsonProperty("keepClientAuthorizationAfterExpiration")
private Boolean keepClientAuthorizationAfterExpiration = false;
Expand Down Expand Up @@ -218,15 +218,15 @@ public void setUpdateTokenScriptDns(List<String> updateTokenScriptDns) {
this.updateTokenScriptDns = updateTokenScriptDns;
}

public Boolean getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims() {
if (runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims == null) {
runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims = false;
public Boolean getRunIntrospectionScriptBeforeJwtCreation() {
if (runIntrospectionScriptBeforeJwtCreation == null) {
runIntrospectionScriptBeforeJwtCreation = false;
}
return runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims;
return runIntrospectionScriptBeforeJwtCreation;
}

public void setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(Boolean runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims) {
this.runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims = runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims;
public void setRunIntrospectionScriptBeforeJwtCreation(Boolean runIntrospectionScriptBeforeJwtCreation) {
this.runIntrospectionScriptBeforeJwtCreation = runIntrospectionScriptBeforeJwtCreation;
}

public Boolean getKeepClientAuthorizationAfterExpiration() {
Expand Down Expand Up @@ -337,7 +337,7 @@ public void setDefaultPromptLogin(Boolean defaultPromptLogin) {
public String toString() {
return "ClientAttributes{" +
"tlsClientAuthSubjectDn='" + tlsClientAuthSubjectDn + '\'' +
", runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims=" + runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims +
", runIntrospectionScriptBeforeJwtCreation=" + runIntrospectionScriptBeforeJwtCreation +
", keepClientAuthorizationAfterExpiration=" + keepClientAuthorizationAfterExpiration +
", allowSpontaneousScopes=" + allowSpontaneousScopes +
", spontaneousScopes=" + spontaneousScopes +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public String createAccessTokenAsJwt(AccessToken accessToken, ExecutionContext c

Audience.setAudience(jwt.getClaims(), getClient());

if (isTrue(client.getAttributes().getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims())) {
if (isTrue(client.getAttributes().getRunIntrospectionScriptBeforeJwtCreation())) {
runIntrospectionScriptAndInjectValuesIntoJwt(jwt, context);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public JSONObject getJSONObject(Client client) throws JSONException, StringEncry
Util.addToJSONObjectIfNotNull(responseJsonObject, TLS_CLIENT_AUTH_SUBJECT_DN.toString(), client.getAttributes().getTlsClientAuthSubjectDn());
Util.addToJSONObjectIfNotNull(responseJsonObject, ALLOW_SPONTANEOUS_SCOPES.toString(), client.getAttributes().getAllowSpontaneousScopes());
Util.addToJSONObjectIfNotNull(responseJsonObject, SPONTANEOUS_SCOPES.toString(), client.getAttributes().getSpontaneousScopes());
Util.addToJSONObjectIfNotNull(responseJsonObject, RUN_INTROSPECTION_SCRIPT_BEFORE_ACCESS_TOKEN_CREATION_AS_JWT_AND_INCLUDE_CLAIMS.toString(), client.getAttributes().getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims());
Util.addToJSONObjectIfNotNull(responseJsonObject, RUN_INTROSPECTION_SCRIPT_BEFORE_JWT_CREATION.toString(), client.getAttributes().getRunIntrospectionScriptBeforeJwtCreation());
Util.addToJSONObjectIfNotNull(responseJsonObject, KEEP_CLIENT_AUTHORIZATION_AFTER_EXPIRATION.toString(), client.getAttributes().getKeepClientAuthorizationAfterExpiration());
Util.addToJSONObjectIfNotNull(responseJsonObject, ACCESS_TOKEN_AS_JWT.toString(), client.isAccessTokenAsJwt());
Util.addToJSONObjectIfNotNull(responseJsonObject, ACCESS_TOKEN_SIGNING_ALG.toString(), client.getAccessTokenSigningAlg());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ public void updateClientFromRequestObject(Client client, RegisterRequest request
if (requestObject.getSpontaneousScopes() != null) {
client.getAttributes().setSpontaneousScopes(requestObject.getSpontaneousScopes());
}
if (requestObject.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims() != null) {
client.getAttributes().setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(requestObject.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims());
if (requestObject.getRunIntrospectionScriptBeforeJwtCreation() != null) {
client.getAttributes().setRunIntrospectionScriptBeforeJwtCreation(requestObject.getRunIntrospectionScriptBeforeJwtCreation());
}
if (requestObject.getKeepClientAuthorizationAfterExpiration() != null) {
client.getAttributes().setKeepClientAuthorizationAfterExpiration(requestObject.getKeepClientAuthorizationAfterExpiration());
Expand Down
2 changes: 1 addition & 1 deletion jans-config-api/docs/jans-config-api-swagger-auto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3588,7 +3588,7 @@ components:
properties:
tlsClientAuthSubjectDn:
type: string
runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims:
runIntrospectionScriptBeforeJwtCreation:
type: boolean
keepClientAuthorizationAfterExpiration:
type: boolean
Expand Down
2 changes: 1 addition & 1 deletion jans-config-api/docs/jans-config-api-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5657,7 +5657,7 @@ components:
tlsClientAuthSubjectDn:
description: String representation of the expected subject distinguished name of the certificate, which the OAuth client will use in mutual TLS authentication.
type: string
runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims:
runIntrospectionScriptBeforeJwtCreation:
description: boolean property which indicates whether to run introspection script and then include claims from result into access_token as JWT.
type: boolean
keepClientAuthorizationAfterExpiration:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"accessTokenSigningAlg": "RS256",
"attributes": {
"tlsClientAuthSubjectDn":"",
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims":false,
"runIntrospectionScriptBeforeJwtCreation":false,
"keepClientAuthorizationAfterExpiration":false,
"allowSpontaneousScopes":false,
"spontaneousScopes":[],"spontaneousScopeScriptDns":[],
Expand Down
Loading

0 comments on commit 739b939

Please sign in to comment.