@@ -64,25 +169,155 @@ const UserDetails = ({data, notifyOnDataChange}) => {
{data?.displayToken ?
<>
+
+ }
+ aria-controls="panel1-content"
+ id="panel1-header"
+ >
+ Access Token
+
+
+
+
+
+
+
+ }
+ aria-controls="panel1-content"
+ id="panel1-header"
+ >
+ Id Token
+
+
+
+
+
+
+ >
+ : ''}
+
+ }
+ aria-controls="panel1-content"
+ id="panel1-header"
+ >
+ User Details
+
+
-
-
Id Token
-
{showMoreIdToken ? (!!data ? data?.id_token : '') : (!!data ? data?.id_token.substring(0, 250).concat(' ...') : '')}
-
setShowMoreIdToken(!showMoreIdToken)}>{showMoreIdToken ? "Show less" : "Show more"}
+
+
+ {cedarlingBootstrapPresent ?
+
+ }
+ aria-controls="panel1-content"
+ id="panel1-header"
+ >
+ Cedarling Authz Request Form
+
+
+
+ Principal
+ setAccessToken(!accessToken)} />} label="Access Token" />
+ setUserInfoToken(!userInfoToken)} />} label="Userinfo Token" />
+ setIdToken(!idToken)} />} label="Id Token" />
+
+ {
+ setAction(e.target.value);
+ }}
+ />
+ Resource
+
+ Context
+
+
+
- >
- : ''}
-
+
+ : ''}
+ {!!authzResult ?
+
+ }
+ aria-controls="panel1-content"
+ id="panel1-header"
+ >
+ Cedarling Authz Result
+
+
+
+
+
+ : ''}
+ {!!authzLogs ?
+
+ }
+ aria-controls="panel2-content"
+ id="panel2-header"
+ >
+ Cedarling Authz Logs
+
+
+
+
+
+ : ''}
+
-
+
)
};
diff --git a/demos/jans-tarp/src/static/chrome/manifest.json b/demos/jans-tarp/src/static/chrome/manifest.json
index 2cb920ca3c3..ce82d4a8486 100644
--- a/demos/jans-tarp/src/static/chrome/manifest.json
+++ b/demos/jans-tarp/src/static/chrome/manifest.json
@@ -24,5 +24,8 @@
"*://*/*"
],
"options_page": "options.html",
- "incognito": "split"
+ "incognito": "split",
+ "content_security_policy": {
+ "extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';"
+ }
}
\ No newline at end of file
diff --git a/demos/jans-tarp/src/static/firefox/manifest.json b/demos/jans-tarp/src/static/firefox/manifest.json
index e30988c67a1..0ace852b544 100644
--- a/demos/jans-tarp/src/static/firefox/manifest.json
+++ b/demos/jans-tarp/src/static/firefox/manifest.json
@@ -27,5 +27,8 @@
"gecko": {
"id": "jans-tarp@gluu.org"
}
+ },
+ "content_security_policy": {
+ "extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';"
}
}
\ No newline at end of file
diff --git a/docs/cedarling/cedarling-authz.md b/docs/cedarling/cedarling-authz.md
index 89f3a5c7619..70445076942 100644
--- a/docs/cedarling/cedarling-authz.md
+++ b/docs/cedarling/cedarling-authz.md
@@ -83,14 +83,14 @@ decision_result = await cedarling(input)
## Automatically Adding Entity References to the Context
-Cedarling simplifies context creation by automatically including certain entities. This means you don't need to manually pass their references when using them in your policies. The following entities are automatically added to the context, along with their naming conventions in `lower_snake_case` format:
-
-- **Workload Entity**: `workload`
-- **User Entity**: `user`
-- **Resource Entity**: `resource`
-- **Access Token Entity**: `access_token`
-- **ID Token Entity**: `id_token`
-- **Userinfo Token Entity**: `userinfo_token`
+Cedarling simplifies context creation by automatically including certain entities. This means you don't need to manually pass their references when using them in your policies. The following entities are automatically added to the context.
+
+- Workload Entity
+- User Entity
+- Resource Entity
+- Access Token Entity
+- ID Token Entity
+- Userinfo Token Entity
### Example Policy
diff --git a/docs/cedarling/cedarling-policy-store.md b/docs/cedarling/cedarling-policy-store.md
index 55bdf64de8c..504f9cf69ca 100644
--- a/docs/cedarling/cedarling-policy-store.md
+++ b/docs/cedarling/cedarling-policy-store.md
@@ -178,7 +178,11 @@ This record contains the information needed to validate tokens from this issuer:
- **description** : (*String*) A brief description of the trusted issuer, providing context for administrators.
- **openid_configuration_endpoint** : (*String*) The HTTPS URL for the OpenID Connect configuration endpoint (usually found at `/.well-known/openid-configuration`).
- **identity_source** : (*Object*, *optional*) Metadata related to the tokens issued by this issuer.
-- **`access_tokens`, `id_tokens`, `userinfo_tokens`, and `tx_tokens`**: See: [Token Metadata Schema](#token-metadata-schema).
+
+**Notes**:
+
+- The `access_tokens`, `id_tokens`, `userinfo_tokens`, and `tx_tokens` fields will follow the [Token Metadata Schema](#token-metadata-schema).
+- The `access_tokens` will contain a `trusted` and `principal_identifier` field in addition to the fields from the `Token Metadata Schema`.
### Token Metadata Schema
@@ -186,8 +190,6 @@ The Token Entity Metadata Schema defines how tokens are mapped, parsed, and tran
```json
{
- "trusted": bool,
- "principal_identifier": "str",
"user_id": "",
"role_mapping": "",
"claim_mapping": {
diff --git a/docs/cedarling/python/sidecar.md b/docs/cedarling/python/sidecar.md
index 9febea1c8a4..0ba9f5f9289 100644
--- a/docs/cedarling/python/sidecar.md
+++ b/docs/cedarling/python/sidecar.md
@@ -14,7 +14,7 @@ The sidecar is a containerized Flask project that uses the `cedarling_python` bi
- Ensure that you have installed [docker](https://docs.docker.com/engine/install/) and [docker compose](https://docs.docker.com/compose/install/).
- Clone the [Janssen](https://github.com/JanssenProject/jans) repository
- Navigate to `jans/jans-cedarling/flask-sidecar`
-- Edit the provided `secrets/bootstrap.json` file to your specifications. The configuration keys are described [here](https://github.com/JanssenProject/jans/blob/ffe9f493e4a5c6b05f2adeeb8a6eba7eb83b103e/jans-cedarling/bindings/cedarling_python/cedarling_python.pyi#L9).
+- Edit the provided `secrets/bootstrap.json` file to your specifications. The configuration keys are described [here](https://github.com/JanssenProject/jans/blob/main/jans-cedarling/bindings/cedarling_python/cedarling_python.pyi#L10).
- Run `docker compose up`
- For cloud deployments, please use the provided Dockerfile and pass your bootstrap configuration via the environment variable `CEDARLING_BOOTSTRAP_CONFIG_FILE`.
- The sidecar runs on port 5000. OpenAPI documentation is available at `http://0.0.0.0:5000/swagger-ui`
@@ -28,8 +28,13 @@ Example request to the evaluation endpoint:
```
{
"subject": {
- "type": "string",
- "id": "string"
+ "type": "JWT",
+ "id": "cedarling",
+ "properties": {
+ "access_token": "",
+ "id_token": "",
+ "userinfo_token": ""
+ }
},
"resource": {
"type": "Jans::Application",
@@ -48,9 +53,6 @@ Example request to the evaluation endpoint:
"name": "Jans::Action::\"Read\""
},
"context": {
- "access_token": "...",
- "id_token": "...",
- "userinfo_token": "...",
"device_health": [
"Healthy"
],
diff --git a/docs/script-catalog/authorization_challenge/AgamaChallenge.java b/docs/script-catalog/authorization_challenge/AgamaChallenge.java
index 89fdade3277..6c272dff776 100644
--- a/docs/script-catalog/authorization_challenge/AgamaChallenge.java
+++ b/docs/script-catalog/authorization_challenge/AgamaChallenge.java
@@ -20,6 +20,7 @@
import io.jans.agama.engine.client.MiniBrowser;
import io.jans.as.model.configuration.AppConfiguration;
import io.jans.as.model.util.Base64Util;
+import io.jans.as.server.authorize.ws.rs.AuthzRequest;
import io.jans.util.*;
import jakarta.servlet.ServletRequest;
@@ -141,12 +142,14 @@ public boolean authorize(Object scriptContext) {
if (!CdiUtil.bean(FlowUtils.class).serviceEnabled())
return makeUnexpectedError(context, null, "Agama engine is disabled");
+
+ AuthzRequest authRequest = context.getAuthzRequest();
- if (!context.getAuthzRequest().isUseAuthorizationChallengeSession())
+ if (!authRequest.isUseAuthorizationChallengeSession())
return makeMissingParamError(context, "Please set 'use_auth_session=true' in your request");
ServletRequest servletRequest = context.getHttpRequest();
- AuthorizationChallengeSession deviceSessionObject = context.getAuthzRequest().getAuthorizationChallengeSessionObject();
+ AuthorizationChallengeSession deviceSessionObject = authRequest.getAuthorizationChallengeSessionObject();
boolean noSO = deviceSessionObject == null;
scriptLogger.debug("There IS{} device session object", noSO ? " NO" : "");
@@ -313,5 +316,23 @@ public int getApiVersion() {
public Map getAuthenticationMethodClaims(Object context) {
return Map.of();
}
-
+
+ @Override
+ public void prepareAuthzRequest(Object scriptContext) {
+
+ ExternalScriptContext context = (ExternalScriptContext) scriptContext;
+ AuthzRequest authRequest = context.getAuthzRequest();
+
+ AuthorizationChallengeSession sessionObject = authRequest.getAuthorizationChallengeSessionObject();
+ if (sessionObject != null) {
+ Map sessionAttributes = sessionObject.getAttributes().getAttributes();
+
+ // set scope from session into request object
+ String scopeFromSession = sessionAttributes.get("scope");
+ if (StringUtils.isNotBlank(scopeFromSession) && StringUtils.isBlank(authRequest.getScope())) {
+ authRequest.setScope(scopeFromSession);
+ }
+ }
+ }
+
}
diff --git a/docs/script-catalog/consent_gathering/sample-script/ConsentGatheringSample.py b/docs/script-catalog/consent_gathering/sample-script/ConsentGatheringSample.py
index 40576be19b1..f0a48a0a49d 100644
--- a/docs/script-catalog/consent_gathering/sample-script/ConsentGatheringSample.py
+++ b/docs/script-catalog/consent_gathering/sample-script/ConsentGatheringSample.py
@@ -30,7 +30,7 @@ def destroy(self, configurationAttributes):
return True
def getApiVersion(self):
- return 1
+ return 11
# Main consent-gather method. Must return True (if gathering performed successfully) or False (if fail).
# All user entered values can be access via Map context.getPageAttributes()
diff --git a/jans-auth-server/client/src/test/java/io/jans/as/client/ws/rs/SelectAccountHttpTest.java b/jans-auth-server/client/src/test/java/io/jans/as/client/ws/rs/SelectAccountHttpTest.java
index 5f1788fb3d0..7e93a231e14 100644
--- a/jans-auth-server/client/src/test/java/io/jans/as/client/ws/rs/SelectAccountHttpTest.java
+++ b/jans-auth-server/client/src/test/java/io/jans/as/client/ws/rs/SelectAccountHttpTest.java
@@ -20,7 +20,6 @@
import io.jans.as.model.jwt.JwtHeaderName;
import org.apache.logging.log4j.util.Strings;
import org.json.JSONArray;
-import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -42,7 +41,7 @@ public class SelectAccountHttpTest extends BaseTest {
@BeforeTest
public void setUp() {
- driver = new HtmlUnitDriver(true);
+ startSelenium();
pageConfig = newPageConfig(driver);
}
diff --git a/jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ws/rs/AuthorizeAction.java b/jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ws/rs/AuthorizeAction.java
index a5a96ce2de4..9433e274ce3 100644
--- a/jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ws/rs/AuthorizeAction.java
+++ b/jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ws/rs/AuthorizeAction.java
@@ -86,6 +86,7 @@
@Named
public class AuthorizeAction {
+ public static final String UNKNOWN = "Unknown";
@Inject
private Logger log;
@@ -985,10 +986,28 @@ public String getClientDisplayName() {
log.trace("client {}", clientId);
if (StringUtils.isBlank(clientId)) {
- return "Unknown";
+ return UNKNOWN;
}
final Client client = clientService.getClient(clientId);
+ return getCheckedClientDisplayName(client);
+ }
+
+ public String getClientDisplayName(final Client client) {
+ log.trace("client {}", client);
+
+ if (client == null) {
+ return UNKNOWN;
+ }
+
+ return getCheckedClientDisplayName(client);
+ }
+
+ private String getCheckedClientDisplayName(final Client client) {
+ if (client == null) {
+ return UNKNOWN;
+ }
+
if (StringUtils.isNotBlank(client.getClientName())) {
return client.getClientName();
}
@@ -997,8 +1016,8 @@ public String getClientDisplayName() {
return client.getClientId();
}
- return "Unknown";
- }
+ return UNKNOWN;
+ }
public String getAuthReqId() {
return authReqId;
diff --git a/jans-auth-server/server/src/main/webapp/WEB-INF/incl/layout/authorize-extended-template.xhtml b/jans-auth-server/server/src/main/webapp/WEB-INF/incl/layout/authorize-extended-template.xhtml
index e8b03eafc30..57a4ac12f27 100644
--- a/jans-auth-server/server/src/main/webapp/WEB-INF/incl/layout/authorize-extended-template.xhtml
+++ b/jans-auth-server/server/src/main/webapp/WEB-INF/incl/layout/authorize-extended-template.xhtml
@@ -46,7 +46,7 @@
+ value="#{authorizeAction.getClientDisplayName(client)}" />
@@ -56,8 +56,8 @@
@@ -132,10 +132,6 @@