From 886528dab8d91ef53524f73ff4a291f1cf0a479d Mon Sep 17 00:00:00 2001 From: sebastienblanc Date: Wed, 12 Apr 2017 16:36:14 +0200 Subject: [PATCH] add autodetect-bearer-only in subsystem --- .../wf8/extension/SharedAttributeDefinitons.java | 8 +++++++- .../subsystem/wf8/extension/LocalDescriptions.properties | 3 ++- .../src/main/resources/schema/wildfly-keycloak_1_1.xsd | 2 ++ .../adapter/extension/SharedAttributeDefinitons.java | 7 +++++++ .../adapter/extension/LocalDescriptions.properties | 3 ++- .../src/main/resources/schema/wildfly-keycloak_1_1.xsd | 2 ++ 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SharedAttributeDefinitons.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SharedAttributeDefinitons.java index 2221bfd866..e4ff98816a 100755 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SharedAttributeDefinitons.java +++ b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SharedAttributeDefinitons.java @@ -167,7 +167,12 @@ public class SharedAttributeDefinitons { .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) .build(); - + protected static final SimpleAttributeDefinition AUTODETECT_BEARER_ONLY = + new SimpleAttributeDefinitionBuilder("autodetect-bearer-only", ModelType.BOOLEAN, true) + .setXmlName("autodetect-bearer-only") + .setAllowExpression(true) + .setDefaultValue(new ModelNode(false)) + .build(); protected static final List ATTRIBUTES = new ArrayList(); static { @@ -193,6 +198,7 @@ public class SharedAttributeDefinitons { ATTRIBUTES.add(REGISTER_NODE_PERIOD); ATTRIBUTES.add(TOKEN_STORE); ATTRIBUTES.add(PRINCIPAL_ATTRIBUTE); + ATTRIBUTES.add(AUTODETECT_BEARER_ONLY); } /** diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/org/keycloak/subsystem/wf8/extension/LocalDescriptions.properties b/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/org/keycloak/subsystem/wf8/extension/LocalDescriptions.properties index e6a581a27c..6244b0c797 100755 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/org/keycloak/subsystem/wf8/extension/LocalDescriptions.properties +++ b/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/org/keycloak/subsystem/wf8/extension/LocalDescriptions.properties @@ -46,7 +46,7 @@ keycloak.realm.register-node-at-startup=Cluster setting keycloak.realm.register-node-period=how often to re-register node keycloak.realm.token-store=cookie or session storage for auth session data keycloak.realm.principal-attribute=token attribute to use to set Principal name - +keycloak.realm.autodetect-bearer-only=autodetect bearer-only requests keycloak.secure-deployment=A deployment secured by Keycloak keycloak.secure-deployment.add=Add a deployment to be secured by Keycloak @@ -83,6 +83,7 @@ keycloak.secure-deployment.principal-attribute=token attribute to use to set Pri keycloak.secure-deployment.turn-off-change-session-id-on-login=The session id is changed by default on a successful login. Change this to true if you want to turn this off keycloak.secure-deployment.token-minimum-time-to-live=The adapter will refresh the token if the current token is expired OR will expire in 'token-minimum-time-to-live' seconds or less keycloak.secure-deployment.min-time-between-jwks-requests=If adapter recognize token signed by unknown public key, it will try to download new public key from keycloak server. However it won't try to download if already tried it in less than 'min-time-between-jwks-requests' seconds +keycloak.secure-deployment.autodetect-bearer-only=autodetect bearer-only requests keycloak.secure-deployment.credential=Credential value diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/schema/wildfly-keycloak_1_1.xsd b/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/schema/wildfly-keycloak_1_1.xsd index 53549faa62..e9839bc069 100755 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/schema/wildfly-keycloak_1_1.xsd +++ b/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/schema/wildfly-keycloak_1_1.xsd @@ -65,6 +65,7 @@ + @@ -107,6 +108,7 @@ + diff --git a/adapters/oidc/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/extension/SharedAttributeDefinitons.java b/adapters/oidc/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/extension/SharedAttributeDefinitons.java index f9f8a6a3e2..02d14e5b81 100755 --- a/adapters/oidc/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/extension/SharedAttributeDefinitons.java +++ b/adapters/oidc/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/extension/SharedAttributeDefinitons.java @@ -166,6 +166,12 @@ public class SharedAttributeDefinitons { .setAllowExpression(true) .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) .build(); + protected static final SimpleAttributeDefinition AUTODETECT_BEARER_ONLY = + new SimpleAttributeDefinitionBuilder("autodetect-bearer-only", ModelType.BOOLEAN, true) + .setXmlName("autodetect-bearer-only") + .setAllowExpression(true) + .setDefaultValue(new ModelNode(false)) + .build(); @@ -193,6 +199,7 @@ public class SharedAttributeDefinitons { ATTRIBUTES.add(REGISTER_NODE_PERIOD); ATTRIBUTES.add(TOKEN_STORE); ATTRIBUTES.add(PRINCIPAL_ATTRIBUTE); + ATTRIBUTES.add(AUTODETECT_BEARER_ONLY); } private static boolean isSet(ModelNode attributes, SimpleAttributeDefinition def) { diff --git a/adapters/oidc/wildfly/wildfly-subsystem/src/main/resources/org/keycloak/subsystem/adapter/extension/LocalDescriptions.properties b/adapters/oidc/wildfly/wildfly-subsystem/src/main/resources/org/keycloak/subsystem/adapter/extension/LocalDescriptions.properties index e6a581a27c..c0ca52e0dc 100755 --- a/adapters/oidc/wildfly/wildfly-subsystem/src/main/resources/org/keycloak/subsystem/adapter/extension/LocalDescriptions.properties +++ b/adapters/oidc/wildfly/wildfly-subsystem/src/main/resources/org/keycloak/subsystem/adapter/extension/LocalDescriptions.properties @@ -46,7 +46,7 @@ keycloak.realm.register-node-at-startup=Cluster setting keycloak.realm.register-node-period=how often to re-register node keycloak.realm.token-store=cookie or session storage for auth session data keycloak.realm.principal-attribute=token attribute to use to set Principal name - +keycloak.realm.autodetect-bearer-only=autodetect bearer-only requests keycloak.secure-deployment=A deployment secured by Keycloak keycloak.secure-deployment.add=Add a deployment to be secured by Keycloak @@ -67,6 +67,7 @@ keycloak.secure-deployment.bearer-only=Bearer Token Auth only keycloak.secure-deployment.enable-basic-auth=Enable Basic Authentication keycloak.secure-deployment.public-client=Public client keycloak.secure-deployment.enable-cors=Enable Keycloak CORS support +keycloak.secure-deployment.autodetect-bearer-only=autodetect bearer-only requests keycloak.secure-deployment.client-keystore=n/a keycloak.secure-deployment.client-keystore-password=n/a keycloak.secure-deployment.client-key-password=n/a diff --git a/adapters/oidc/wildfly/wildfly-subsystem/src/main/resources/schema/wildfly-keycloak_1_1.xsd b/adapters/oidc/wildfly/wildfly-subsystem/src/main/resources/schema/wildfly-keycloak_1_1.xsd index 7372e82311..84399a361a 100755 --- a/adapters/oidc/wildfly/wildfly-subsystem/src/main/resources/schema/wildfly-keycloak_1_1.xsd +++ b/adapters/oidc/wildfly/wildfly-subsystem/src/main/resources/schema/wildfly-keycloak_1_1.xsd @@ -65,6 +65,7 @@ + @@ -107,6 +108,7 @@ +