Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Commit 76b5df5

Browse files
Fix bug: Keycloak producing tokens for Non-OISP clients with incorrect expire date
closes #476
1 parent ea5ff31 commit 76b5df5

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

docker/keycloak/oisp-js-policies/src/main/resources/type-mapper.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,7 @@ if (expire.length > 0) {
4747
expire = parseInt(expire[0]);
4848
token.expiration(currentTimeInSeconds + expire);
4949
} else {
50-
var ArrayList = Java.type("java.util.ArrayList");
51-
var roles = new ArrayList();
52-
var client = keycloakSession.getContext().getClient();
53-
var forEach = Array.prototype.forEach;
54-
forEach.call(user.getClientRoleMappings(client).toArray(), function(roleModel) {
55-
roles.add(roleModel.getName());
56-
});
57-
if (roles.contains('user') && accessType === USER) {
50+
if (accessType === USER) {
5851
token.expiration(currentTimeInSeconds + USER_EXPIRE * 60);
5952
} else {
6053
token.expiration(currentTimeInSeconds + DEFAULT_EXPIRE * 60)

0 commit comments

Comments
 (0)