Compare commits

..
696 Commits
Author SHA1 Message Date
Stian Thorgersen de078d4497 Set version to 2.5.7.Final 2017-05-29 08:55:52 +02:00
Pavel Drozd 0921759df9 Merge pull request #4181 from mhajas/KEYCLOAK-4959_2.5.x
KEYCLOAK-4959 Use desired version of adapter
2017-05-25 14:38:36 +02:00
Pavel Drozd 0ce86c6e74 Merge branch '2.5.x' into KEYCLOAK-4959_2.5.x 2017-05-25 13:16:22 +02:00
mhajas 96e3192cd8 KEYCLOAK-4959 Use desired version of adapter 2017-05-25 12:08:15 +02:00
Stian Thorgersen 3f8c0f02b0 Merge pull request #4161 from mhajas/KEYCLOAK-4733
KEYCLOAK-4733 Replace character 160 with character 32
2017-05-24 07:55:01 +02:00
Stian Thorgersen b3d9e7e5d9 Merge branch '2.5.x' into KEYCLOAK-4733 2017-05-24 06:46:26 +02:00
Stian Thorgersen 981c63e70d Merge pull request #4168 from vramik/KEYCLOAK-4926-2.5.x
KEYCLOAK-4926 exclude WelcomePageTest from migration scenario
2017-05-23 14:58:22 +02:00
Stian Thorgersen 395cd72b55 Merge branch '2.5.x' into KEYCLOAK-4733 2017-05-23 13:39:34 +02:00
Pavel Drozd 3429f9da89 Merge branch '2.5.x' into KEYCLOAK-4926-2.5.x 2017-05-23 13:34:55 +02:00
Pavel Drozd 4cc5cd35e3 Merge pull request #4162 from mhajas/KEYCLOAK-4938
KEYCLOAK-4938 Ignore testVersion test
2017-05-23 13:34:13 +02:00
Pavel Drozd 16f466f462 Merge branch '2.5.x' into KEYCLOAK-4938 2017-05-23 11:17:16 +02:00
Pavel Drozd 11817b1440 Merge pull request #4160 from mhajas/KEYCLOAK-3961
KEYCLOAK-3961 Fix wrong conflict merge
2017-05-23 11:16:41 +02:00
Pavel Drozd 8cd55824ae Merge branch '2.5.x' into KEYCLOAK-3961 2017-05-23 07:44:38 +02:00
vramik c3cf210747 KEYCLOAK-4926 exclude WelcomePageTest from migration scenario 2017-05-22 10:50:06 +02:00
Pavel Drozd 08cb3700e9 Merge pull request #4155 from pdrozd/2.5.x-KEYCLOAK-4554
KEYCLOAK-4554 Fix WelcomePage test
2017-05-20 00:08:19 +02:00
Pavel Drozd 6241683322 Merge branch '2.5.x' into 2.5.x-KEYCLOAK-4554 2017-05-19 23:16:10 +02:00
Pavel Drozd 676fb11efb Merge pull request #4154 from pdrozd/2.5.x-KEYCLOAK-3566
UserStorageTest migrated to Arquillian testsuite
2017-05-19 23:14:50 +02:00
Pavel Drozd 5b3f645e8e Merge branch '2.5.x' into 2.5.x-KEYCLOAK-3566 2017-05-19 21:33:46 +02:00
Pavel Drozd dc12fb4607 Merge pull request #4153 from pdrozd/2.5.x-KEYCLOAK-4930
KEYCLOAK-4930 - Updated install-keycloak script for overlay installat…
2017-05-19 21:33:27 +02:00
Pavel Drozd c94302e552 Merge branch '2.5.x' into 2.5.x-KEYCLOAK-4930 2017-05-19 20:27:42 +02:00
Pavel Drozd 57160edfbb Merge pull request #4152 from pdrozd/2.5.x
KEYCLOAK-4931 - install patch available from http
2017-05-19 20:27:24 +02:00
Pavel Drozd 96174383cf Merge branch '2.5.x' into 2.5.x 2017-05-19 13:33:37 +02:00
Pavel Drozd 60cdf7c769 Merge pull request #4145 from vramik/KEYCLOAK-4925
KEYCLOAK-4925 fix LegacyImportTest
2017-05-19 13:31:52 +02:00
mhajas 223910d6ef KEYCLOAK-4938 Ignore testVersion test 2017-05-19 13:23:41 +02:00
Pavel Drozd 336506d8de Merge branch '2.5.x' into 2.5.x 2017-05-19 12:41:21 +02:00
Pavel Drozd 6cb8abdbb9 Merge branch '2.5.x' into KEYCLOAK-4925 2017-05-19 12:40:35 +02:00
mhajas 4b96ed6a29 KEYCLOAK-4733 Replace character 160 with character 32 2017-05-19 12:12:16 +02:00
mhajas d64fb69fac KEYCLOAK-3961 Fix wrong conflict merge 2017-05-19 12:08:19 +02:00
Stian Thorgersen 1e15119f4e Merge pull request #4143 from stianst/2.5.x
KEYCLOAK-4921
2017-05-19 10:21:16 +02:00
Tomas Kyjovsky 370ac7dc76 UserStorageTest migrated to Arquillian testsuite 2017-05-19 08:41:55 +02:00
Vaclav Muzikar 1ade274618 KEYCLOAK-4554 Fix WelcomePage test 2017-05-19 00:13:02 +02:00
Pavel Drozd 8443ffebc6 KEYCLOAK-4930 - Updated install-keycloak script for overlay installation - added ha installation. 2017-05-18 23:57:18 +02:00
Pavel Drozd 55f7656198 KEYCLOAK-4931 - install patch available from http 2017-05-18 23:53:37 +02:00
vramik 95777c0574 fix LegacyImportTest 2017-05-18 12:45:10 +02:00
Stian Thorgersen d73285134c KEYCLOAK-4921
add-user-keycloak broken
2017-05-18 09:34:18 +02:00
Stian Thorgersen 2ea0f50b0b Merge pull request #4135 from stianst/2.5.x
2.5.x
2017-05-12 19:50:17 +02:00
Stian Thorgersen 05a2ecd44b Set version to 2.5.7.Final-SNAPSHOT 2017-05-12 11:07:10 +02:00
Stian Thorgersen 9f6e134b7d Set version to 2.5.6.Final 2017-05-12 11:06:17 +02:00
Stian Thorgersen 162f17a692 Merge pull request #4134 from stianst/2.5.x
KEYCLOAK-4521: consider offline sessions if no active user session wa…
2017-05-12 11:03:10 +02:00
Marc Heide e746886950 KEYCLOAK-4521: consider offline sessions if no active user session was found for user info endpoint 2017-05-12 10:22:20 +02:00
Stian Thorgersen fcc4029d23 Merge pull request #4129 from stianst/2.5.x
KEYCLOAK-4523 PBKDF2WithHmacSHA256 and PBKDF2WithHmacSHA512 providers
2017-05-12 10:05:30 +02:00
Stian Thorgersen c32cb55655 Merge pull request #4131 from mposolda/2.5.x
KEYCLOAK-4829 Access token from offline token falsely reported as ina…
2017-05-12 10:03:28 +02:00
mposolda ce1d3c854c KEYCLOAK-4829 Access token from offline token falsely reported as inactive by token introspection 2017-05-11 22:04:02 +02:00
Stian Thorgersen ce62988a46 KEYCLOAK-3729 Ability to run tests within Keycloak server 2017-05-11 15:53:37 +02:00
Stian Thorgersen 2568297903 KEYCLOAK-4523 PBKDF2WithHmacSHA256 and PBKDF2WithHmacSHA512 providers 2017-05-11 15:53:37 +02:00
Stian Thorgersen 0976838fef Merge pull request #4115 from hmlnarik/KEYCLOAK-2122-2.5.x
KEYCLOAK-2122 Configuration of AssertionConsumerServiceUrl in SAML ad…
2017-05-11 11:38:59 +02:00
Hynek Mlnarik 784efb92d5 KEYCLOAK-2122 Configuration of AssertionConsumerServiceUrl in SAML adapter
(cherry picked from commit d7615d6a68)

Conflicts:
	testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSAMLServletsAdapterTest.java
2017-05-05 14:47:38 +02:00
Stian Thorgersen c2bd713069 Merge pull request #4106 from patriot1burke/2.5.x
RHSSO-962
2017-05-05 13:10:40 +02:00
Stian Thorgersen 9cd6fdc7f5 Merge pull request #4100 from hmlnarik/KEYCLOAK-4288-2.5.x
KEYCLOAK-4288 SAML logouts are not invalidating the sessions for all the logged in applications
2017-05-03 09:15:57 +02:00
Stian Thorgersen 484d5fa5e0 Merge pull request #4101 from hmlnarik/KEYCLOAK-4489-2.5.x
KEYCLOAK-4489 Use event reader from AbstractParser, which handles newlines and whitespace
2017-05-02 09:39:04 +02:00
Bill Burke e4835fd84d fix 2017-04-29 17:57:58 -04:00
Bill Burke a1c3195b83 RHSSO-962 2017-04-29 10:47:47 -04:00
Stian Thorgersen 3b2eec63dc Merge pull request #4099 from stianst/2.5.x
KEYCLOAK-4717 for 2.5.x
2017-04-28 13:29:38 +02:00
mhajas d38d158fc4 KEYCLOAK-4288 Run tests on EAP7 2017-04-28 12:37:52 +02:00
Hynek Mlnarik 833eb87954 KEYCLOAK-4288 Tests for EAP6 and Wildfly 2017-04-28 12:37:17 +02:00
Hynek Mlnarik 2fb54a59c3 KEYCLOAK-4288 AS 7 / EAP 6 2017-04-28 12:37:17 +02:00
Hynek Mlnarik 115e901b90 KEYCLOAK-4288 Wildfly 2017-04-28 12:37:17 +02:00
Hynek Mlnarik cd47fd1f69 KEYCLOAK-4288 Use SessionListener to keep track of local HTTP-SSO session mappings 2017-04-28 12:37:17 +02:00
Hynek Mlnarik 7d8197b74e KEYCLOAK-4288 Fix SAML logout session for Tomcat/EAP6
When logging out via application (via ?GLO=true query parameter),
CatalineSamlSessionStore does not expire session, while it does that
in logging by SAML session index.

This causes distributed sessions being invalidated only on node hanling
the request, but remains active in other nodes of the cluster. Then the
session can be resurrected on next cache replication back even to the
node where the logout was performed. This behaviour is fixed here.
2017-04-28 12:37:16 +02:00
Anders Båtstrand 6921c20b4b KEYCLOAK-4489 Use event reader from AbstractParser, which handles newlines and whitespace.
(cherry picked from commit 224c9c5395)
2017-04-28 12:32:55 +02:00
Stian Thorgersen 921627b049 KEYCLOAK-4717 Add test 2017-04-28 11:25:44 +02:00
Stian Thorgersen 6e119b81f4 KEYCLOAK-4717 Added extra check for data content in receive message for session iframe 2017-04-28 11:25:36 +02:00
diego0020 d2e6c14796 Verify message comes from loginIframe
In the current implementation a message coming from any window on the same origin may cause the refresh token to be cleared.
In my case, messages generated by a chrome extension were causing the application to logout unexpectedly. With additional condition only messages coming from the login iFrame will be processed. Another suggestion would be changing the condition `event.data != "unchanged"` to something more specific.
2017-04-28 11:25:31 +02:00
Stian Thorgersen e1f9ab9b8a Merge pull request #4072 from hmlnarik/KEYCLOAK-4779-2.5.x
KEYCLOAK-4779 Fix NPE
2017-04-28 10:32:44 +02:00
Hynek Mlnarik 4f5a4cb22f KEYCLOAK-4779 Fix NPE
(cherry picked from commit e8a65017fa)
2017-04-25 11:11:26 +02:00
keycloak-bot ac785565ab Set version to 2.5.6.Final-SNAPSHOT 2017-03-14 11:14:04 +00:00
keycloak-bot e677755bc5 Set version to 2.5.5.Final 2017-03-14 10:31:05 +00:00
Stian Thorgersen 399aa6aeb1 Merge pull request #3946 from pedroigor/authz-fixes-2.5.x
[2.5.x] Authz fixes
2017-03-14 11:28:23 +01:00
Pavel Drozd 0f4b1cd17f KEYCLOAK-4569 SSSDTest rewrited to be usable in different enviroments 2017-03-14 11:12:07 +01:00
Pavel Drozd 1f695f257f KEYCLOAK-4304 Updated Kerberos tests to be able to run them on different environment 2017-03-14 11:11:58 +01:00
mhajas 82d34fc53e KEYCLOAK-3961 2017-03-14 11:11:04 +01:00
mposolda b7fa16e64b KEYCLOAK-4285 Adapter tests for examples fail in Wildfly/EAP6 2017-03-14 11:01:31 +01:00
vramik 6b2ffb031c KEYCLOAK-4262 disable server-config-migration for distribution and add possibility to run it with profile 2017-03-14 10:59:19 +01:00
vramik 7c2e23b18b KEYCLOAK-4262 make AbstractSamlTest class abstract 2017-03-14 10:58:35 +01:00
vramik 0fb8217904 Enable server-config-migration for distribution 2017-03-14 10:57:56 +01:00
mhajas 3c692aa469 KEYCLOAK-4179 2017-03-14 10:57:38 +01:00
mhajas ebc8132dac KEYCLOAK-4181 2017-03-14 10:57:13 +01:00
mhajas e1031b96e5 KEYCLOAK-4261 2017-03-14 10:57:01 +01:00
mhajas 7400a1c321 KEYCLOAK-4160 2017-03-14 10:55:11 +01:00
mhajas f160a2013f KEYCLOAK-4262 Test for rejected consent 2017-03-14 10:54:34 +01:00
mhajas 4d52d085ad KEYCLOAK-4084 Fix ssl adapter tests 2017-03-14 10:53:52 +01:00
mhajas e4ae6f1418 KEYCLOAK-4329 Add test for empty KeyInfo 2017-03-14 10:53:18 +01:00
mhajas 21bbfbdc1d KEYCLOAK-3987 Add test for grant role from token 2017-03-14 10:52:43 +01:00
mhajas 8f600877f5 KEYCLOAK-4346 Validation tests are failing because of ban on server which provides some imports to SAML xsd 2017-03-14 10:52:14 +01:00
mhajas 24adeddf43 KEYCLOAK-4286 Use desired version of JS-adapter 2017-03-14 10:51:16 +01:00
mhajas 954c90370a KEYCLOAK-4020 add test for boolean attribute 2017-03-14 10:50:48 +01:00
vramik 811d1f2e99 resolve 'There is no context available for qualifier' message 2017-03-14 10:49:38 +01:00
vramik 25d2b27846 refactor asserts in ExportImportTest to be more verbose 2017-03-14 10:48:55 +01:00
vramik f0aa0298ec assumeCommunity for AccountPageTest.testLocalizedReferrerLinkContent 2017-03-14 10:48:45 +01:00
vramik 48f017e28c Removed unused import from LDAPBinaryAttributesTest 2017-03-14 10:48:34 +01:00
mhajas 0eeebef83c KEYCLOAK-3841 2017-03-14 10:47:32 +01:00
Pedro Igor c7db4ff650 [KEYCLOAK-4555] - Fixes and improvements to evaluation code 2017-03-13 15:22:02 -03:00
Pedro Igor 47bc81b015 [KEYCLOAK-4549] - Scope Permission Form is not showing saved resource 2017-03-13 15:21:54 -03:00
Stian Thorgersen 94aa04f7b0 Merge pull request #3933 from hmlnarik/KEYCLOAK-4552-2.5
KEYCLOAK-4552
2017-03-13 14:42:58 +01:00
Hynek Mlnarik d0d0ab0051 KEYCLOAK-4552 2017-03-10 13:32:19 +01:00
Stan Silvert 0df5338f2b KEYCLOAK-4514: Update migration scripts according to changes to the
subsystem
2017-03-10 13:18:35 +01:00
keycloak-bot 5cd2a564ae Set version to 2.5.5.Final-SNAPSHOT 2017-02-22 19:34:52 +00:00
keycloak-bot 81b9e99c5d Set version to 2.5.4.Final 2017-02-22 18:42:32 +00:00
Stian Thorgersen a4a6dd5049 KEYCLOAK-4483
Overlay standalone differs from dist standalone
2017-02-22 19:30:19 +01:00
Stian Thorgersen 401b2508a8 KEYCLOAK-4394 Use JBoss logging 2017-02-15 09:06:35 +01:00
Stian Thorgersen 709e7a6c9d Merge pull request #3861 from stianst/2.5.x
KEYCLOAK-4392 Copy component id from representation to model
2017-02-15 08:54:58 +01:00
Stian Thorgersen 1146d8dc5b Merge pull request #3865 from sebastienblanc/2.5.x-springboot-starter
KEYCLOAK-4423 : 2.5.x adding springboot starter
2017-02-15 08:54:15 +01:00
Stian Thorgersen 7e4eb7e87c Merge pull request #3863 from sebastienblanc/correct_version
Set version to 2.5.4.Final-SNAPSHOT
2017-02-14 14:51:16 +01:00
sebastienblanc c93eee1370 set version to 2.5.4.Final-SNAPSHOT 2017-02-14 14:42:20 +01:00
sebastienblanc 7ae154562e KEYCLOAK-4423 : Adding Spring Boot Adapter 2017-02-14 14:42:20 +01:00
sebastienblanc 14fdb38dbe Set version to 2.5.4.Final-SNAPSHOT 2017-02-14 14:14:21 +01:00
sebastienblanc a6c2ae2c52 added all the adapters in BOM 2017-02-14 13:10:56 +01:00
Stian Thorgersen 98c1020d4c KEYCLOAK-4195 Keycloak adapter and SPI bom 2017-02-14 13:10:44 +01:00
Anders Båtstrand 23791a8efd KEYCLOAK-4392 Copy component id from representation to model 2017-02-14 09:43:56 +01:00
Stian Thorgersen 52366aecc8 Merge pull request #3854 from pedroigor/RHSSO-767-2.5.x
[2.5.x][RHSSO-767] - Wrong implementation of Request.getRelativePath causing failures on Tomcat-like adapters
2017-02-13 10:26:37 +01:00
Stian Thorgersen 4c7f40c32c Merge pull request #3842 from mposolda/KEYCLOAK-4385-2.5.x
KEYCLOAK-4385 Added BundleBasedKeycloakConfigResolver
2017-02-13 10:25:42 +01:00
Pedro Igor 1f5a4a6758 [RHSSO-767] - Wrong implementation of Request.getRelativePath causing failures on Tomcat-like adapters 2017-02-09 21:29:01 -02:00
Stian Thorgersen 8cb17ed292 Merge pull request #3848 from stianst/KEYCLOAK-4378-2.5.x
KEYCLOAK-4378 New user attribute is not added after first login from …
2017-02-09 10:02:07 +01:00
Stian Thorgersen 68ca3d4959 Merge pull request #3836 from mposolda/KEYCLOAK-4371-2.5.x
KEYCLOAK-4371 Offline Tokens still useless When SSO Session Max is Re…
2017-02-08 15:42:28 +01:00
Stian Thorgersen 33742dbf62 Merge pull request #3830 from mposolda/2.5.x
KEYCLOAK-4364 Fix OpenLDAP issue with renaming DN
2017-02-08 15:40:39 +01:00
Stian Thorgersen 86fb74f00f Merge pull request #3815 from pedroigor/2.5.x
[2.5.x] Authz export fixes
2017-02-08 15:00:24 +01:00
Stian Thorgersen ac7b5a9708 Merge pull request #3844 from pedroigor/KEYCLOAK-4373-2.5.x
[2.5.x][KEYCLOAK-4373] - Adapter Feature Pack is missing keycloak-authz-client
2017-02-08 14:58:30 +01:00
Frederik Libert e45c7ce19f KEYCLOAK-4378 New user attribute is not added after first login from broker 2017-02-08 14:56:08 +01:00
Pedro Igor dde05cdb0e [KEYCLOAK-4373] - Adapter Feature Pack is missing keycloak-authz-client 2017-02-07 08:46:53 -02:00
mposolda 890f9aa393 KEYCLOAK-4385 Added BundleBasedKeycloakConfigResolver 2017-02-06 21:25:36 +01:00
Bill Burke 83804d5f2e Merge pull request #3840 from patriot1burke/2.5.x
KEYCLOAK-4381
2017-02-06 13:00:15 -05:00
Bill Burke 244f6ecbc7 KEYCLOAK-4381 2017-02-06 09:37:34 -05:00
Stian Thorgersen ac8ab80e01 Merge pull request #3833 from stianst/KEYCLOAK-4370-2.5.x
KEYCLOAK-4370 Prevent LDAP provider from being migrated twice
2017-02-06 08:21:27 +01:00
mposolda dcb56d6774 KEYCLOAK-4371 Offline Tokens still useless When SSO Session Max is Reached and normal userSession expired 2017-02-03 12:07:51 +01:00
Stian Thorgersen a57aa6257f KEYCLOAK-4370 Prevent LDAP provider from being migrated twice 2017-02-03 10:07:07 +01:00
Stian Thorgersen b913a18106 Merge pull request #3826 from stianst/KEYCLOAK-4338-2.5.x
Keycloak 4338 2.5.x
2017-02-03 08:58:47 +01:00
mposolda 27f9ec9381 KEYCLOAK-4364 Fix OpenLDAP issue with renaming DN 2017-02-02 22:23:10 +01:00
Stian Thorgersen 7a24fd87b0 Merge pull request #3822 from ssilvert/2.5.x
KEYCLOAK-4362 Split migration-domain script into two separate scripts
2017-02-02 21:08:29 +01:00
Stian Thorgersen 9c8443a5fc Merge pull request #3821 from patriot1burke/2.5.x
KEYCLOAK-4363
2017-02-02 11:32:33 +01:00
Stian Thorgersen 3a466df3ac KEYCLOAK-4366 Issues when keycloak.js is initialized with token 2017-02-02 10:58:38 +01:00
Stian Thorgersen e6f4e678a0 KEYCLOAK-4338 KEYCLOAK-4331 Fixes to session iframe 2017-02-02 10:58:38 +01:00
Stan Silvert 51868ba3bf KEYCLOAK-4262 Split migration-domain script into two separate scripts 2017-02-01 14:16:33 -05:00
Bill Burke 6fc1909cf0 KEYCLOAK-4363 2017-02-01 10:19:31 -05:00
Bill Burke 59ad412159 Merge pull request #3817 from patriot1burke/2.5.x
KEYCLOAK-4218
2017-02-01 08:55:20 -05:00
Bill Burke 42415db551 KEYCLOAK-4218 2017-01-31 15:14:52 -05:00
Pedro Igor 865af553cf [KEYCLOAK-4340] - Exporting authorization settings is updating policies with wrong data 2017-01-31 13:37:00 -02:00
Pedro Igor 18d45cc325 [KEYCLOAK-4341] - Resources are not properly exported when exporting authorization settings 2017-01-31 13:36:54 -02:00
Stian Thorgersen b697e3d4a9 Set version to 2.5.4.Final-SNAPSHOT 2017-01-30 15:21:06 +01:00
Stian Thorgersen 7d43e405d6 Set version to 2.5.3.Final 2017-01-30 15:19:35 +01:00
Stian Thorgersen cc195c469f Merge pull request #3808 from hmlnarik/KEYCLOAK-4329-NPE-when-not-providing-KeyInfo-element-in-IdP-initiated-SSO-SAML-2.5
KEYCLOAK-4329 Fix NPE when not providing KeyInfo element in IdP initiated SSO SAML
2017-01-30 15:15:35 +01:00
Hynek Mlnarik 8c5330f32e KEYCLOAK-4329 Fix NPE when not providing KeyInfo element in IdP initiated SSO SAML 2017-01-30 12:02:56 +01:00
Stian Thorgersen 8a5658a86c Set version to 2.5.3.Final-SNAPSHOT 2017-01-27 09:26:45 +01:00
Stian Thorgersen 7b0693671c Set version to 2.5.2.Final 2017-01-27 09:26:44 +01:00
Stian Thorgersen aea45e46da Merge pull request #3801 from mstruk/2.5.x
KEYCLOAK-4324 Upgrade and unify Aesh version to 0.66.12
2017-01-27 09:23:20 +01:00
Marko Strukelj 243ce2fc65 KEYCLOAK-4324 Upgrade and unify Aesh version to 0.66.12 2017-01-26 17:04:22 +01:00
keycloak-bot 1200955643 Set version to 2.5.2.Final-SNAPSHOT 2017-01-26 06:07:05 +00:00
keycloak-bot 1ad464c681 Set version to 2.5.1.Final 2017-01-26 05:17:37 +00:00
Bill Burke 88a37067ad Merge pull request #3796 from patriot1burke/master
KEYCLOAK-4289
2017-01-25 17:27:53 -05:00
Bill Burke c6dab26769 KEYCLOAK-4289 2017-01-25 16:30:30 -05:00
Stian Thorgersen 9bceec9ef5 Merge pull request #3795 from stianst/KEYCLOAK-4286
KEYCLOAK-4286 Add deprecated support for old keycloak.js
2017-01-25 19:44:32 +01:00
Stian Thorgersen d1e491d57d KEYCLOAK-4286 Add deprecated support for old keycloak.js 2017-01-25 15:59:43 +01:00
Stian Thorgersen 7cfa1cc368 Merge pull request #3792 from hmlnarik/KEYCLOAK-4281-Some-adapter-tests-fail-for-Wildfly
KEYCLOAK-4281 Fix tests for SAML adapters in Arquillian TS
2017-01-25 12:29:17 +01:00
Stian Thorgersen b79ee3c7f3 Merge pull request #3794 from hmlnarik/KEYCLOAK-4258-null
KEYCLOAK-4258 Disable server-config-migration for auth-server-wildfly
2017-01-25 12:27:32 +01:00
Hynek Mlnarik 6085b21c36 KEYCLOAK-4258 Disable server-config-migration for auth-server-wildfly 2017-01-25 12:22:47 +01:00
Marek Posolda b24d2e064a Merge pull request #3791 from mposolda/master
KEYCLOAK-4282 Import authorization after users are imported
2017-01-25 12:21:21 +01:00
Stian Thorgersen 4fcb22c540 Merge pull request #3793 from stianst/KEYCLOAK-4259
KEYCLOAK-4259 Tweak login screen
2017-01-25 08:22:18 +01:00
Stian Thorgersen 07689c9537 KEYCLOAK-4259 Tweak login screen 2017-01-25 08:21:58 +01:00
Hynek Mlnarik e329c7801d KEYCLOAK-4281 Fix tests for SAML adapters in Arquillian TS 2017-01-24 22:36:03 +01:00
mposolda 2de2df3a41 KEYCLOAK-4282 Fix authorization import in DirImportProvider 2017-01-24 21:57:35 +01:00
mposolda 194a63cc71 KEYCLOAK-4282 Import authorization after users are imported 2017-01-24 17:32:34 +01:00
Bill Burke 6392405413 Merge remote-tracking branch 'upstream/master' 2017-01-24 07:13:52 -05:00
Stian Thorgersen a18a4477e0 Merge pull request #3784 from hmlnarik/KEYCLOAK-4236-Error-importing-SAML-Metadata-with-AttributeProfile-element-
KEYCLOAK-4236 Fix AttributeProfile element handler in SAML metadata
2017-01-24 10:34:39 +01:00
Stian Thorgersen 94ffeda62a Merge pull request #3773 from hmlnarik/KEYCLOAK-4181-SAML-Response-without-any-assertion-leads-to-an-exception
KEYCLOAK-4181 Fix handling of SAML error code in broker
2017-01-24 10:33:05 +01:00
Stian Thorgersen 264e81efb2 Merge pull request #3790 from stianst/KEYCLOAK-4259
KEYCLOAK-4259 Add top-margin to container to prevent overlay with logo
2017-01-24 09:36:11 +01:00
Stian Thorgersen cea52a6db9 KEYCLOAK-4259 Add top-margin to container to prevent overlay with logo 2017-01-24 09:35:57 +01:00
Stian Thorgersen b8c7fcf587 Merge pull request #3789 from stianst/KEYCLOAK-4259
KEYCLOAK-4259 Reverted original padding around logo
2017-01-24 09:27:46 +01:00
Stian Thorgersen 04228791f3 KEYCLOAK-4259 Reverted original padding around logo 2017-01-24 09:27:28 +01:00
Stian Thorgersen 04c4110f76 Merge pull request #3787 from pedroigor/KEYCLOAK-3261
[KEYCLOAK-3261] - Properly handle apps deployed at the ROOT context
2017-01-24 08:37:40 +01:00
Pedro Igor 13e92cdb35 [KEYCLOAK-3261] - Properly handle apps deployed at the ROOT context 2017-01-23 21:27:43 -02:00
Marek Posolda bd271b2367 Merge pull request #3786 from mposolda/master
KEYCLOAK-4273 Fix failing MSAD tests
2017-01-23 23:09:41 +01:00
mposolda 9fea9f6fe0 KEYCLOAK-4273 Fix failing MSAD tests 2017-01-23 22:29:13 +01:00
Marek Posolda 8717cd0090 Merge pull request #3785 from mposolda/master
KEYCLOAK-4274 Fix recursive composite role mappings
2017-01-23 19:01:25 +01:00
mposolda e487db349c KEYCLOAK-4274 Fix recursive composite role mappings 2017-01-23 17:55:45 +01:00
Marek Posolda 29c0fe564c Merge pull request #3752 from mposolda/master
KEYCLOAK-4024 Migration of old offline tokens
2017-01-23 16:25:35 +01:00
Marek Posolda b2d1a1a17f Merge pull request #3783 from mposolda/msad-ldap
KEYCLOAK-4269
2017-01-23 15:07:19 +01:00
Pavel Drozd 4868918f94 Merge pull request #3774 from vramik/KEYCLOAK-4263
KEYCLOAK-4263 disable authorization tests in integration testsuite for product profile
2017-01-23 14:05:14 +01:00
Stian Thorgersen 15d0a116ac Merge pull request #3769 from hmlnarik/KEYCLOAK-4167-Unable-to-validate-access-token-for-OIDC-External-IDP-using-configured-public-key
KEYCLOAK-4167 Always use preset key for verification if key ID not set
2017-01-23 13:59:35 +01:00
Hynek Mlnarik b5212d58ec KEYCLOAK-4236 Fix AttributeProfile element handler in SAML metadata 2017-01-23 13:46:01 +01:00
mposolda cf1c577840 Rename some tests 2017-01-23 13:42:12 +01:00
mposolda 57127f39d0 KEYCLOAK-4269 2017-01-23 13:36:54 +01:00
Stian Thorgersen 052534de82 Merge pull request #3764 from vramik/KEYCLOAK-4098
KEYCLOAK-4098 simplify + fix migration test
2017-01-23 13:04:32 +01:00
Stian Thorgersen 99e1eac094 Merge pull request #3775 from hmlnarik/KEYCLOAK-2847-Unexpected-error-when-trying-to-update-clientTemplate-to-already-existing-name
KEYCLOAK-2847 Fix exception convertor for Wildfly
2017-01-23 13:00:58 +01:00
Stian Thorgersen 7410bdb31c Merge pull request #3756 from mstruk/KEYCLOAK-3657
KEYCLOAK-3657 Role id is not preserved during import-export operation
2017-01-23 09:59:02 +01:00
Stan Silvert cc9c8d8ca1 Merge pull request #3781 from ssilvert/logo-padding
KEYCLOAK-4259: Login page rendering broken
2017-01-20 18:02:16 -05:00
Stan Silvert f55d18189c KEYCLOAK-4259: Login page rendering broken 2017-01-20 16:07:36 -05:00
Marek Posolda 6097a0c9e1 Merge pull request #3780 from mposolda/msad-ldap
KEYCLOAK-2403 Cannot create user in LDAP/AD from Keycloak using Full …
2017-01-20 21:57:30 +01:00
mposolda 39f8311484 KEYCLOAK-2403 Cannot create user in LDAP/AD from Keycloak using Full Name User Federation Mapper 2017-01-20 21:08:26 +01:00
Stan Silvert fe8e437e74 Merge pull request #3768 from ssilvert/otp-scrollbar
KEYCLOAK-3884: Another small tweak.
2017-01-20 14:22:27 -05:00
Stian Thorgersen 1373708dea Merge pull request #3760 from sldab/state-param-no-slash
KEYCLOAK-4222 Remove slash from state parameter
2017-01-20 09:33:20 +01:00
Marek Posolda 34605ee3c6 Merge pull request #3777 from mposolda/msad-ldap
KEYCLOAK-4266 MSAD: User is disabled after registration
2017-01-20 09:29:50 +01:00
mposolda 3444fb62f1 KEYCLOAK-4266 MSAD: User is disabled after registration 2017-01-19 21:32:10 +01:00
Slawomir Dabek cc788cf44e KEYCLOAK-4222 Remove slash from state parameter 2017-01-19 20:11:18 +01:00
Hynek Mlnarik 13e4f607ad KEYCLOAK-2847 Fix exception convertor for Wildfly 2017-01-19 18:11:51 +01:00
Hynek Mlnarik 5da491c270 KEYCLOAK-4181 Fix handling of SAML error code in broker 2017-01-19 16:30:06 +01:00
Hynek Mlnarik 99fcc51019 KEYCLOAK-4261 Fix response type to SAML AuthnRequest messages 2017-01-19 16:30:06 +01:00
Hynek Mlnarik 350b9550c3 KEYCLOAK-4264 2017-01-19 16:30:01 +01:00
Hynek Mlnarik f289b281a0 KEYCLOAK-4262 2017-01-19 16:00:03 +01:00
Vlasta Ramik 9cd860d698 disable authorization tests in integration testsuite for product profile 2017-01-19 14:55:20 +01:00
Stian Thorgersen 536b88790e Merge pull request #3757 from mstruk/KEYCLOAK-4150
KEYCLOAK-4150 Unresolved variable ${cliane_security-admin-console} in admin web client
2017-01-19 13:55:36 +01:00
Bill Burke 73d3e8afd9 Merge pull request #3770 from patriot1burke/master
KEYCLOAK-4077
2017-01-19 07:35:10 -05:00
Vlasta Ramik aef6bb9789 simplify + fix migration test 2017-01-19 12:35:59 +01:00
Bill Burke b4f56e92f3 Merge remote-tracking branch 'upstream/master' 2017-01-18 18:29:01 -05:00
Bill Burke 8daa2c3703 KEYCLOAK-4256 2017-01-18 18:28:08 -05:00
Pedro Igor c7f2a0ffdd Merge pull request #3766 from pedroigor/KEYCLOAK-4203
[KEYCLOAK-4203] - Removing references to Drools
2017-01-18 13:31:23 -02:00
Pedro Igor c19360c6f2 [KEYCLOAK-4203] - Removing references to Drools 2017-01-18 12:44:30 -02:00
Stian Thorgersen 71da6ab4e9 Merge pull request #3772 from stianst/KEYCLOAK-4252
KEYCLOAK-4252 Update server-overlay assembly
2017-01-18 13:44:04 +01:00
Stian Thorgersen 9f33685785 KEYCLOAK-4252 Update server-overlay assembly 2017-01-18 12:29:39 +01:00
Hynek Mlnarik df4f1e7129 KEYCLOAK-4167 Always use preset key for verification if key ID not set 2017-01-18 10:29:06 +01:00
Stian Thorgersen 212182ee34 Merge pull request #3765 from zschwarz/community
KEYCLOAK-4233 Run failing i18n tests with community profile
2017-01-18 08:52:17 +01:00
Stian Thorgersen 86988833e9 Merge pull request #3761 from abstractj/KEYCLOAK-4207
[KEYCLOAK-4207] SSSD Provider - NullPointerException when mail attribute is not filled
2017-01-18 08:41:36 +01:00
Stian Thorgersen 5a0504b5d9 Merge pull request #3753 from hmlnarik/KEYCLOAK-4216-mod-auth-mellon-logout-failed-when-using-SSO
KEYCLOAK-4216 Fix NPE and logout binding choice
2017-01-18 08:40:02 +01:00
Stian Thorgersen e364680792 Merge pull request #3721 from hmlnarik/KEYCLOAK-3399-End-session-endpoint-returns-error-when-keycloak-session-is-expired
KEYCLOAK-3399 Ignore user session expiration on OIDC logout
2017-01-18 08:38:53 +01:00
Marek Posolda ef46070410 Merge pull request #3771 from mposolda/msad-ldap
KEYCLOAK-2333 LDAP/MSAD password policies are not used when user chan…
2017-01-17 21:54:01 +01:00
mposolda 843b4b470b KEYCLOAK-2333 LDAP/MSAD password policies are not used when user changes password 2017-01-17 21:06:09 +01:00
Bill Burke dcf6da2a51 KEYCLOAK-4077 2017-01-17 09:20:44 -05:00
Stian Thorgersen 3d29816ea3 Merge pull request #3763 from vmuzikar/KEYCLOAK-4230
KEYCLOAK-4230 Fix failing Arquillian tests in the "other" module
2017-01-17 14:15:03 +01:00
Stan Silvert 2eeb2f52c5 KEYCLOAK-3884: Another small tweak. 2017-01-16 14:24:44 -05:00
Stan Silvert 32827be8b1 Merge pull request #3767 from ssilvert/remove-time-conversion
KEYCLOAK-3953: Remove recalculation of time when units change
2017-01-16 12:05:37 -05:00
Stan Silvert 23c1f513e7 KEYCLOAK-3953: Remove recalculation of time when units change 2017-01-16 09:55:08 -05:00
zschwarz ae40bfb96e KEYCLOAK-4233 Run failing i18n tests with community profile 2017-01-16 15:27:39 +01:00
Vaclav Muzikar 547f5ecfa6 KEYCLOAK-4230 Fix failing Arquillian tests in the "other" module 2017-01-16 10:59:02 +01:00
Stian Thorgersen 1913f801b9 Merge pull request #3739 from hmlnarik/KEYCLOAK-2847-Unexpected-error-when-trying-to-update-clientTemplate-to-already-existing-name
KEYCLOAK-2847 Fix for client template duplicate name
2017-01-16 09:45:39 +01:00
Stian Thorgersen 5842f7c837 Merge pull request #3751 from stianst/KEYCLOAK-4192
KEYCLOAK-4192 Added missing produces annotations for update methods
2017-01-16 09:41:29 +01:00
Stian Thorgersen 1ef2eb6110 Merge pull request #3693 from ssilvert/config-migration-2
KEYCLOAK-4101: jboss-cli script to do migration of configuration
2017-01-16 09:37:01 +01:00
Stian Thorgersen 178625d3f2 Merge pull request #3745 from velias/master
KEYCLOAK-4202 - Attribute importer of Social Identity providers doesn't handle JSON 'null' values correctly
2017-01-16 08:22:04 +01:00
Bruno Oliveira 9fb46a7b1c [KEYCLOAK-4207] SSSD Provider - NullPointerException when mail attribute is not filled 2017-01-13 17:35:55 -02:00
Bill Burke bea8de8a1a Merge pull request #3758 from patriot1burke/master
KEYCLOAK-4220
2017-01-13 12:58:21 -05:00
Marko Strukelj d68f6bbc42 KEYCLOAK-4150 Unresolved variable ${cliane_security-admin-console} in admin web client 2017-01-13 17:48:21 +01:00
Marko Strukelj 7de999a7f9 KEYCLOAK-3657 Role id is not preserved during import-export operation 2017-01-13 17:46:30 +01:00
Bill Burke ffb688b393 Merge remote-tracking branch 'upstream/master' 2017-01-13 11:45:55 -05:00
Bill Burke 6aee6b0c46 KEYCLOAK-4220 2017-01-13 11:45:48 -05:00
Bill Burke aa78c9eaf5 Merge pull request #3666 from hmlnarik/KEYCLOAK-4072-User-ID-from-User-Storage-Provider-too-long-for-Offline-User-Session
KEYCLOAK-4072 Add explicit check for key format
2017-01-13 09:39:45 -05:00
Hynek Mlnarik 02eda8943c KEYCLOAK-4216 Fix NPE and logout binding choice 2017-01-13 14:30:32 +01:00
Pavel Drozd 2f7143e72f Merge pull request #3749 from pdrozd/KEYCLOAK-4210
KEYCLOAK-4210: Added Fuse admin tests
2017-01-13 11:37:24 +01:00
mposolda 9ad14d991c KEYCLOAK-4140 Migration of old offline tokens 2017-01-13 11:35:19 +01:00
Marek Posolda 59a6c9f13f Merge pull request #3748 from mposolda/master
KEYCLOAK-4201 Offline tokens become useless when accessing admin REST…
2017-01-13 10:20:33 +01:00
Stian Thorgersen ae838c12db Merge pull request #3744 from martin-kanis/KEYCLOAK-4157
KEYCLOAK-4157 Move drools-bom from keycloak-parent
2017-01-13 09:57:21 +01:00
Stian Thorgersen ac9268bd48 KEYCLOAK-4192 Added missing produces annotations for update methods 2017-01-13 09:56:20 +01:00
Hynek Mlnarik 0b58bebc90 KEYCLOAK-2847 Fix for client template duplicate name 2017-01-13 09:32:28 +01:00
mposolda 93157e49d5 KEYCLOAK-4201 Offline tokens become useless when accessing admin REST API 2017-01-13 09:06:53 +01:00
Pavel Drozd 3d9f11168e KEYCLOAK-4210: Added Fuse admin tests 2017-01-13 01:05:37 +01:00
Stan Silvert c4cce147e2 Merge pull request #3747 from ssilvert/otp-scrollbar
KEYCLOAK-3884: OTP login page cutoff under weird sizes
2017-01-12 16:37:43 -05:00
Stan Silvert 3a2927e12e KEYCLOAK-3884: OTP login page cutoff under weird sizes 2017-01-12 16:02:04 -05:00
Stan Silvert 901ff9c3d5 KEYCLOAK-4101: Uncomment sssd module from pom 2017-01-12 12:10:03 -05:00
Bill Burke 8de3b26126 Merge pull request #3746 from patriot1burke/master
KEYCLOAK-4099
2017-01-12 11:17:28 -05:00
Bill Burke 1e51ade620 Merge remote-tracking branch 'upstream/master' 2017-01-12 09:34:36 -05:00
Bill Burke 89e6f93fa4 KEYCLOAK-4099 2017-01-12 09:34:26 -05:00
Bill Burke 41630d6962 Merge pull request #3727 from hmlnarik/KEYCLOAK-4141
KEYCLOAK-4141
2017-01-12 08:49:29 -05:00
Stian Thorgersen efcd0346fc Merge pull request #3742 from hmlnarik/KEYCLOAK-4167-Unable-to-validate-access-token-for-OIDC-External-IDP-using-configured-public-key
KEYCLOAK-4167 Make OIDC identity provider key ID configurable
2017-01-12 14:41:53 +01:00
Vlastimil Elias f13deab812 KEYCLOAK-4202 - Attribute importer of Social Identity providers doesn't
handle JSON 'null' values correctly
2017-01-12 14:14:09 +01:00
Martin Kanis f28b3c1269 KEYCLOAK-4157 Move drools-bom from keycloak-parent 2017-01-12 13:58:56 +01:00
Marek Posolda 5e1ec459e5 Merge pull request #3743 from mposolda/master
KEYCLOAK-4137 Significant performance lag in 'get client role by role…
2017-01-12 12:48:23 +01:00
mposolda 9a6f202c46 KEYCLOAK-4137 Significant performance lag in 'get client role by role name' 2017-01-12 11:55:58 +01:00
Hynek Mlnarik e11957ecf3 KEYCLOAK-4167 Make OIDC identity provider key ID configurable 2017-01-11 18:24:22 +01:00
Marek Posolda 23c8809598 Merge pull request #3738 from mposolda/master
KEYCLOAK-4066 TimeoutException in cluster environment in ClearExpired…
2017-01-11 13:01:58 +01:00
mposolda 7098daaf72 KEYCLOAK-4066 TimeoutException in cluster environment in ClearExpiredSessions 2017-01-11 12:27:51 +01:00
Stian Thorgersen 811d532b48 Merge pull request #3735 from stianst/KEYCLOAK-4179
KEYCLOAK-4179 Fixed logic to init with token to prevent issues with t…
2017-01-10 15:19:40 +01:00
Stian Thorgersen 7ceef826ac Merge pull request #3734 from stianst/KEYCLOAK-4176
KEYCLOAK-4176
2017-01-10 15:19:05 +01:00
Stan Silvert fe294dcb58 KEYCLOAK-4101: Fix pom 2017-01-10 07:37:40 -05:00
Stan Silvert 8441bda3da KEYCLOAK-4101: Move tests under testsuite. Only run under
-Pauth-server-wildfly
2017-01-10 07:30:58 -05:00
Marek Posolda 227900f288 Merge pull request #3731 from mposolda/master
KEYCLOAK-4175 Provide a way to set the connect and read timeout for l…
2017-01-10 09:49:18 +01:00
Stian Thorgersen 345e0da76d Merge pull request #3733 from stianst/KEYCLOAK-4180
KEYCLOAK-4180 When you turn on authorization for client Clustering ta…
2017-01-10 09:33:04 +01:00
Stian Thorgersen 139e12fa5f KEYCLOAK-4179 Fixed logic to init with token to prevent issues with timeSkew 2017-01-10 09:09:50 +01:00
Hynek Mlnarik 4df70c517d KEYCLOAK-4141 2017-01-10 09:02:36 +01:00
Pavel Drozd cbd6f7e1d0 Merge pull request #3723 from mhajas/KEYCLOAK-3841
KEYCLOAK-3841 Unignore and fix fuse on eap test
2017-01-10 08:10:22 +01:00
Stian Thorgersen 426e55664f KEYCLOAK-4176 2017-01-10 08:02:49 +01:00
Stian Thorgersen ab0a669662 KEYCLOAK-4180 When you turn on authorization for client Clustering tab appears without saving 2017-01-10 06:59:40 +01:00
Stian Thorgersen 5c03b20bd1 Merge pull request #3730 from tkyjovsk/fix-module-version
fixed version of module `integration-arquillian-tests-adapters-remote`
2017-01-10 06:24:14 +01:00
Stian Thorgersen 7eeebff874 Merge pull request #3720 from hmlnarik/KEYCLOAK-4091-Possible-NullPointerExceptions-with-disabled-cache
KEYCLOAK-4091 Prevent NPE with disabled cache
2017-01-10 06:23:10 +01:00
Stian Thorgersen a0a7372160 Merge pull request #3728 from stianst/KEYCLOAK-4014
KEYCLOAK-4165 KEYCLOAK-4014 Add missing sources for ace editor and fi…
2017-01-10 06:20:07 +01:00
Stan Silvert 9e697d033f KEYCLOAK-4101: Use the same undocumented tags for server-args. Only
documented in the examples.
2017-01-09 18:15:37 -05:00
Stan Silvert 2ec3eaf68a KEYCLOAK-4101: Use undocumented method to specify java-opts 2017-01-09 18:15:34 -05:00
Stan Silvert e047872c25 KEYCLOAK-4101: Bump version on pom 2017-01-09 18:15:31 -05:00
Stan Silvert f1173f8022 KEYCLOAK-4101: Try setting javaOpts on each individual execution. 2017-01-09 18:15:28 -05:00
Stan Silvert 420286c103 KEYCLOAK-4101: jboss-cli script to do migration of configuration 2017-01-09 18:15:26 -05:00
Bill Burke 1495f4881e Merge pull request #3732 from patriot1burke/master
KEYCLOAK-3617 KEYCLOAK-4117 KEYCLOAK-4118
2017-01-09 18:14:11 -05:00
Bill Burke 452611242c Merge remote-tracking branch 'upstream/master' 2017-01-09 17:14:34 -05:00
Bill Burke d075172fd2 KEYCLOAK-3617 KEYCLOAK-4117 KEYCLOAK-4118 2017-01-09 17:14:20 -05:00
mposolda c32620b718 KEYCLOAK-4175 Provide a way to set the connect and read timeout for ldap connections 2017-01-09 21:35:58 +01:00
Tomas Kyjovsky 37b8d1ad10 fixed version of module integration-arquillian-tests-adapters-remote and added it to the project structure 2017-01-09 18:45:27 +01:00
Marek Posolda be4f2aff63 Merge pull request #3729 from mposolda/master
KEYCLOAK-4178 Bad error message when kerberos provider unavailable
2017-01-09 18:31:49 +01:00
mposolda 14669dfbc5 KEYCLOAK-4178 Bad error message when kerberos provider unavailable 2017-01-09 16:56:58 +01:00
Marek Posolda 5cec0d4bef Merge pull request #3726 from mposolda/master
KEYCLOAK-2888 KEYCLOAK-3927 Fully migrate kerberos tests to the new t…
2017-01-09 15:07:28 +01:00
Stian Thorgersen dd74b57d13 KEYCLOAK-4165 KEYCLOAK-4014 Add missing sources for ace editor and fix loading of ace libs 2017-01-09 14:59:50 +01:00
mposolda a09bc6520f KEYCLOAK-2888 KEYCLOAK-3927 Fully migrate kerberos tests to the new testsuite 2017-01-09 13:50:41 +01:00
Stian Thorgersen 8a02ef1859 Merge pull request #3715 from hmlnarik/KEYCLOAK-4160
KEYCLOAK-4160
2017-01-09 12:50:38 +01:00
Stian Thorgersen 9ccd05ff54 Merge pull request #3725 from bdalenoord/KEYCLOAK-4177
KEYCLOAK-4177: Changed URL to FreeOTP homepage;
2017-01-09 11:28:09 +01:00
Bas Dalenoord 42a8a0eb15 KEYCLOAK-4177: Changed URL to FreeOTP homepage; 2017-01-09 10:30:29 +01:00
Pavel Drozd fb374ad99d Merge pull request #3716 from mhajas/KEYCLOAK-3704
KEYCLOAK-3704 Add missing test
2017-01-08 16:09:12 +01:00
Pavel Drozd a4f46d3310 Merge pull request #3714 from vramik/KEYCLOAK-4109
KEYCLOAK-4109 test + minor fix
2017-01-08 16:07:34 +01:00
Pedro Igor 5bc134ea7b Merge pull request #3717 from pedroigor/KEYCLOAK-4164
[KEYCLOAK-4164] - Creating typed resources always result in error
2017-01-06 17:29:47 -02:00
Pedro Igor 28c289cfb8 Merge pull request #3724 from pedroigor/KEYCLOAK-4166
[KEYCLOAK-4166] - Export/Import clients functionality not working as expected
2017-01-06 17:29:17 -02:00
Pedro Igor 0b5b27ea3a [KEYCLOAK-4166] - Export/Import clients functionality not working as expected 2017-01-06 16:07:10 -02:00
Stian Thorgersen f1dbe3c9e2 Merge pull request #3722 from stianst/KEYCLOAK-4096
KEYCLOAK-4096 Add migration test for realm keys
2017-01-06 16:08:10 +01:00
Hynek Mlnarik 9fb3201c8b KEYCLOAK-3399 Ignore user session expiration on OIDC logout 2017-01-06 15:15:46 +01:00
Stian Thorgersen 96f8f99313 Merge pull request #3707 from hmlnarik/KEYCLOAK-4148-AbstractParser-should-do-the-same
KEYCLOAK-4148 [AbstractParser] instantiate XMLInputFactory in singleton-like manner
2017-01-06 14:44:41 +01:00
mhajas 86c49f5e89 KEYCLOAK-3841 Unignore and fix fuse on eap test 2017-01-06 14:39:24 +01:00
Stian Thorgersen 017dbb1d9f Merge pull request #3719 from ssilvert/overlay-cli
KEYCLOAK-4123: keycloak-install.cli fails if not run from bin dir
2017-01-06 14:24:35 +01:00
Stian Thorgersen 60eda52aba KEYCLOAK-4096 Add migration test for realm keys 2017-01-06 14:18:57 +01:00
Hynek Mlnarik 377fbced4a KEYCLOAK-4091 Prevent NPE with disabled cache 2017-01-06 10:00:11 +01:00
Stian Thorgersen fb6a8da863 Merge pull request #3713 from stianst/KEYCLOAK-3952
KEYCLOAK-3952
2017-01-06 07:17:27 +01:00
Hynek Mlnarik 0cb5ba0f6e KEYCLOAK-4160 2017-01-06 07:00:47 +01:00
Stan Silvert eb1b011989 KEYCLOAK-4123: keycloak-install.cli fails if not run from bin dir 2017-01-05 21:25:41 -05:00
Pedro Igor 72691b2e74 [KEYCLOAK-4164] - Creating typed resources always result in error 2017-01-05 14:32:49 -02:00
Bill Burke f9eeecf836 test KEYCLOAK-4013 2017-01-05 11:27:17 -05:00
mhajas 61e7936d79 KEYCLOAK-3704 Add missing test 2017-01-05 16:55:40 +01:00
Bill Burke 4934fe5a8e Merge remote-tracking branch 'upstream/master' 2017-01-05 10:52:12 -05:00
Hynek Mlnarik 2035398ef4 KEYCLOAK-4148 Instantiate XML DocumentBuilder in singleton-like manner 2017-01-05 16:07:50 +01:00
Stian Thorgersen 56160ef12b Merge pull request #3652 from little-headbanger/KEYCLOAK-4088_Http_wrapper_of_Angular_2_demo_app_doesn't_forward_http_errors
KEYCLOAK-4088 Http wrapper of Angular 2 demo app doesn't forward http…
2017-01-05 13:19:36 +01:00
Vlasta Ramik b0644ce18c test for KEYCLOAK-4109 + fix AuthorizationDisabledInPreviewTest 2017-01-05 11:14:41 +01:00
Pavel Drozd cf5c3aa53b Merge pull request #3710 from mhajas/KEYCLOAK-3488
KEYCLOAK-3488 Add missing test
2017-01-05 11:03:35 +01:00
Pavel Drozd f9e87516ae Merge pull request #3709 from mhajas/KEYCLOAK-3658
KEYCLOAK-3658 Add missing test
2017-01-05 11:02:44 +01:00
Pavel Drozd ed1a30f67b Merge pull request #3704 from vmuzikar/KEYCLOAK-4147
KEYCLOAK-4147 Fix Password Policy UI test
2017-01-05 11:01:18 +01:00
Pavel Drozd 77293b85e0 Merge pull request #3701 from vramik/KEYCLOAK-4145
KEYCLOAK-4145 fix PartialImportTest for migration tests
2017-01-05 10:58:51 +01:00
Hynek Mlnarik ad9210a7a7 KEYCLOAK-4148 Prevent unnecessary deserialization when supported
... and gain another ~ 5-10 %
2017-01-05 10:41:31 +01:00
Stian Thorgersen 15af61a7cc Merge pull request #3708 from stianst/KEYCLOAK-2856
KEYCLOAK-2856
2017-01-05 09:01:37 +01:00
Stian Thorgersen 2d1417d72b KEYCLOAK-3952
User Administration: Double step cancel
2017-01-05 08:50:22 +01:00
Stan Silvert 41404424ac Merge pull request #3712 from ssilvert/page-not-found-federation
KEYCLOAK-4155: User Federation: Page not found when click cancel crea…
2017-01-04 14:43:22 -05:00
Pedro Igor a2a531a747 Merge pull request #3711 from pedroigor/KEYCLOAK-3517
[KEYCLOAK-3517] - Filtering SAML ECP flow
2017-01-04 17:34:09 -02:00
Stan Silvert a76c52ef84 KEYCLOAK-4155: User Federation: Page not found when click cancel creating
ldap provider
2017-01-04 14:03:39 -05:00
Pedro Igor ed75ef900a [KEYCLOAK-3517] - Removing SAML ECP from expected flows. ECP already tested in other places. 2017-01-04 13:06:08 -02:00
Hynek Mlnarik 862502f3ed KEYCLOAK-4148 StringUtils property replacer optimization
StringUtils.getSystemPropertyAsString is used in SAML attribute
retrieval and uses StringBuffer and suboptimal regex. This optimization
gains another ~ 3 %.
2017-01-04 15:24:57 +01:00
Hynek Mlnarik 2b57b8371b KEYCLOAK-4148 Instantiate XML DatatypeFactory in singleton-like manner
... to gain another ~ 6 %
2017-01-04 15:24:57 +01:00
Pedro Igor 4044b39ab7 [KEYCLOAK-3517] - Filtering SAML ECP flow 2017-01-04 11:17:39 -02:00
mhajas e0bc56960b KEYCLOAK-3488 Add missing test 2017-01-04 10:06:07 +01:00
mhajas 180352aa09 KEYCLOAK-3658 Add missing test 2017-01-04 09:00:36 +01:00
Stian Thorgersen 09a61f4706 KEYCLOAK-2856 2017-01-04 08:38:06 +01:00
Hynek Mlnarik 5150251141 KEYCLOAK-4148 [AbstractParser] instantiate XMLInputFactory in singleton-like manner 2017-01-04 08:06:56 +01:00
Stian Thorgersen 732d56b0c0 Merge pull request #3706 from hmlnarik/KEYCLOAK-4148-StaxParserUtil-should-instantiate-XMLInputFactory-only-once
KEYCLOAK-4148 Instantiate XMLInputFactory in singleton-like manner
2017-01-04 07:22:17 +01:00
Stian Thorgersen 08aeb13804 Merge pull request #3705 from hmlnarik/KEYCLOAK-3950-Tests-of-SAML-AuthnRequests-NameID-format-variants
KEYCLOAK-3950 - Tests for SAML Name ID format variants in AuthnRequest
2017-01-04 07:15:33 +01:00
Stian Thorgersen 1f0469894a Merge pull request #3702 from mstruk/admin-cli
KEYCLOAK-4146 Admin CLI enhancements
2017-01-04 07:13:09 +01:00
Stian Thorgersen 8a0859fcba Merge pull request #3700 from stianst/KEYCLOAK-2980
KEYCLOAK-2980 Fix admin query for resource path
2017-01-04 07:01:19 +01:00
Stian Thorgersen 5212f57b5b Merge pull request #3703 from stianst/KEYCLOAK-4116
KEYCLOAK-4116 Trim username on recover password page
2017-01-04 07:00:51 +01:00
Bill Burke 6ac1301dc2 Merge remote-tracking branch 'upstream/master' 2017-01-03 15:21:16 -05:00
Hynek Mlnarik 1eb0cde74f KEYCLOAK-4148 Instantiate XMLInputFactory in singleton-like manner 2017-01-03 15:34:28 +01:00
Hynek Mlnarik 32f8fd4b9f KEYCLOAK-3950 - Tests for SAML Name ID format variants in AuthnRequest 2017-01-03 15:34:28 +01:00
Vaclav Muzikar 90a5272860 KEYCLOAK-4147 Fix Password Policy UI test 2017-01-03 13:09:38 +01:00
Hynek Mlnarik 40a8f0a243 KEYCLOAK-3950 - Tests for SAML Name ID format variants in AuthnRequest 2017-01-03 12:48:18 +01:00
Stian Thorgersen f2ee9df600 KEYCLOAK-4116 Trim username on recover password page 2017-01-03 11:50:08 +01:00
Marko Strukelj 9ab44b79ce KEYCLOAK-4146 Admin CLI enhancements
- Added -b, --body and composite roles support
- Added a test that performs a demo session
2017-01-03 11:14:12 +01:00
Vlasta Ramik 50c11e105b fix PartialImportTest for migration tests 2017-01-03 10:36:22 +01:00
Stian Thorgersen b7c98ed433 KEYCLOAK-2980 Fix admin query for resource path 2017-01-03 10:34:21 +01:00
Stian Thorgersen d217b23719 Merge pull request #3699 from stianst/KEYCLOAK-4090
KEYCLOAK-4090
2017-01-03 10:27:59 +01:00
Stian Thorgersen 171c6ab88f Merge pull request #3697 from stianst/master
Cleanup of tests including groups for Travis
2017-01-03 08:41:00 +01:00
Stian Thorgersen 45411b1199 KEYCLOAK-4090 2017-01-03 07:53:08 +01:00
Stian Thorgersen e0bfb13ed9 Cleanup of tests including groups for Travis 2017-01-03 07:52:00 +01:00
Stian Thorgersen 902332c5ae Merge pull request #3696 from stianst/KEYCLOAK-4038
KEYCLOAK-4038 Get bind credential from component if stored
2017-01-02 15:44:59 +01:00
Stian Thorgersen 08d7211a93 KEYCLOAK-4038 Get bind credential from component if stored 2017-01-02 14:40:12 +01:00
Stian Thorgersen 1c0e204f50 Merge pull request #3690 from stianst/master
Bump version to 2.5.1.Final-SNAPSHOT
2017-01-02 08:52:04 +01:00
Stian Thorgersen d6e620a266 Merge pull request #3689 from stianst/KEYCLOAK-4133
KEYCLOAK-4133
2017-01-02 08:51:37 +01:00
Pedro Igor 54b3d3abec Merge pull request #3695 from pedroigor/KEYCLOAK-4136
[KEYCLOAK-4136] - Missing update on resource_set endpoint
2017-01-01 18:01:53 -02:00
Pedro Igor 31ed69a970 [KEYCLOAK-4136] - Missing update on resource_set endpoint 2016-12-29 11:59:42 -02:00
Marek Posolda b1d9fd670a Merge pull request #3691 from vramik/migration-duplicate-emails
KEYCLOAK-4059 Added migration test
2016-12-22 12:42:16 +01:00
Marek Posolda bf58511d81 Merge pull request #3692 from mposolda/l1-bug
RHSSO-377 Added reproducer unit test L1SerializationIssueTest
2016-12-22 12:41:49 +01:00
mposolda b5317f3485 RHSSO-377 Added reproducer unit test L1SerializationIssueTest 2016-12-22 11:41:10 +01:00
Stian Thorgersen e805ffd945 Bump version to 2.5.1.Final-SNAPSHOT 2016-12-22 08:22:18 +01:00
Stian Thorgersen 40b5731198 KEYCLOAK-4133
Login status iframe endpoint doesn't set encoding
2016-12-22 08:20:55 +01:00
Stian Thorgersen ebd3d522e2 Merge pull request #3654 from tkyjovsk/fix-many-users-test
fixed ManyUsersTest
2016-12-22 06:16:28 +01:00
Stian Thorgersen 04179c5681 Merge branch 'KEYCLOAK-4004' of https://github.com/l-robinson/keycloak into l-robinson-KEYCLOAK-4004 2016-12-22 06:13:41 +01:00
Stian Thorgersen 6c8ebdb456 Merge pull request #3686 from vramik/KEYCLOAK-3830
KEYCLOAK-3830 added missing test
2016-12-22 05:56:27 +01:00
Pedro Igor 85446c3b46 Merge pull request #3688 from pedroigor/KEYCLOAK-4125
[KEYCLOAK-4125] - Fixing when running in a cluster
2016-12-21 20:34:10 -02:00
Pedro Igor df7a68b709 [KEYCLOAK-4125] - Fixing when running in a cluster 2016-12-21 20:04:08 -02:00
Tomas Kyjovsky 1c65fd86ef fixed ManyUsersTest 2016-12-21 18:48:44 +01:00
Vlasta Ramik bb00524f94 Added migration for KEYCLOAK-4059 2016-12-21 15:39:48 +01:00
Vlasta Ramik 7f9e6bbf60 KEYCLOAK-3830 added missing test 2016-12-21 14:45:30 +01:00
Marek Posolda 2ba21485f9 Merge pull request #3685 from mposolda/master
KEYCLOAK-4128 ResourcePermissionManagementTest fails on Oracle DB
2016-12-21 13:44:15 +01:00
mposolda c998198aac KEYCLOAK-4128 ResourcePermissionManagementTest fails on Oracle DB 2016-12-21 13:01:37 +01:00
Marek Posolda 3e8d4e4eb6 Merge pull request #3684 from mposolda/master
Fix LDAP tests with mongo
2016-12-21 10:10:09 +01:00
Stian Thorgersen b15918b745 Merge pull request #3683 from stianst/KEYCLOAK-4127
KEYCLOAK-4127
2016-12-21 09:59:09 +01:00
mposolda d2b7f18480 Fix LDAP tests with mongo 2016-12-21 09:28:32 +01:00
Stian Thorgersen 663b99d884 KEYCLOAK-4127
Temporarily disable cache for authorization services as it breaks clustering
2016-12-21 08:36:24 +01:00
Stian Thorgersen e3e18913f1 Merge pull request #3682 from stianst/KEYCLOAK-4126
Change id of CachedStoreFactorySpi to authorizationCache
2016-12-21 08:34:28 +01:00
Stian Thorgersen f98c454775 Merge pull request #3681 from hmlnarik/KEYCLOAK-4122-Some-databases-fails-to-start
KEYCLOAK-4122
2016-12-21 08:32:27 +01:00
Stian Thorgersen 9c2944c090 Change id of CachedStoreFactorySpi to authorizationCache 2016-12-21 07:01:19 +01:00
Hynek Mlnarik 66eb9095c1 KEYCLOAK-4122 2016-12-20 20:28:13 +01:00
Stian Thorgersen e7c73518b3 Merge pull request #3680 from stianst/master
KEYCLOAK-4120
2016-12-20 15:04:29 +01:00
Bill Burke 172007f59c conflict 2016-12-20 08:56:08 -05:00
Stian Thorgersen e262f8fb63 KEYCLOAK-4120
Authz doesn't show in menu for clients
2016-12-20 14:46:56 +01:00
Stian Thorgersen b6b3c04400 Merge pull request #3663 from sldab/autodetect-bearer-only
KEYCLOAK-2962 Autodetect bearer-only clients
2016-12-20 14:05:25 +01:00
Stian Thorgersen f97a3e0745 Merge pull request #3678 from vramik/KEYCLOAK-3777
KEYCLOAK-3777 added missing test
2016-12-20 14:04:35 +01:00
Stian Thorgersen f9bccc83f9 Merge pull request #3679 from stianst/KEYCLOAK-4110
KEYCLOAK-4110
2016-12-20 14:03:56 +01:00
Marek Posolda 761714036e Merge pull request #3677 from mposolda/master
Fix LDAP tests with MSAD, RHDS and OpenLDAP
2016-12-20 13:27:10 +01:00
Stian Thorgersen d365d9d784 Merge pull request #3649 from sldab/bearer-client-credentials
KEYCLOAK-4086 Client credentials missing in bearer-only JSON config
2016-12-20 12:32:03 +01:00
mposolda 96f2985e86 Fix StackOverflowError on Mongo 2016-12-20 12:21:21 +01:00
Stian Thorgersen 7bad8e6ff3 KEYCLOAK-4110
Broken key providers in Admin Console
2016-12-20 12:08:18 +01:00
Vlasta Ramik 55d53214a1 KEYCLOAK-3777 added missing test 2016-12-20 11:50:37 +01:00
mposolda aee8398ee8 KEYCLOAK-4072 Minor update 2016-12-20 11:42:24 +01:00
mposolda 7cd63f2f8b Fix LDAP tests with MSAD, RHDS and OpenLDAP 2016-12-20 11:40:29 +01:00
Bill Burke 8b5aafc4b4 KEYCLOAK-4072 2016-12-20 09:42:43 +01:00
Stian Thorgersen f6323d94ec Merge pull request #3676 from stianst/KEYCLOAK-4109
KEYCLOAK-4109 Ability to disable impersonation
2016-12-20 09:35:03 +01:00
Stian Thorgersen eb7ad07e31 KEYCLOAK-4109 Ability to disable impersonation 2016-12-20 08:46:21 +01:00
Pedro Igor 7c7f87d201 Merge pull request #3675 from pedroigor/master
[KEYCLOAK-4034] - Minor changes to policy enforcer
2016-12-20 01:03:08 -02:00
Pedro Igor 18b94a2153 [KEYCLOAK-4034] - More logging. 2016-12-20 00:04:59 -02:00
Pedro Igor 0b3e867362 [KEYCLOAK-4034] - Minor changes to policy enforcer 2016-12-19 23:44:51 -02:00
Marek Posolda 3498273601 Merge pull request #3674 from mposolda/master
Remove obsolete maven profile
2016-12-20 00:18:15 +01:00
l-robinson 01a8c13ac0 Additional client name added to AccountTest.applications() 2016-12-20 09:40:19 +10:30
Pedro Igor 194ba6009f Merge pull request #3673 from pedroigor/master
[KEYCLOAK-4034] - Invalidating policy cache when creating resources and scopes
2016-12-19 20:55:53 -02:00
Pedro Igor c9c8acd029 [KEYCLOAK-4034] - Invalidating policy cache when creating resources and scopes 2016-12-19 20:28:49 -02:00
mposolda 7e2c06e301 Remove obsolete maven profile. Run LDAPLegacyImportTest just with the embedded LDAP 2016-12-19 22:15:13 +01:00
Pedro Igor 40591cff25 Merge pull request #3662 from pedroigor/KEYCLOAK-4034
[KEYCLOAK-4034] - Improvements to UI, performance and some code cleanup
2016-12-19 16:49:10 -02:00
Pedro Igor 5cf5168770 [KEYCLOAK-4034] - Improvements to UI, performance and some code cleanup 2016-12-19 16:48:16 -02:00
Marek Posolda cb57dbf58a Merge pull request #3672 from mposolda/master
KEYCLOAK-4087 LDAP group mapping should be possible via uidNumber in memberUid
2016-12-19 19:31:31 +01:00
mposolda 4b6df5d489 LDAP polishing 2016-12-19 18:11:23 +01:00
Slawomir Dabek b6d29ccd30 KEYCLOAK-2962 Autodetect bearrer-only clients
Suport more headers
2016-12-19 17:13:14 +01:00
Slawomir Dabek 16fb1e2078 KEYCLOAK-4086 Client credentials missing in bearer-only Keycloak OIDC JSON 2016-12-19 16:55:19 +01:00
mposolda ac00f7fee2 KEYCLOAK-4087 LDAP group mapping should be possible via uidNumber in memberUid mode 2016-12-19 16:27:57 +01:00
Stian Thorgersen faeff029fa Merge pull request #3664 from mstruk/admin-cli
KEYCLOAK-912 Admin CLI
2016-12-19 15:46:17 +01:00
Marek Posolda c6363aa146 Merge pull request #3630 from sldab/duplicate-email-support
KEYCLOAK-4059 Support for duplicate emails
2016-12-19 15:37:18 +01:00
Stian Thorgersen 2c70e53df6 Merge pull request #3670 from stianst/ssilvert-duplicate-groups
Ssilvert duplicate groups
2016-12-19 15:33:24 +01:00
Stian Thorgersen 81ab6aeeed Merge pull request #3667 from vmuzikar/nodejs-fixes
KEYCLOAK-4106 Enable Node.js UI Session test
2016-12-19 15:33:02 +01:00
Stian Thorgersen d1a528eb07 Merge pull request #3669 from vmuzikar/KEYCLOAK-3959
KEYCLOAK-3959 Fix User Federation Console UI Tests
2016-12-19 15:32:28 +01:00
Pedro Igor c9c9f05e29 [KEYCLOAK-4034] - Improvements to UI, performance and some code cleanup 2016-12-19 11:22:37 -02:00
Vaclav Muzikar 4e3e9ad5d4 KEYCLOAK-3959 Fix User Federation Console UI Tests 2016-12-19 13:37:31 +01:00
Stian Thorgersen 3bd3d0285d Merge branch 'duplicate-groups' of https://github.com/ssilvert/keycloak into ssilvert-duplicate-groups 2016-12-19 13:07:39 +01:00
Vaclav Muzikar 343e678f09 KEYCLOAK-4106 Enable Node.js UI Session test 2016-12-19 12:55:33 +01:00
Stian Thorgersen b8adfcad87 Merge pull request #3658 from hmlnarik/KEYCLOAK-4095--Not-Recently-Used-Password-Policy-with-value-set-to-1-doesn-t-work
KEYCLOAK-4095 Fix for expiring passwords
2016-12-19 12:15:26 +01:00
Stian Thorgersen ca3691e650 Merge pull request #3665 from stianst/KEYCLOAK-4092
KEYCLOAK-4092 key provider for HMAC signatures
2016-12-19 11:50:52 +01:00
Marko Strukelj ad11d6e76b KEYCLOAK-912 Admin CLI
- Fix relative URI resolution not working for https
2016-12-19 11:39:18 +01:00
Hynek Mlnarik 3e3216fb23 KEYCLOAK-4072 Add explicit check for key format 2016-12-19 11:01:45 +01:00
Slawomir Dabek 93cec9b3ee KEYCLOAK-4059 Support for duplicate emails 2016-12-19 10:55:12 +01:00
Stian Thorgersen 20c5c6b60c Merge pull request #3659 from abstractj/KEYCLOAK-4085
[KEYCLOAK-4083] and [KEYCLOAK-4085] SSSD federation provider should load libunix from alternative paths
2016-12-19 10:52:26 +01:00
Stian Thorgersen f29bb7d501 KEYCLOAK-4092 key provider for HMAC signatures 2016-12-19 10:50:43 +01:00
Marko Strukelj c3d9859c6e KEYCLOAK-912 Admin CLI 2016-12-19 01:05:03 +01:00
Bruno Oliveira 3b3b219a86 [KEYCLOAK-4085] SSSD federation provider should load libunix from alternative paths 2016-12-16 18:19:47 -02:00
Bruno Oliveira 3f2e9c3592 [KEYCLOAK-4083] SSSD Federation is only enabled with superuser permissions 2016-12-16 17:31:24 -02:00
Hynek Mlnarik 787a3f8fcc KEYCLOAK-4095 Fix for expiring passwords 2016-12-16 14:45:05 +01:00
Bill Burke a4cbf130b4 Merge pull request #3592 from sldab/default-hooks
KEYCLOAK-4074 Decoupling of default provider implementations
2016-12-16 08:42:55 -05:00
Bill Burke 1c0e23db66 Merge pull request #3647 from tkyjovsk/fix-module-names
fixed module names
2016-12-16 08:41:01 -05:00
Bill Burke f33a1e2143 Merge pull request #3650 from hmlnarik/KEYCLOAK-4079-OIDC-UserAttribute-protocol-mapper-always-adds-List-to-the-IDToken
KEYCLOAK-4079, KEYCLOAK-4080 Fix for single-valued claims
2016-12-16 08:40:26 -05:00
Bill Burke 63ca9b2fe8 Merge pull request #3653 from hmlnarik/KEYCLOAK-3971-set-encoding-explicitly
KEYCLOAK-3971 Explicitly set encoding for SAML message processing
2016-12-16 08:39:57 -05:00
Bill Burke 34f82fa1b1 KEYCLOAK-4072 2016-12-16 08:38:08 -05:00
Hynek Mlnarik 5453bec1bf KEYCLOAK-4079, KEYCLOAK-4080 Fix for single-valued claims 2016-12-16 10:00:36 +01:00
Marek Posolda e65dd4fbc3 Merge pull request #3655 from mposolda/master
KEYCLOAK-2397 LDAP_ENTRY_DN attribute in LDAP user storage is not upd…
2016-12-15 22:21:02 +01:00
Bill Burke 7b115b4b44 Merge pull request #3656 from patriot1burke/master
KEYCLOAK-4041
2016-12-15 16:07:55 -05:00
Bill Burke 4d64f0e160 KEYCLOAK-4041 2016-12-15 16:06:06 -05:00
mposolda 7453e96f5c KEYCLOAK-2397 LDAP_ENTRY_DN attribute in LDAP user storage is not updated on changes in LDAP 2016-12-15 21:12:29 +01:00
Stian Thorgersen 9be9d3f580 Merge pull request #3651 from stianst/KEYCLOAK-4081
KEYCLOAK-4081
2016-12-15 15:53:39 +01:00
Hynek Mlnarik 7d51df4eed KEYCLOAK-3971 Explicitly set encoding for SAML message processing 2016-12-15 14:04:34 +01:00
Michael Klein 74fd904bc4 KEYCLOAK-4088 Http wrapper of Angular 2 demo app doesn't forward http errors 2016-12-15 11:13:46 +01:00
Bill Burke 3c2a12d019 Merge pull request #3648 from patriot1burke/master
KEYCLOAK-3451
2016-12-14 15:46:24 -05:00
Bill Burke 56f9aa41d0 KEYCLOAK-3451 2016-12-14 15:04:53 -05:00
Tomas Kyjovsky e5d744f7d5 fixed module names 2016-12-14 17:02:07 +01:00
Stian Thorgersen 394676222f Merge pull request #3616 from sldab/fix-cors
KEYCLOAK-4047 WebOrigins not expanded in CORS handling of token endpoints
2016-12-14 15:13:49 +01:00
Pavel Drozd 5464655bc2 Merge pull request #3641 from tkyjovsk/KEYCLOAK-4060
KEYCLOAK-4060 Arquillian test deployments have redundant jboss module dependencies
2016-12-14 15:10:17 +01:00
Pavel Drozd 768c3eb9a7 Merge pull request #3636 from vramik/KEYCLOAK-3042
KEYCLOAK-3042 added missing test
2016-12-14 15:09:34 +01:00
Stian Thorgersen e316037910 KEYCLOAK-4081 2016-12-14 11:22:10 +01:00
Stian Thorgersen 97a08a1d99 Merge pull request #3644 from stianst/KEYCLOAK-4071
KEYCLOAK-4071
2016-12-14 09:55:55 +01:00
Stian Thorgersen db4420e10d Merge pull request #3640 from hmlnarik/KEYCLOAK-4040-Unable-to-import-SAML-metadata-with-OrganizationUrl
KEYCLOAK-4040 Support a letter-case variant of md:OrganizationURL
2016-12-14 08:25:45 +01:00
Stian Thorgersen 480d4e6f4f KEYCLOAK-4071 2016-12-14 07:01:54 +01:00
Marek Posolda 0b701b3cf9 Merge pull request #3642 from mposolda/master
KEYCLOAK-3921 LDAP binary attributes
2016-12-13 21:11:41 +01:00
mposolda 40216b5e7d KEYCLOAK-3921 LDAP binary attributes 2016-12-13 18:31:26 +01:00
Tomas Kyjovsky b1fe07ac3d KEYCLOAK-4060 removed redundant jboss module dependencies from test deployments 2016-12-13 16:21:45 +01:00
Hynek Mlnarik 642de06fb5 KEYCLOAK-4040 Support a letter-case variant of md:OrganizationURL 2016-12-13 16:07:11 +01:00
Slawomir Dabek 7ad028fcb1 KEYCLOAK-4074 Added hooks to default implementations of direct grant authenticators
and email sender.
2016-12-13 15:32:39 +01:00
Pavel Drozd 76385157fc Merge pull request #3634 from tkyjovsk/KEYCLOAK-4061
KEYCLOAK-4061 Testsuite URLProvider not working right on remote EAP6/AS7 app server
2016-12-13 14:05:05 +01:00
Stian Thorgersen c11f65720b Merge pull request #3639 from hmlnarik/KEYCLOAK-4062-Provide-GUI-for-KeyName-format-in-identity-broker-and-client
KEYCLOAK-4062 - GUI changes for KeyName format + few tests
2016-12-13 11:33:16 +01:00
Hynek Mlnarik 5006fe2292 KEYCLOAK-4062 - GUI changes for KeyName format + few tests 2016-12-12 22:29:01 +01:00
Bill Burke 90fdb4889c Merge pull request #3638 from patriot1burke/master
restore adapter tests in travis
2016-12-12 11:37:28 -05:00
Bill Burke c17a57d76c restore adapter tests in travis 2016-12-12 10:36:33 -05:00
Marek Posolda efcb749771 Merge pull request #3637 from mposolda/master
KEYCLOAK-2545 KEYCLOAK-3668 KEYCLOAK-3247 LDAP escaping
2016-12-12 14:09:32 +01:00
mposolda 8c99a13387 Minor synchronize update 2016-12-12 13:09:19 +01:00
mposolda 79c1650c15 KEYCLOAK-2545 KEYCLOAK-3668 KEYCLOAK-3247 LDAP escaping 2016-12-12 13:09:14 +01:00
Vlasta Ramik 63ddabe5fb KEYCLOAK-3042 added missing test 2016-12-12 10:47:40 +01:00
Bill Burke 5448403345 Merge pull request #3635 from patriot1burke/master
KEYCLOAK-3506
2016-12-10 19:15:27 -05:00
Bill Burke 5996149a8d KEYCLOAK-3506 2016-12-10 17:01:08 -05:00
Bill Burke 62029e8a33 KEYCLOAK-3506 2016-12-10 11:59:29 -05:00
Pedro Igor 588e1711dd Merge pull request #3597 from jlpettersson/KEYCLOAK-4018
KEYCLOAK-4018 Client-Based Policy
2016-12-09 17:32:19 -02:00
Jonas Pettersson 35c4a379ad KEYCLOAK-4018 Use clientId and not the client name 2016-12-09 19:33:27 +01:00
Tomas Kyjovsky cf62715499 KEYCLOAK-4061 fixed testsuite URLProvider for AS7/EAP6 app server (managed and remote mode) 2016-12-09 17:41:07 +01:00
Bill Burke 1bfdff0e25 Merge pull request #3614 from vramik/KEYCLOAK-4031
KEYCLOAK-4031 fix testBasicMappingMultipleValues
2016-12-09 09:10:03 -05:00
Bill Burke ba14b9d942 Merge pull request #3626 from mhajas/KEYCLOAK-4044
KEYCLOAK-4044 Fix failing adapter tests
2016-12-09 09:09:41 -05:00
Bill Burke 10fc7302eb Merge pull request #3632 from hmlnarik/KEYCLOAK-4057-MS-AD-FS-does-not-recognize-certificate-for-POST-signed-AuthnRequest-for-brokering
KEYCLOAK-4057 Do not include KeyName for brokered IdPs
2016-12-09 09:09:13 -05:00
Bill Burke 3bea8f4adb Merge pull request #3631 from patriot1burke/master
KEYCLOAK-3967
2016-12-09 09:07:56 -05:00
Hynek Mlnarik 24a36e6848 KEYCLOAK-4057 Do not include KeyName for brokered IdPs
Active Directory Federation Services require that the subject name
matches KeyName element when present. While KeyName is beneficial for
Keycloak adapters, it breaks functionality for AD FS as the name
included there is a key ID, not certificate subject expected by AD FS.

This patch contains functionality that excludes KeyName from SAML
messages to identity providers. This behaviour should be made
configurable per client/identity provider and is prepared to do so,
however actual GUI changes are left for a separate patch.
2016-12-09 14:33:40 +01:00
Jonas Pettersson 5d070cbf22 KEYCLOAK-4018 Added test for Client-Based Policy 2016-12-09 14:23:33 +01:00
Jonas Pettersson 5e660977aa KEYCLOAK-4018 Use kc.client.id instead of clientId 2016-12-09 14:22:06 +01:00
Bill Burke 1f0600044a KEYCLOAK-3967 2016-12-08 19:29:02 -05:00
Bill Burke d3e3990d77 Merge pull request #3629 from patriot1burke/master
KEYCLOAK-2806
2016-12-08 17:36:28 -05:00
Bill Burke 4a80f1e913 Merge remote-tracking branch 'upstream/master' 2016-12-08 17:05:46 -05:00
Bill Burke 0550bdb467 KEYCLOAK-3214 2016-12-08 16:47:17 -05:00
Bill Burke 5f07fa8057 KEYCLOAK-2806 2016-12-08 16:28:22 -05:00
Marek Posolda 10064fdac9 Merge pull request #3628 from mposolda/master
KEYCLOAK-4058 Improve LDAPStorageMapper and remove LDAPStorageMapperB…
2016-12-08 19:36:25 +01:00
mposolda e7f6c780e2 KEYCLOAK-4058 Improve LDAPStorageMapper and remove LDAPStorageMapperBridge 2016-12-08 18:35:56 +01:00
Marek Posolda e03b72df00 Merge pull request #3627 from mposolda/master
KEYCLOAK-4049 Admin Console: User Federation: Client ids not listed i…
2016-12-08 15:02:32 +01:00
mposolda 7d8b392fd9 KEYCLOAK-4049 Admin Console: User Federation: Client ids not listed in role-ldap-mapper 2016-12-08 13:46:19 +01:00
Marek Posolda afa8dc735d Merge pull request #3625 from mhajas/KEYCLOAK-3339
KEYCLOAK-3339 Fix authorization tests on EAP6 + JDK7
2016-12-08 11:42:11 +01:00
Marek Posolda d49a74b927 Merge pull request #3624 from mhajas/KEYCLOAK-4051
KEYCLOAK-4051 Use debug instead of debugf
2016-12-08 11:40:27 +01:00
mhajas ae36b3c832 KEYCLOAK-4044 Fix failing adapter tests 2016-12-08 09:52:20 +01:00
mhajas e0c62e25b2 KEYCLOAK-3339 Fix authorization tests on EAP6 + JDK7 2016-12-08 09:50:14 +01:00
mhajas 081958e282 KEYCLOAK-4051 Use debug instead of debugf 2016-12-08 09:42:52 +01:00
Bill Burke 379d5e3228 Merge pull request #3623 from patriot1burke/master
KEYCLOAK-3973
2016-12-07 17:00:52 -05:00
Bill Burke 9b18601102 KEYCLOAK-3973 2016-12-07 16:10:33 -05:00
Stan Silvert 7868152ffe Merge pull request #3622 from vramik/KEYCLOAK-4022
KEYCLOAK-4022 added missing test
2016-12-07 14:10:13 -05:00
Bill Burke 223cc1fb50 KEYCLOAK-3973 2016-12-07 12:56:03 -05:00
Vlasta Ramik 6ae9d19843 KEYCLOAK-4022 added missing test 2016-12-07 16:22:08 +01:00
Bill Burke cbe4ff324c Merge pull request #3621 from patriot1burke/master
fix adapter test
2016-12-07 10:00:00 -05:00
Bill Burke b8c06dd560 fix adapter test 2016-12-07 09:50:17 -05:00
Bill Burke 31d2cde6e5 Merge pull request #3615 from abstractj/KEYCLOAK-3560
[KEYCLOAK-3560]: Unable to import exported users which contain terms_and_conditions required action
2016-12-06 22:07:58 -05:00
Bill Burke 75e2b404c8 Merge pull request #3618 from abstractj/KEYCLOAK-3685
[KEYCLOAK-3685]: Username not updated when "Email as username" is enabled
2016-12-06 22:06:55 -05:00
Bill Burke d163dad3fe Merge pull request #3620 from patriot1burke/master
KEYCLOAK-3509
2016-12-06 20:08:36 -05:00
Bill Burke 7271fdaaaa KEYCLOAK-3509 2016-12-06 18:52:37 -05:00
Bill Burke 03fbb3c853 Merge pull request #3619 from patriot1burke/master
KEYCLOAK-2705
2016-12-06 18:46:59 -05:00
Bill Burke 68c8bfa0e1 KEYCLOAK-2705 2016-12-06 17:32:41 -05:00
Bill Burke f34b47d29c Merge pull request #3617 from patriot1burke/master
KEYCLOAK-2654
2016-12-06 17:06:10 -05:00
Bill Burke a0b54ebedc KEYCLOAK-2654 2016-12-06 17:05:34 -05:00
Bruno Oliveira ddb201db6c [KEYCLOAK-3685]: Username not updated when "Email as username" is enabled 2016-12-06 19:46:31 -02:00
Slawomir Dabek 4069be3ff6 KEYCLOAK-4047 Expand + to valid WebOrigins in Cors class 2016-12-06 20:22:35 +01:00
Bruno Oliveira 15f23eb045 [KEYCLOAK-3560]: Unable to import exported users which contain terms_and_conditions required action 2016-12-06 15:29:56 -02:00
Bill Burke 77d17de14d Merge pull request #3611 from patriot1burke/master
KEYCLOAK-3620
2016-12-06 08:18:36 -05:00
Bill Burke bab08bf8f0 Merge remote-tracking branch 'upstream/master' 2016-12-06 08:18:05 -05:00
Vlasta Ramik 0d110ceb30 KEYCLOAK-4031 fix testBasicMappingMultipleValues 2016-12-06 14:11:24 +01:00
Marek Posolda 9cd3034762 Merge pull request #3613 from mposolda/master
KEYCLOAK-4042 Better error message when failed updating MSAD password…
2016-12-06 11:50:33 +01:00
mposolda ba51640c61 KEYCLOAK-4042 Better error message when failed updating MSAD password in account mgmt 2016-12-06 11:07:28 +01:00
Marek Posolda 287593d75f Merge pull request #3612 from hmlnarik/KEYCLOAK-3655-Unexpected-server-error-when-adding-duplicate-auth-flow
KEYCLOAK-3655 Tests for adding duplicate auth flow
2016-12-06 10:27:15 +01:00
Marek Posolda 3826e933c1 Merge pull request #3609 from hmlnarik/KEYCLOAK-3439-database-encoding
KEYCLOAK-4026 - Workaround for liquibase error in MySQL/MariaDB
2016-12-06 10:25:08 +01:00
Marek Posolda 6b1020ec34 Merge pull request #3602 from sldab/fix-model-duplicate-exception
KEYCLOAK-4028 Fix ModelDuplicateException when logging in with updated email address
2016-12-06 10:21:55 +01:00
Marek Posolda c8b22e71f0 Merge pull request #3573 from glavoie/KEYCLOAK-4003
KEYCLOAK-4003: Slow Infinispan RoleAdapter.hasRole() call.
2016-12-06 09:49:42 +01:00
Hynek Mlnarik 41a5598103 KEYCLOAK-3655 Tests for adding duplicate auth flow 2016-12-06 08:52:38 +01:00
Bill Burke fc92639d3f KEYCLOAK-3620 2016-12-05 17:52:00 -05:00
Bill Burke 6587cd2478 KEYCLOAK-3620 2016-12-05 17:51:06 -05:00
Stan Silvert e55c2ae554 Merge pull request #3610 from ssilvert/disable-confidential-tab
KEYCLOAK-4039: Unexpected behavior when switching client access type.
2016-12-05 15:30:39 -05:00
Bill Burke 693d6c0e5d Merge pull request #3608 from hmlnarik/KEYCLOAK-4035
KEYCLOAK-4035 Composite roles need to be expanded in SAML attribute mapper
2016-12-05 14:44:21 -05:00
Bill Burke 952c1decf0 Merge pull request #3607 from patriot1burke/master
KEYCLOAK-4033
2016-12-05 14:44:07 -05:00
Stan Silvert f3dbacabf8 KEYCLOAK-4039: Unexpected behavior when switching client access type. 2016-12-05 14:16:24 -05:00
Hynek Mlnarik 819105c3aa KEYCLOAK-4026 - Workaround for liquibase error in MySQL/MariaDB 2016-12-05 16:48:52 +01:00
Bill Burke 06affc0700 Merge pull request #3595 from dehort/KEYCLOAK-4020
Modified the saml parser to handle boolean attribute value types
2016-12-05 10:19:30 -05:00
Bill Burke f03d79c7d3 Merge pull request #3603 from thomasdarimont/issue/KEYCLOAK-3969-Allow-authentication-via-ScriptAuthenticator-without-user
KEYCLOAK-3969 Allow use of ScriptAuthenticator without user
2016-12-05 10:19:02 -05:00
Bill Burke b52936bc5b Merge pull request #3604 from hmlnarik/KEYCLOAK-3950-NPE-when-request-includes-NameIDPolicy-but-format-is-missing
KEYCLOAK-3950 Fix NPE on request for NameIDPolicy without format
2016-12-05 10:17:04 -05:00
Hynek Mlnarik 3c4114091f KEYCLOAK-4035 Composite roles need to be expanded in SAML attribute mapper 2016-12-05 16:16:08 +01:00
Bill Burke d354aa1f62 KEYCLOAK-4033 2016-12-05 10:15:55 -05:00
Slawomir Dabek 45fd114143 KEYCLOAK-4028 Fix ModelDuplicateException when logging in with updated email address 2016-12-05 15:44:22 +01:00
Marek Posolda 32da5fea0a Merge pull request #3572 from glavoie/KEYCLOAK-4002
KEYCLOAK-4002: realmRevisions cache too small with high number of realms
2016-12-05 15:26:10 +01:00
Gabriel Lavoie 32c23c2410 KEYCLOAK-4002: realmRevisions cache too small with high number of realms.
- Increased the hardcoded default value to help running master with high number of realms.
- Added a value computation based on the realms cache max size (to match the userRevisions cache configuration pattern).
- Computed revisions cache size is now 2 times the configured maximum cache size.
- Added a maximum realms cache size configuration to the different standalone.xml templates.
- Added a missing users cache size configuration to standalone.xsl.
2016-12-05 08:07:24 -05:00
Marek Posolda 802085f158 Merge pull request #3606 from vramik/KEYCLOAK-4027
KEYCLOAK-4027 Make AbstractTests really abstract in testsuite
2016-12-05 12:45:47 +01:00
Vlasta Ramik 773c88cc04 KEYCLOAK-4027 Make AbstractTests really abstract in testsuite 2016-12-05 12:03:05 +01:00
Hynek Mlnarik 197f51e50f KEYCLOAK-3950 Fix NPE on request for NameIDPolicy without format
... and two more one-line issues
2016-12-05 07:24:38 +01:00
l-robinson 1c66ce7dd7 Additional test case added to check the text in the 'Back to application' link 2016-12-05 12:13:30 +10:30
Thomas Darimont 8610a02d72 KEYCLOAK-3969 Allow use of ScriptAuthenticator without user
Previously ScriptAuthenticator required a user to be authenticated
before it could be used as an additional authentication step which
limited the scenarios the authenticator could be used.

We now allow ScriptAuthenticators to be used without requiring an
user to be authenticated before.
Adapted the authenticator-template.js with a null safe username check.

Note that existing custom ScriptAuthenticators might need some additional
null checks since the user can now be undefined.
2016-12-04 23:15:53 +01:00
Bill Burke d7df86d6d0 Merge pull request #3526 from mhajas/KEYCLOAK-3017
KEYCLOAK-3017 Location header not present in responses from admin endpoints test
2016-12-03 13:47:15 -05:00
Bill Burke e3d0f8f6e5 Merge pull request #3548 from sebastienblanc/KEYCLOAK-3725
KEYCLOAK-3725: return Unauthorized when accessing bearer only in inte…
2016-12-03 13:46:52 -05:00
Bill Burke e8f2527fcd Merge pull request #3555 from vramik/KEYCLOAK-3977
KEYCLOAK-3977 fix logicalFilePath for jpa-changelog-1.0.0.Final-db2.xml
2016-12-03 13:44:54 -05:00
Bill Burke 305dcb2b1e Merge pull request #3552 from hmlnarik/KEYCLOAK-3439-database-encoding
KEYCLOAK-3439, KEYCLOAK-3893, KEYCLOAK-3894 - Support for Unicode
2016-12-03 13:44:10 -05:00
Bill Burke 0ab352706b Merge pull request #3554 from hassaneinaltememyictu/2.3.0-ictu-change-role-attributeToRoleMapper
grant the new role from the saml token if it exist
2016-12-03 13:43:40 -05:00
Bill Burke eac0bb4b37 Merge pull request #3574 from tkyjovsk/remote-adapter-tests
Added remote jboss adapter tests.
2016-12-03 13:38:07 -05:00
Bill Burke 3bc721720f Merge pull request #3580 from abstractj/KEYCLOAK-3970
[KEYCLOAK-3970] - SSSD testsuite is broken
2016-12-03 13:37:48 -05:00
Bill Burke 54758b800b Merge pull request #3585 from abstractj/KEYCLOAK-4011
[KEYCLOAK-4011] - Integrity constraint error when try to delete SSSD Federation Provider
2016-12-03 13:37:36 -05:00
Bill Burke 6cd6edce64 Merge pull request #3588 from abstractj/KEYCLOAK-3847
[KEYCLOAK-2568]
2016-12-03 13:37:06 -05:00
Bill Burke 69a1d4d192 Merge pull request #3587 from tkyjovsk/KEYCLOAK-4017
KEYCLOAK-4017 Adapter tests are broken because of removed AbstractKerberosStandaloneAdapterTest class
2016-12-03 13:35:51 -05:00
Bill Burke 5d4864b82d Merge pull request #3590 from tkyjovsk/performance-tests
fixed version of integration-arquillian-tests-adapters-remote module
2016-12-03 13:35:28 -05:00
Bill Burke 3840aed5f7 Merge pull request #3594 from hmlnarik/KEYCLOAK-3971-SAML-Authentication-signature-verification-exception-when-user-name-contains-european-special-characters
KEYCLOAK-3971 Tests for Unicode (ext Latin) usernames in SAML
2016-12-03 13:35:11 -05:00
Bill Burke 6a629aec0c Merge pull request #3601 from patriot1burke/master
component query and remove provider alis fix
2016-12-03 13:33:41 -05:00
Bill Burke 8b4bb72fb3 enhance user storage jpa example 2016-12-03 13:33:16 -05:00
Bill Burke 88d08c4f38 component query and remove provider alis fix 2016-12-03 11:34:48 -05:00
Bill Burke e3f5df3894 Merge pull request #3600 from patriot1burke/master
KEYCLOAK-3986
2016-12-03 10:14:59 -05:00
Bill Burke cfbd7d469f Merge remote-tracking branch 'upstream/master' 2016-12-03 09:33:58 -05:00
Bill Burke 8fd7091068 KEYCLOAK-3986 2016-12-03 09:33:52 -05:00
Stan Silvert 9c97245c46 Merge pull request #3598 from ssilvert/client-service-account-roles-tab
KEYCLOAK-4022: Server error when click Service Account Roles
2016-12-03 07:00:54 -05:00
Bill Burke 257aba4331 Merge pull request #3599 from patriot1burke/master
User Storage SPI Javadocs and examples
2016-12-02 21:20:45 -05:00
Bill Burke 672e1b3575 oops 2016-12-02 20:14:01 -05:00
Bill Burke ce50b0ed29 Merge remote-tracking branch 'upstream/master' 2016-12-02 19:26:34 -05:00
Bill Burke e88af874ca finish 2016-12-02 19:25:17 -05:00
Stan Silvert aed54439c2 KEYCLOAK-4022: Remove unneeded line of code. 2016-12-02 18:31:44 -05:00
Stan Silvert c8c6e36fd9 KEYCLOAK-4022: Server error when click Service Account Roles 2016-12-02 18:17:15 -05:00
Marek Posolda e6ace84101 Merge pull request #3596 from mposolda/master
KEYCLOAK-4021 Travis didn't run all tests
2016-12-02 22:59:58 +01:00
mposolda 815b5e5f34 KEYCLOAK-4021 Travis didn't run all tests 2016-12-02 21:56:40 +01:00
Derek Horton c149358028 Modified the saml parser to handle boolean attribute value types
[KEYCLOAK-4020]
2016-12-02 14:50:36 -06:00
Marek Posolda b1265f6d70 Merge pull request #3593 from mposolda/master
KEYCLOAK-3340 Service Account user not renamed when renaming client-id
2016-12-02 21:34:28 +01:00
Hynek Mlnarik a09e78873e KEYCLOAK-3971 Tests for Unicode (ext Latin) usernames in SAML 2016-12-02 21:19:32 +01:00
mposolda 17d8394ab6 KEYCLOAK-3340 Service Account user not renamed when renaming client-id 2016-12-02 18:13:29 +01:00
Marek Posolda e6a20aa44b Merge pull request #3589 from mposolda/master
KEYCLOAK-3701 NullPointerException when trying to get access token fr…
2016-12-02 17:53:21 +01:00
Marek Posolda 458ca8a7ee Merge pull request #3578 from sldab/msadlds
KEYCLOAK-4009 Compatibility with AD LDS
2016-12-02 17:50:21 +01:00
Jonas Pettersson b56e23eded KEYCLOAK-4018 Client-Based Policy 2016-12-02 16:48:47 +01:00
Tomas Kyjovsky d02c9c2150 fixed version of integration-arquillian-tests-adapters-remote module 2016-12-02 16:39:59 +01:00
mposolda cccb532a21 KEYCLOAK-3701 NullPointerException when trying to get access token from offline token 2016-12-02 16:35:21 +01:00
Bruno Oliveira 5c2bf7c822 [KEYCLOAK-2568] 2016-12-02 13:14:05 -02:00
Tomas Kyjovsky e8758a77fb Removed classes extending a non-existent AbstractKerberosStandaloneAdapterTest. 2016-12-02 15:01:31 +01:00
Slawomir Dabek b2f0acfe26 KEYCLOAK-4009 Compatibility with AD LDS 2016-12-02 14:43:42 +01:00
Stian Thorgersen 8842d88058 Merge pull request #3562 from ssilvert/overwrite-client-role-fails
KEYCLOAK-3042: NPE when trying to overwrite client role
2016-12-02 14:06:27 +01:00
Stian Thorgersen 739178d840 Merge pull request #3583 from stianst/KEYCLOAK-3733
KEYCLOAK-3733 Added tests for max results in paginated endpoints
2016-12-02 14:02:35 +01:00
Stian Thorgersen 2454b3b644 Merge pull request #3586 from danren/KEYCLOAK-3961
Fix for KEYCLOAK-3961
2016-12-02 13:52:01 +01:00
danren 87b243ed59 Fix for KEYCLOAK-3961 2016-12-02 13:30:53 +01:00
Stian Thorgersen cec6f5db14 Merge pull request #3584 from stianst/KEYCLOAK-4014
KEYCLOAK-4014 Add source for all js libs
2016-12-02 11:20:04 +01:00
Bruno Oliveira e7dd49b453 [KEYCLOAK-4011] - Integrity constraint error when try to delete SSSD Federation Provider 2016-12-02 06:52:29 -02:00
Stian Thorgersen 6fdc470b0b KEYCLOAK-4014 Add source for all js libs 2016-12-02 08:58:38 +01:00
Stian Thorgersen 695aa7bec9 KEYCLOAK-3733 Added tests for max results in paginated endpoints 2016-12-02 08:25:46 +01:00
Stian Thorgersen 3952dba094 Merge pull request #3582 from stianst/KEYCLOAK-3835
KEYCLOAK-3835 Remove redirect on flow and return not modified if page…
2016-12-02 08:24:12 +01:00
Stian Thorgersen 209f8155d1 KEYCLOAK-3835 Remove redirect on flow and return not modified if page is refreshed 2016-12-02 06:29:59 +01:00
Stian Thorgersen 8621733e17 Merge pull request #3292 from manuel-palacio/master
KEYCLOAK-3648: Support for handling multi-value attributes in SAML attribute mapper/importer
2016-12-02 06:11:29 +01:00
Stan Silvert 621301862c Merge pull request #3581 from ssilvert/bradcrumbs-idps
KEYCLOAK-4012: Missing idp name from breadcrumb navigation
2016-12-01 20:53:18 -05:00
Stan Silvert fd4c5a90ed KEYCLOAK-4012: Missing idp name from breadcrumb navigation 2016-12-01 20:18:43 -05:00
Manuel Palacio bfec073457 KEYCLOAK-3648 2016-12-01 19:34:33 +01:00
Bruno Oliveira dc6e869c64 [KEYCLOAK-3970] - SSSD testsuite is broken 2016-12-01 15:40:53 -02:00
Marek Posolda bed592460d Merge pull request #3579 from mposolda/master
KEYCLOAK-3824 Ensure sending notBefore invalidates JWKPublicKeyLocator
2016-12-01 17:45:55 +01:00
Hynek Mlnarik 46d3555798 KEYCLOAK-3439, KEYCLOAK-3893, KEYCLOAK-3894 - Support for Unicode
Treatment of Unicode characters varies among databases. This change
adds support for Unicode characters in the following fields:

* Realms: display name, HTML display name
* Users: username, given name, last name, attribute values
* Groups: name, attribute values
* Components: attribute values
* Roles: name
* Descriptions of objects

Unicode support for the rest of the fields depends on database vendor
and is described in the installation guide in more detail.
2016-12-01 17:23:58 +01:00
mposolda 74967737ee KEYCLOAK-3824 Ensure sending notBefore invalidates JWKPublicKeyLocator 2016-12-01 17:07:50 +01:00
mhajas a347cb591d KEYCLOAK-3017 Location header not present in responses from admin endpoints 2016-12-01 15:33:53 +01:00
Marek Posolda 1ae60ef8a7 Merge pull request #3577 from mposolda/master
KEYCLOAK-3823 KEYCLOAK-3824 Added public-key-cache-ttl for OIDC adapt…
2016-12-01 13:28:05 +01:00
Stian Thorgersen f9db687385 Merge pull request #3576 from stianst/KEYCLOAK-4006
KEYCLOAK-4006 Fix performance drop caused by changes to client sessio…
2016-12-01 12:44:45 +01:00
mposolda a38544796f KEYCLOAK-3823 KEYCLOAK-3824 Added public-key-cache-ttl for OIDC adapters. Invalidate cache when notBefore sent 2016-12-01 12:25:07 +01:00
Stian Thorgersen 5ecc8d1c71 KEYCLOAK-4006 Fix performance drop caused by changes to client session codes 2016-12-01 12:17:54 +01:00
Stian Thorgersen c9cf7f6564 Merge pull request #3549 from RamonGebben/patch-1
KEYCLOAK-3993: Removed compare bug in `checkState` function
2016-12-01 07:57:29 +01:00
Stian Thorgersen ba406d5747 Merge pull request #3332 from ebondu/master
fix bug https://issues.jboss.org/browse/KEYCLOAK-3474
2016-12-01 07:51:07 +01:00
l-robinson c72ceadfce KEYCLOAK-4004 Pass the client name in the ReferrerBean instead of the referrer parameter 2016-12-01 17:17:57 +10:30
Stian Thorgersen 1e7f1b1e54 Merge pull request #3570 from stianst/master
Bump to 2.5.0.Final-SNAPSHOT
2016-12-01 06:36:37 +01:00
Stian Thorgersen 7c0f6f6e6e Merge pull request #3571 from stianst/KEYCLOAK-3889
KEYCLOAK-3889 Add produces to server info endpoint
2016-12-01 06:36:12 +01:00
Tomas Kyjovsky 3f32cb154b Added remote jboss adapter tests. 2016-11-30 19:58:54 +01:00
Gabriel Lavoie 6fa504489f KEYCLOAK-4003: Slow Infinispan RoleAdapter.hasRole() call.
- Added a session/query cache for the result getComposites() to avoid always hitting the Infinispan cache.
- KeycloakModelUtils doesn't rely anymore on a "visited" set as performance seems good without it.
- Added test for multiple levels of composite roles. Only one level was covered.
2016-11-30 10:56:26 -05:00
Stian Thorgersen 433f373f60 KEYCLOAK-3889 Add produces to server info endpoint 2016-11-30 15:46:01 +01:00
Stian Thorgersen b771b84f56 Bump to 2.5.0.Final-SNAPSHOT 2016-11-30 15:44:51 +01:00
Marek Posolda 45abaec86e Merge pull request #3569 from mposolda/master
KEYCLOAK-3831 Improve AddressMapper configurability. Support for 'for…
2016-11-30 13:44:18 +01:00
mposolda d0a96d463d KEYCLOAK-3831 Improve AddressMapper configurability. Support for 'formatted' subclaim 2016-11-30 13:04:45 +01:00
Marek Posolda 12f1aedcd1 Merge pull request #3568 from mposolda/master
KEYCLOAK-3998 JS error in admin console when creating broker mapper
2016-11-30 10:58:33 +01:00
mposolda f0874bf585 KEYCLOAK-3998 JS error in admin console when creating broker mapper 2016-11-30 09:29:42 +01:00
Marek Posolda 1a749dc7b7 Merge pull request #3567 from mposolda/master
KEYCLOAK-3997 InfinispanKeyStorageProviderTest was failing
2016-11-30 09:28:19 +01:00
mposolda ec49d10007 KEYCLOAK-3997 InfinispanKeyStorageProviderTest was failing 2016-11-30 08:38:35 +01:00
Bill Burke 294dc6fbd0 Merge pull request #3566 from patriot1burke/master
UserBulkUpdateProvider interface
2016-11-29 20:18:07 -05:00
Bill Burke 9e50a45b4c UserBulkUpdateProvider interface 2016-11-29 18:43:22 -05:00
Bill Burke 72ffb9dbb9 Merge pull request #3564 from patriot1burke/master
KEYCLOAK-3903 KEYCLOAK-3960
2016-11-29 18:05:11 -05:00
Bill Burke a677ab64e3 Merge remote-tracking branch 'upstream/master' 2016-11-29 16:43:24 -05:00
Bill Burke b33afcd47c KEYCLOAK-3903 KEYCLOAK-3960 2016-11-29 16:43:06 -05:00
Marek Posolda 659892edcb Merge pull request #3563 from mposolda/undertow-adapter-tests
KEYCLOAK-3124 Possibility test adapter on embedded undertow
2016-11-29 22:41:48 +01:00
mposolda 803fde6c1d KEYCLOAK-3124 Possibility test adapter on embedded undertow 2016-11-29 22:08:23 +01:00
Stan Silvert 83063a5740 KEYCLOAK-3042: NPE when trying to overwrite client role 2016-11-29 15:43:48 -05:00
Bill Burke 7efa3a3ddf Merge remote-tracking branch 'upstream/master' 2016-11-29 11:34:04 -05:00
Pavel Drozd c1d93e251d Merge pull request #3542 from mhajas/KEYCLOAK-1881
KEYCLOAK-1881 Fix SAML Filter key rotation tests
2016-11-29 16:40:59 +01:00
Pavel Drozd 8f3256675a Merge pull request #3534 from tkyjovsk/KEYCLOAK-3683
KEYCLOAK-3683 Updated OIDC adapter test for secure-deployments
2016-11-29 16:40:24 +01:00
Pavel Drozd 9711ac2ecb Merge pull request #3523 from vmuzikar/KEYCLOAK-3872-2
KEYCLOAK-3872 Stabilize PasswordPolicy UI test
2016-11-29 16:38:39 +01:00
Pavel Drozd 833c56e17b Merge pull request #3508 from mhajas/KEYCLOAK-3653
KEYCLOAK-3653 Tests for cert endpoint
2016-11-29 16:37:44 +01:00
Pavel Drozd 9bb59c0f94 Merge pull request #3496 from tkyjovsk/performance-tests
Updated performance tests. Added app-profile-jee test application from qs.
2016-11-29 16:37:17 +01:00
Pavel Drozd 629ec6383e Merge pull request #3492 from pdrozd/KEYCLOAK-3892
KEYCLOAK-3892 - Fix profile page assertion.
2016-11-29 16:35:42 +01:00
Stian Thorgersen a6b6ecf4ba Merge pull request #3560 from ssilvert/scheduled-task-interval
KEYCLOAK-3920: Configured scheduled-task-interval doesn't work.
2016-11-29 10:51:00 +01:00
Ramon Gebben e5ce080fd3 Update with PR feedback 2016-11-29 09:49:58 +01:00
Marek Posolda 80c4b2aa31 Merge pull request #3556 from mposolda/master
KEYCLOAK-3822 Changing signature validation settings of an external I…
2016-11-28 22:37:44 +01:00
Stan Silvert 0b8f9edb9e KEYCLOAK-3920: Configured scheduled-task-interval doesn't work. 2016-11-28 14:10:55 -05:00
Bill Burke 63458a7de7 Merge pull request #3559 from patriot1burke/master
KEYCLOAK-3980
2016-11-28 13:36:52 -05:00
Bill Burke f6a080729a javadoc 2016-11-28 12:25:54 -05:00
Bill Burke 1dacddb7e3 KEYCLOAK-3980 2016-11-28 12:20:40 -05:00
Bill Burke 334aa37b7f Merge pull request #3553 from hmlnarik/KEYCLOAK-3731-alternative
KEYCLOAK-3731 Provide functionality for IdP-initiated SSO for broker
2016-11-28 11:23:26 -05:00
Stan Silvert 725f42e185 Merge pull request #3533 from ssilvert/federation-blank-slate-showing
KEYCLOAK-3949: User Federation "welcome" screen is always shown for a
2016-11-28 11:06:59 -05:00
mposolda 69ce1e05f0 KEYCLOAK-3822 Changing signature validation settings of an external IdP is not sometimes reflected 2016-11-28 15:27:25 +01:00
Vlasta Ramik 8d3136188d KEYCLOAK-3977 fix logicalFilePath for jpa-changelog-1.0.0.Final-db2.xml 2016-11-28 14:52:09 +01:00
Stian Thorgersen cb4f856ab6 Merge pull request #3535 from wadahiro/update-japanese-translation
KEYCLOAK-3957 Update Japanese translation
2016-11-28 14:50:01 +01:00
Hynek Mlnarik 65b269cd54 KEYCLOAK-3731 Provide functionality for IdP-initiated SSO for broker
A SAML brokered IdP can send unsolicited login response to the broker.
This commit adds a new GET/POST endpoint under [broker SAML
endpoint]/clients/{client_id}. Broken will respond to  submission to
this new endpoint by looking up a SAML client with URL name equal to
client_id, and if found, it performs IdP-initiated SSO to that client.
2016-11-28 13:54:04 +01:00
sebastienblanc df93244373 keep orignal API 2016-11-26 09:30:27 +01:00
Marek Posolda a8de125e26 Merge pull request #3551 from vramik/KEYCLOAK-3983
KEYCLOAK-3983 update protocol mappers of clients and client templates for backward compatibility import
2016-11-25 21:48:41 +01:00
Marek Posolda 7db06b8afb Merge pull request #3550 from mposolda/master
KEYCLOAK-3825 Ability to expire publicKeys cache. Migrated OIDCBroker…
2016-11-25 20:23:57 +01:00
mposolda 7c6032cc84 KEYCLOAK-3825 Ability to expire publicKeys cache. Migrated OIDCBrokerWithSignatureTest to new testsuite 2016-11-25 17:45:37 +01:00
Vlasta Ramik 939da455d7 update protocol mappers of clients and client templates for backward compatibility import 2016-11-25 15:12:38 +01:00
Marek Posolda 817dbce391 Merge pull request #3547 from mposolda/master
KEYCLOAK-3982 keycloak-jboss-adapter-core module.xml unsynced among W…
2016-11-25 13:18:24 +01:00
sebastienblanc 0f447fadd4 KEYCLOAK-3725: return Unauthorized when accessing bearer only in interactive mode 2016-11-25 11:59:52 +01:00
Ramon Gebben 79825dfa1d Removed compare bug in checkState function 2016-11-25 11:45:40 +01:00
mposolda b640e9fe39 KEYCLOAK-3982 keycloak-jboss-adapter-core module.xml unsynced among Wildfly OIDC and SAML adapter ZIPs 2016-11-25 11:04:24 +01:00
Marek Posolda 9dd4cbb40e Merge pull request #3546 from mposolda/master
KEYCLOAK-3956 Update fuse documentation
2016-11-24 16:48:56 +01:00
mposolda 82423db239 KEYCLOAK-3956 Update fuse documentation 2016-11-24 15:55:44 +01:00
Marek Posolda 0262b64062 Merge pull request #3544 from hmlnarik/KEYCLOAK-3648-test
KEYCLOAK-3648 - Tests for UserAttributeMapper broker mapper
2016-11-24 13:31:17 +01:00
Hynek Mlnarik bd920b8ba9 KEYCLOAK-3648 - Tests for UserAttributeMapper broker mapper 2016-11-24 07:50:22 +01:00
Bill Burke 57da86c598 Merge pull request #3545 from patriot1burke/master
remove UserFederation SPI
2016-11-23 18:41:09 -05:00
Bill Burke cd92cc504b fix pom 2016-11-23 17:08:24 -05:00
Bill Burke e82e584b81 port removed migrators 2016-11-23 16:48:02 -05:00
Bill Burke ccbd8e8c70 remove User Fed SPI 2016-11-23 16:06:44 -05:00
Tomas Kyjovsky e396261399 fixed versions of 2 modules 2016-11-23 15:56:46 +01:00
Tomas Kyjovsky aae368f1e7 Added parameter check to WaitUtils.pause() 2016-11-23 15:52:41 +01:00
Tomas Kyjovsky 5ac4a852e1 Updated performance tests. Added app-profile-jee test application (from qs) to the testsuite. 2016-11-23 15:52:38 +01:00
Bill Burke fad33bc50f Merge remote-tracking branch 'upstream/master' 2016-11-23 08:31:28 -05:00
Bill Burke d5925b8ccf remove realm UserFed SPI methods 2016-11-23 08:31:20 -05:00
mhajas 5e97a46afc KEYCLOAK-1881 Fix SAML Filter key rotation tests 2016-11-23 10:53:13 +01:00
Marek Posolda 8ee2134e05 Merge pull request #3537 from hmlnarik/KEYCLOAK-3035
KEYCLOAK-3035 - Fix intermittent failures and refactor broker test
2016-11-23 10:48:38 +01:00
Bill Burke 2da9986717 Merge pull request #3540 from mhajas/KEYCLOAK-3671
KEYCLOAK-3671
2016-11-22 14:48:59 -05:00
Bill Burke c3b6b07e3a Merge pull request #3541 from patriot1burke/master
port SSSD and Kerberos to User Storage SPI
2016-11-22 14:47:34 -05:00
Bill Burke 045d6ef1d0 Merge remote-tracking branch 'upstream/master' 2016-11-22 11:28:09 -05:00
Bill Burke ecba291ea0 Merge pull request #3538 from stianst/master
Bump version to 2.4.1.Final-SNAPSHOT
2016-11-22 11:27:53 -05:00
Pavel Drozd 328ab1cc27 KEYCLOAK-3892 - Fix profile page assertion. 2016-11-22 16:44:16 +01:00
Marek Posolda 884f84d5ed Merge pull request #3539 from mposolda/master
KEYCLOAK-3962 Attempt to fix travis
2016-11-22 16:33:09 +01:00
mhajas b2d48c86a6 KEYCLOAK-3671 2016-11-22 16:32:39 +01:00
mposolda 3c5a0a3394 KEYCLOAK-3962 Attempt to fix travis 2016-11-22 16:00:05 +01:00
Stian Thorgersen 6ec82865d3 Bump version to 2.4.1.Final-SNAPSHOT 2016-11-22 14:56:21 +01:00
Hynek Mlnarik dab2225a39 KEYCLOAK-3035 - Fix intermittent failures and refactor broker test 2016-11-22 14:51:44 +01:00
Hiroyuki Wada 0e93603aee KEYCLOAK-3957 Update Japanese translation 2016-11-22 20:32:16 +09:00
Tomas Kyjovsky d44f347b08 Added 2nd secure-deployment, added option to test with separate realm configuration in keycloak subsystem. Moved jboss-specific test to a separate class. 2016-11-22 11:43:26 +01:00
Marek Posolda 99f12ff720 Merge pull request #3299 from paoloantinori/fuse_rest_dsl_example
KEYCLOAK-3678 - Fuse examples: added Camel RestDSL
2016-11-22 11:35:53 +01:00
Bill Burke a3cb3730b4 sssd port 2016-11-21 17:24:55 -05:00
Stan Silvert 2cca3bf570 KEYCLOAK-3949: User Federation "welcome" screen is always shown for a
while even if some providers are there.
2016-11-21 14:33:54 -05:00
Bill Burke 0c05dc093f Merge remote-tracking branch 'upstream/master' 2016-11-21 12:26:24 -05:00
Bill Burke 50fc083d97 fix migration scripts 2016-11-21 11:43:09 -05:00
Bill Burke 798fd84698 Merge remote-tracking branch 'upstream/master' 2016-11-21 11:33:52 -05:00
Bill Burke 19575b2c8f port kerberos 2016-11-21 11:33:44 -05:00
Vaclav Muzikar 5e731d9557 KEYCLOAK-3872 Stabilize PasswordPolicy UI test 2016-11-21 11:31:28 +01:00
mhajas 8fc5b00d91 KEYCLOAK-3653 Tests for cert endpoint 2016-11-16 15:31:48 +01:00
Stan Silvert 80b071024f KEYCLOAK-2720: Add unique constraint 2016-11-08 15:05:19 -05:00
Stan Silvert 3efd103712 KEYCLOAK-2720: Fix PermissionsTest 2016-11-04 19:05:32 -04:00
Stan Silvert 3035cbc5db KEYCLOAK-2720: Unit test 2016-11-04 13:11:06 -04:00
Stan Silvert facdd586a3 KEYCLOAK-2720: Should not allow two groups with the same path. 2016-11-01 16:08:30 -04:00
hassaneinaltememyictu a119a46495 grant the new role from the saml token if it exist
grant the user with the new role from the saml token if it is a realm role in keycloak
2016-10-24 17:17:22 +02:00
emilienbondu 0d3a50411e Move licence at the top of the file. 2016-10-19 09:57:07 +02:00
emilienbondu 3bed84d712 fix bug https://issues.jboss.org/browse/KEYCLOAK-3474 2016-10-17 14:42:46 +02:00
Paolo Antinori 0485f5c43d KEYCLOAK-3678 - Fuse examples, added Camel RestDSL 2016-10-07 14:41:57 +02:00
1577 changed files with 88258 additions and 23516 deletions

No files matched your search

+1
View File
@@ -14,6 +14,7 @@
nbactions.xml
nb-configuration.xml
catalog.xml
nbproject
# Compiled source #
###################
+2 -1
View File
@@ -12,11 +12,12 @@ env:
- MAVEN_SKIP_RC=true
- MAVEN_OPTS="-Xms512m -Xmx2048m"
matrix:
- TESTS=old
- TESTS=group1
- TESTS=group2
- TESTS=group3
- TESTS=group4
- TESTS=adapter
- TESTS=old
jdk:
- oraclejdk8
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -342,6 +342,12 @@ public class AdapterDeploymentContext {
return delegate.getNotBefore();
}
@Override
public void updateNotBefore(int notBefore) {
delegate.setNotBefore(notBefore);
getPublicKeyLocator().reset(this);
}
@Override
public void setExposeToken(boolean exposeToken) {
delegate.setExposeToken(exposeToken);
@@ -446,6 +452,16 @@ public class AdapterDeploymentContext {
public int getMinTimeBetweenJwksRequests() {
return delegate.getMinTimeBetweenJwksRequests();
}
@Override
public int getPublicKeyCacheTtl() {
return delegate.getPublicKeyCacheTtl();
}
@Override
public void setPublicKeyCacheTtl(int publicKeyCacheTtl) {
delegate.setPublicKeyCacheTtl(publicKeyCacheTtl);
}
}
protected KeycloakUriBuilder getBaseBuilder(HttpFacade facade, String base) {
@@ -46,14 +46,7 @@ public class HttpAdapterUtils {
}
InputStream is = entity.getContent();
try {
ByteArrayOutputStream os = new ByteArrayOutputStream();
int c;
while ((c = is.read()) != -1) {
os.write(c);
}
byte[] bytes = os.toByteArray();
String json = new String(bytes);
return JsonSerialization.readValue(json, clazz);
return JsonSerialization.readValue(is, clazz);
} finally {
try {
is.close();
@@ -57,6 +57,7 @@ public class KeycloakDeployment {
protected String resourceName;
protected boolean bearerOnly;
protected boolean autodetectBearerOnly;
protected boolean enableBasicAuth;
protected boolean publicClient;
protected Map<String, Object> resourceCredentials = new HashMap<>();
@@ -81,6 +82,7 @@ public class KeycloakDeployment {
protected volatile int notBefore;
protected int tokenMinimumTimeToLive;
protected int minTimeBetweenJwksRequests;
protected int publicKeyCacheTtl;
private PolicyEnforcer policyEnforcer;
public KeycloakDeployment() {
@@ -200,6 +202,14 @@ public class KeycloakDeployment {
this.bearerOnly = bearerOnly;
}
public boolean isAutodetectBearerOnly() {
return autodetectBearerOnly;
}
public void setAutodetectBearerOnly(boolean autodetectBearerOnly) {
this.autodetectBearerOnly = autodetectBearerOnly;
}
public boolean isEnableBasicAuth() {
return enableBasicAuth;
}
@@ -328,6 +338,11 @@ public class KeycloakDeployment {
this.notBefore = notBefore;
}
public void updateNotBefore(int notBefore) {
this.notBefore = notBefore;
getPublicKeyLocator().reset(this);
}
public boolean isAlwaysRefreshToken() {
return alwaysRefreshToken;
}
@@ -384,6 +399,14 @@ public class KeycloakDeployment {
this.minTimeBetweenJwksRequests = minTimeBetweenJwksRequests;
}
public int getPublicKeyCacheTtl() {
return publicKeyCacheTtl;
}
public void setPublicKeyCacheTtl(int publicKeyCacheTtl) {
this.publicKeyCacheTtl = publicKeyCacheTtl;
}
public void setPolicyEnforcer(PolicyEnforcer policyEnforcer) {
this.policyEnforcer = policyEnforcer;
}
@@ -99,12 +99,14 @@ public class KeycloakDeploymentBuilder {
}
deployment.setBearerOnly(adapterConfig.isBearerOnly());
deployment.setAutodetectBearerOnly(adapterConfig.isAutodetectBearerOnly());
deployment.setEnableBasicAuth(adapterConfig.isEnableBasicAuth());
deployment.setAlwaysRefreshToken(adapterConfig.isAlwaysRefreshToken());
deployment.setRegisterNodeAtStartup(adapterConfig.isRegisterNodeAtStartup());
deployment.setRegisterNodePeriod(adapterConfig.getRegisterNodePeriod());
deployment.setTokenMinimumTimeToLive(adapterConfig.getTokenMinimumTimeToLive());
deployment.setMinTimeBetweenJwksRequests(adapterConfig.getMinTimeBetweenJwksRequests());
deployment.setPublicKeyCacheTtl(adapterConfig.getPublicKeyCacheTtl());
if (realmKeyPem == null && adapterConfig.isBearerOnly() && adapterConfig.getAuthServerUrl() == null) {
throw new IllegalArgumentException("For bearer auth, you must set the realm-public-key or auth-server-url");
@@ -25,6 +25,7 @@ import org.keycloak.adapters.spi.AuthChallenge;
import org.keycloak.adapters.spi.AuthOutcome;
import org.keycloak.adapters.spi.HttpFacade;
import org.keycloak.common.VerificationException;
import org.keycloak.common.util.Encode;
import org.keycloak.common.util.KeycloakUriBuilder;
import org.keycloak.common.util.UriUtils;
import org.keycloak.constants.AdapterConstants;
@@ -169,7 +170,7 @@ public class OAuthRequestAuthenticator {
KeycloakUriBuilder redirectUriBuilder = deployment.getAuthUrl().clone()
.queryParam(OAuth2Constants.RESPONSE_TYPE, OAuth2Constants.CODE)
.queryParam(OAuth2Constants.CLIENT_ID, deployment.getResourceName())
.queryParam(OAuth2Constants.REDIRECT_URI, url)
.queryParam(OAuth2Constants.REDIRECT_URI, Encode.encodeQueryParamAsIs(url)) // Need to encode uri ourselves as queryParam() will not encode % characters.
.queryParam(OAuth2Constants.STATE, state)
.queryParam("login", "true");
if(loginHint != null && loginHint.length() > 0){
@@ -195,15 +196,13 @@ public class OAuthRequestAuthenticator {
return sslRedirectPort;
}
protected static final AtomicLong counter = new AtomicLong();
protected String getStateCode() {
return counter.getAndIncrement() + "/" + AdapterUtils.generateId();
return AdapterUtils.generateId();
}
protected AuthChallenge loginRedirect() {
final String state = getStateCode();
final String redirect = getRedirectUri(state);
final String redirect = getRedirectUri(state);
if (redirect == null) {
return challenge(403, OIDCAuthenticationError.Reason.NO_REDIRECT_URI, null);
}
@@ -357,7 +356,7 @@ public class OAuthRequestAuthenticator {
return challenge(403, OIDCAuthenticationError.Reason.INVALID_TOKEN, null);
}
if (tokenResponse.getNotBeforePolicy() > deployment.getNotBefore()) {
deployment.setNotBefore(tokenResponse.getNotBeforePolicy());
deployment.updateNotBefore(tokenResponse.getNotBeforePolicy());
}
if (token.getIssuedAt() < deployment.getNotBefore()) {
log.error("Stale token");
@@ -155,7 +155,7 @@ public class PreAuthActionsHandler {
} else {
log.debugf("logout of all sessions for application '%s'", action.getResource());
if (action.getNotBefore() > deployment.getNotBefore()) {
deployment.setNotBefore(action.getNotBefore());
deployment.updateNotBefore(action.getNotBefore());
}
userSessionManagement.logoutAll();
}
@@ -177,7 +177,7 @@ public class PreAuthActionsHandler {
}
PushNotBeforeAction action = JsonSerialization.readValue(token.getContent(), PushNotBeforeAction.class);
if (!validateAction(action)) return;
deployment.setNotBefore(action.getNotBefore());
deployment.updateNotBefore(action.getNotBefore());
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -144,7 +144,7 @@ public class RefreshableKeycloakSecurityContext extends KeycloakSecurityContext
}
if (response.getNotBeforePolicy() > deployment.getNotBefore()) {
deployment.setNotBefore(response.getNotBeforePolicy());
deployment.updateNotBefore(response.getNotBeforePolicy());
}
this.token = token;
@@ -17,6 +17,8 @@
package org.keycloak.adapters;
import java.util.Collections;
import java.util.List;
import org.jboss.logging.Logger;
import org.keycloak.KeycloakPrincipal;
import org.keycloak.adapters.spi.AuthChallenge;
@@ -116,6 +118,12 @@ public abstract class RequestAuthenticator {
return AuthOutcome.NOT_ATTEMPTED;
}
if (isAutodetectedBearerOnly(facade.getRequest())) {
challenge = bearer.getChallenge();
log.debug("NOT_ATTEMPTED: Treating as bearer only");
return AuthOutcome.NOT_ATTEMPTED;
}
if (log.isTraceEnabled()) {
log.trace("try oauth");
}
@@ -158,6 +166,36 @@ public abstract class RequestAuthenticator {
return false;
}
protected boolean isAutodetectedBearerOnly(HttpFacade.Request request) {
if (!deployment.isAutodetectBearerOnly()) return false;
String headerValue = facade.getRequest().getHeader("X-Requested-With");
if (headerValue != null && headerValue.equalsIgnoreCase("XMLHttpRequest")) {
return true;
}
headerValue = facade.getRequest().getHeader("Faces-Request");
if (headerValue != null && headerValue.startsWith("partial/")) {
return true;
}
headerValue = facade.getRequest().getHeader("SOAPAction");
if (headerValue != null) {
return true;
}
List<String> accepts = facade.getRequest().getHeaders("Accept");
if (accepts == null) accepts = Collections.emptyList();
for (String accept : accepts) {
if (accept.contains("text/html") || accept.contains("text/*") || accept.contains("*/*")) {
return false;
}
}
return true;
}
protected abstract OAuthRequestAuthenticator createOAuthAuthenticator();
protected BearerTokenRequestAuthenticator createBearerTokenAuthenticator() {
@@ -17,6 +17,13 @@
*/
package org.keycloak.adapters.authorization;
import java.net.URI;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.jboss.logging.Logger;
import org.keycloak.AuthorizationContext;
import org.keycloak.KeycloakSecurityContext;
@@ -32,13 +39,6 @@ import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.Enforce
import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig;
import org.keycloak.representations.idm.authorization.Permission;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/
@@ -48,7 +48,7 @@ public abstract class AbstractPolicyEnforcer {
private final PolicyEnforcerConfig enforcerConfig;
private final PolicyEnforcer policyEnforcer;
private List<PathConfig> paths;
private Map<String, PathConfig> paths;
private AuthzClient authzClient;
private PathMatcher pathMatcher;
@@ -57,7 +57,7 @@ public abstract class AbstractPolicyEnforcer {
this.enforcerConfig = policyEnforcer.getEnforcerConfig();
this.authzClient = policyEnforcer.getClient();
this.pathMatcher = new PathMatcher();
this.paths = new ArrayList<>(policyEnforcer.getPaths());
this.paths = policyEnforcer.getPaths();
}
public AuthorizationContext authorize(OIDCHttpFacade httpFacade) {
@@ -75,8 +75,7 @@ public abstract class AbstractPolicyEnforcer {
if (accessToken != null) {
Request request = httpFacade.getRequest();
Response response = httpFacade.getResponse();
String pathInfo = URI.create(request.getURI()).getPath().substring(1);
String path = pathInfo.substring(pathInfo.indexOf('/'), pathInfo.length());
String path = getPath(request);
PathConfig pathConfig = this.pathMatcher.matches(path, this.paths);
LOGGER.debugf("Checking permissions for path [%s] with config [%s].", request.getURI(), pathConfig);
@@ -122,12 +121,9 @@ public abstract class AbstractPolicyEnforcer {
protected boolean isAuthorized(PathConfig actualPathConfig, Set<String> requiredScopes, AccessToken accessToken, OIDCHttpFacade httpFacade) {
Request request = httpFacade.getRequest();
PolicyEnforcerConfig enforcerConfig = getEnforcerConfig();
String accessDeniedPath = enforcerConfig.getOnDenyRedirectTo();
if (accessDeniedPath != null) {
if (request.getURI().contains(accessDeniedPath)) {
return true;
}
if (isDefaultAccessDeniedUri(request, enforcerConfig)) {
return true;
}
AccessToken.Authorization authorization = accessToken.getAuthorization();
@@ -173,6 +169,17 @@ public abstract class AbstractPolicyEnforcer {
return false;
}
private boolean isDefaultAccessDeniedUri(Request request, PolicyEnforcerConfig enforcerConfig) {
String accessDeniedPath = enforcerConfig.getOnDenyRedirectTo();
if (accessDeniedPath != null) {
if (request.getURI().contains(accessDeniedPath)) {
return true;
}
}
return false;
}
private boolean hasResourceScopePermission(Set<String> requiredScopes, Permission permission, PathConfig actualPathConfig) {
Set<String> allowedScopes = permission.getScopes();
return (allowedScopes.containsAll(requiredScopes) || allowedScopes.isEmpty());
@@ -220,27 +227,23 @@ public abstract class AbstractPolicyEnforcer {
}
private PathConfig resolvePathConfig(PathConfig originalConfig, Request request) {
String path = getPath(request);
if (originalConfig.hasPattern()) {
String pathInfo = URI.create(request.getURI()).getPath().substring(1);
String path = pathInfo.substring(pathInfo.indexOf('/'), pathInfo.length());
ProtectedResource resource = this.authzClient.protection().resource();
Set<String> search = resource.findByFilter("uri=" + path);
if (!search.isEmpty()) {
// resource does exist on the server, cache it
ResourceRepresentation targetResource = resource.findById(search.iterator().next()).getResourceDescription();
PathConfig config = new PathConfig();
PathConfig config = PolicyEnforcer.createPathConfig(targetResource);
config.setId(targetResource.getId());
config.setName(targetResource.getName());
config.setType(targetResource.getType());
config.setPath(targetResource.getUri());
config.setScopes(originalConfig.getScopes());
config.setMethods(originalConfig.getMethods());
config.setParentConfig(originalConfig);
config.setEnforcementMode(originalConfig.getEnforcementMode());
this.paths.add(config);
this.policyEnforcer.addPath(config);
return config;
}
@@ -249,6 +252,10 @@ public abstract class AbstractPolicyEnforcer {
return originalConfig;
}
private String getPath(Request request) {
return request.getRelativePath();
}
private Set<String> getRequiredScopes(PathConfig pathConfig, Request request) {
Set<String> requiredScopes = new HashSet<>();
@@ -17,6 +17,10 @@
*/
package org.keycloak.adapters.authorization;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import org.jboss.logging.Logger;
import org.keycloak.adapters.KeycloakDeployment;
import org.keycloak.adapters.OIDCHttpFacade;
@@ -34,10 +38,6 @@ import org.keycloak.representations.AccessToken;
import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig;
import org.keycloak.representations.idm.authorization.Permission;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
/**
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/
@@ -51,39 +51,34 @@ public class KeycloakAdapterPolicyEnforcer extends AbstractPolicyEnforcer {
@Override
protected boolean isAuthorized(PathConfig pathConfig, Set<String> requiredScopes, AccessToken accessToken, OIDCHttpFacade httpFacade) {
int retry = 2;
AccessToken original = accessToken;
while (retry > 0) {
if (super.isAuthorized(pathConfig, requiredScopes, accessToken, httpFacade)) {
return true;
}
accessToken = requestAuthorizationToken(pathConfig, requiredScopes, httpFacade);
if (accessToken == null) {
return false;
}
AccessToken.Authorization authorization = original.getAuthorization();
if (authorization == null) {
authorization = new AccessToken.Authorization();
authorization.setPermissions(new ArrayList<Permission>());
}
AccessToken.Authorization newAuthorization = accessToken.getAuthorization();
if (newAuthorization != null) {
authorization.getPermissions().addAll(newAuthorization.getPermissions());
}
original.setAuthorization(authorization);
retry--;
if (super.isAuthorized(pathConfig, requiredScopes, accessToken, httpFacade)) {
return true;
}
return false;
accessToken = requestAuthorizationToken(pathConfig, requiredScopes, httpFacade);
if (accessToken == null) {
return false;
}
AccessToken.Authorization authorization = original.getAuthorization();
if (authorization == null) {
authorization = new AccessToken.Authorization();
authorization.setPermissions(new ArrayList<Permission>());
}
AccessToken.Authorization newAuthorization = accessToken.getAuthorization();
if (newAuthorization != null) {
authorization.getPermissions().addAll(newAuthorization.getPermissions());
}
original.setAuthorization(authorization);
return super.isAuthorized(pathConfig, requiredScopes, accessToken, httpFacade);
}
@Override
@@ -108,7 +103,7 @@ public class KeycloakAdapterPolicyEnforcer extends AbstractPolicyEnforcer {
KeycloakDeployment deployment = getPolicyEnforcer().getDeployment();
if (getEnforcerConfig().getUserManagedAccess() != null) {
LOGGER.debug("Obtaining authorization for authenticated user.");
LOGGER.debug("Obtaining authorization for authenticated user.");
PermissionRequest permissionRequest = new PermissionRequest();
permissionRequest.setResourceSetId(pathConfig.getId());
@@ -136,12 +131,14 @@ public class KeycloakAdapterPolicyEnforcer extends AbstractPolicyEnforcer {
permissionRequest.setResourceSetId(pathConfig.getId());
permissionRequest.setResourceSetName(pathConfig.getName());
permissionRequest.setScopes(new HashSet<>(pathConfig.getScopes()));
LOGGER.debugf("Sending entitlements request: resource_set_id [%s], resource_set_name [%s], scopes [%s].", permissionRequest.getResourceSetId(), permissionRequest.getResourceSetName(), permissionRequest.getScopes());
request.addPermission(permissionRequest);
EntitlementResponse authzResponse = authzClient.entitlement(accessToken).get(authzClient.getConfiguration().getClientId(), request);
return AdapterRSATokenVerifier.verifyToken(authzResponse.getRpt(), deployment);
}
}
} catch (AuthorizationDeniedException e) {
LOGGER.debug("Authorization denied", e);
return null;
} catch (Exception e) {
throw new RuntimeException("Unexpected error during authorization request.", e);
@@ -19,7 +19,7 @@ package org.keycloak.adapters.authorization;
import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig;
import java.util.List;
import java.util.Map;
/**
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
@@ -28,10 +28,16 @@ class PathMatcher {
private static final String ANY_RESOURCE_PATTERN = "/*";
PathConfig matches(final String requestedUri, List<PathConfig> paths) {
PathConfig matches(final String requestedUri, Map<String, PathConfig> paths) {
PathConfig pathConfig = paths.get(requestedUri);
if (pathConfig != null) {
return pathConfig;
}
PathConfig actualConfig = null;
for (PathConfig entry : paths) {
for (PathConfig entry : paths.values()) {
String protectedUri = entry.getPath();
String selectedUri = null;
@@ -34,8 +34,10 @@ import org.keycloak.representations.idm.authorization.Permission;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
@@ -48,7 +50,7 @@ public class PolicyEnforcer {
private final KeycloakDeployment deployment;
private final AuthzClient authzClient;
private final PolicyEnforcerConfig enforcerConfig;
private final List<PathConfig> paths;
private final Map<String, PathConfig> paths;
public PolicyEnforcer(KeycloakDeployment deployment, AdapterConfig adapterConfig) {
this.deployment = deployment;
@@ -58,7 +60,7 @@ public class PolicyEnforcer {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Initialization complete. Path configurations:");
for (PathConfig pathConfig : this.paths) {
for (PathConfig pathConfig : this.paths.values()) {
LOGGER.debug(pathConfig);
}
}
@@ -96,15 +98,19 @@ public class PolicyEnforcer {
return authzClient;
}
public List<PathConfig> getPaths() {
return Collections.unmodifiableList(paths);
public Map<String, PathConfig> getPaths() {
return paths;
}
void addPath(PathConfig pathConfig) {
paths.put(pathConfig.getPath(), pathConfig);
}
KeycloakDeployment getDeployment() {
return deployment;
}
private List<PathConfig> configurePaths(ProtectedResource protectedResource, PolicyEnforcerConfig enforcerConfig) {
private Map<String, PathConfig> configurePaths(ProtectedResource protectedResource, PolicyEnforcerConfig enforcerConfig) {
boolean loadPathsFromServer = true;
for (PathConfig pathConfig : enforcerConfig.getPaths()) {
@@ -123,8 +129,8 @@ public class PolicyEnforcer {
}
}
private List<PathConfig> configureDefinedPaths(ProtectedResource protectedResource, PolicyEnforcerConfig enforcerConfig) {
List<PathConfig> paths = new ArrayList<>();
private Map<String, PathConfig> configureDefinedPaths(ProtectedResource protectedResource, PolicyEnforcerConfig enforcerConfig) {
Map<String, PathConfig> paths = Collections.synchronizedMap(new HashMap<String, PathConfig>());
for (PathConfig pathConfig : enforcerConfig.getPaths()) {
Set<String> search;
@@ -172,7 +178,7 @@ public class PolicyEnforcer {
PathConfig existingPath = null;
for (PathConfig current : paths) {
for (PathConfig current : paths.values()) {
if (current.getId().equals(pathConfig.getId()) && current.getPath().equals(pathConfig.getPath())) {
existingPath = current;
break;
@@ -180,7 +186,7 @@ public class PolicyEnforcer {
}
if (existingPath == null) {
paths.add(pathConfig);
paths.put(pathConfig.getPath(), pathConfig);
} else {
existingPath.getMethods().addAll(pathConfig.getMethods());
existingPath.getScopes().addAll(pathConfig.getScopes());
@@ -190,23 +196,24 @@ public class PolicyEnforcer {
return paths;
}
private List<PathConfig> configureAllPathsForResourceServer(ProtectedResource protectedResource) {
private Map<String, PathConfig> configureAllPathsForResourceServer(ProtectedResource protectedResource) {
LOGGER.info("Querying the server for all resources associated with this application.");
List<PathConfig> paths = new ArrayList<>();
Map<String, PathConfig> paths = Collections.synchronizedMap(new HashMap<String, PathConfig>());
for (String id : protectedResource.findAll()) {
RegistrationResponse response = protectedResource.findById(id);
ResourceRepresentation resourceDescription = response.getResourceDescription();
if (resourceDescription.getUri() != null) {
paths.add(createPathConfig(resourceDescription));
PathConfig pathConfig = createPathConfig(resourceDescription);
paths.put(pathConfig.getPath(), pathConfig);
}
}
return paths;
}
private PathConfig createPathConfig(ResourceRepresentation resourceDescription) {
static PathConfig createPathConfig(ResourceRepresentation resourceDescription) {
PathConfig pathConfig = new PathConfig();
pathConfig.setId(resourceDescription.getId());
@@ -37,4 +37,9 @@ public class HardcodedPublicKeyLocator implements PublicKeyLocator {
public PublicKey getPublicKey(String kid, KeycloakDeployment deployment) {
return publicKey;
}
@Override
public void reset(KeycloakDeployment deployment) {
}
}
@@ -25,7 +25,6 @@ import org.keycloak.adapters.KeycloakDeployment;
import org.keycloak.common.util.Time;
import org.keycloak.jose.jwk.JSONWebKeySet;
import org.keycloak.jose.jwk.JWK;
import org.keycloak.jose.jws.JWSInput;
import org.keycloak.util.JWKSUtils;
import java.security.PublicKey;
@@ -48,36 +47,51 @@ public class JWKPublicKeyLocator implements PublicKeyLocator {
@Override
public PublicKey getPublicKey(String kid, KeycloakDeployment deployment) {
int minTimeBetweenRequests = deployment.getMinTimeBetweenJwksRequests();
int publicKeyCacheTtl = deployment.getPublicKeyCacheTtl();
int currentTime = Time.currentTime();
// Check if key is in cache.
PublicKey publicKey = currentKeys.get(kid);
PublicKey publicKey = lookupCachedKey(publicKeyCacheTtl, currentTime, kid);
if (publicKey != null) {
return publicKey;
}
int currentTime = Time.currentTime();
// Check if we are allowed to send request
if (currentTime > lastRequestTime + minTimeBetweenRequests) {
synchronized (this) {
currentTime = Time.currentTime();
if (currentTime > lastRequestTime + minTimeBetweenRequests) {
sendRequest(deployment);
lastRequestTime = currentTime;
} else {
log.debugf("Won't send request to realm jwks url. Last request time was %d", lastRequestTime);
}
synchronized (this) {
currentTime = Time.currentTime();
if (currentTime > lastRequestTime + minTimeBetweenRequests) {
sendRequest(deployment);
lastRequestTime = currentTime;
} else {
log.debug("Won't send request to realm jwks url. Last request time was " + lastRequestTime);
}
return lookupCachedKey(publicKeyCacheTtl, currentTime, kid);
}
}
return currentKeys.get(kid);
@Override
public void reset(KeycloakDeployment deployment) {
synchronized (this) {
sendRequest(deployment);
lastRequestTime = Time.currentTime();
}
}
private PublicKey lookupCachedKey(int publicKeyCacheTtl, int currentTime, String kid) {
if (lastRequestTime + publicKeyCacheTtl > currentTime) {
return currentKeys.get(kid);
} else {
return null;
}
}
private void sendRequest(KeycloakDeployment deployment) {
if (log.isTraceEnabled()) {
log.tracef("Going to send request to retrieve new set of realm public keys for client %s", deployment.getResourceName());
log.trace("Going to send request to retrieve new set of realm public keys for client " + deployment.getResourceName());
}
HttpGet getMethod = new HttpGet(deployment.getJwksUrl());
@@ -87,7 +101,7 @@ public class JWKPublicKeyLocator implements PublicKeyLocator {
Map<String, PublicKey> publicKeys = JWKSUtils.getKeysForUse(jwks, JWK.Use.SIG);
if (log.isDebugEnabled()) {
log.debugf("Realm public keys successfully retrieved for client %s. New kids: %s", deployment.getResourceName(), publicKeys.keySet().toString());
log.debug("Realm public keys successfully retrieved for client " + deployment.getResourceName() + ". New kids: " + publicKeys.keySet().toString());
}
// Update current keys
@@ -34,4 +34,11 @@ public interface PublicKeyLocator {
*/
PublicKey getPublicKey(String kid, KeycloakDeployment deployment);
/**
* Reset the state of locator (eg. clear the cached keys)
*
* @param deployment
*/
void reset(KeycloakDeployment deployment);
}
@@ -69,6 +69,7 @@ public class KeycloakDeploymentBuilderTest {
assertEquals("email", deployment.getPrincipalAttribute());
assertEquals(10, deployment.getTokenMinimumTimeToLive());
assertEquals(20, deployment.getMinTimeBetweenJwksRequests());
assertEquals(120, deployment.getPublicKeyCacheTtl());
}
@Test
@@ -78,6 +79,7 @@ public class KeycloakDeploymentBuilderTest {
assertTrue(deployment.getPublicKeyLocator() instanceof JWKPublicKeyLocator);
assertEquals(10, deployment.getMinTimeBetweenJwksRequests());
assertEquals(86400, deployment.getPublicKeyCacheTtl());
}
@Test
@@ -30,5 +30,6 @@
"token-store": "cookie",
"principal-attribute": "email",
"token-minimum-time-to-live": 10,
"min-time-between-jwks-requests": 20
"min-time-between-jwks-requests": 20,
"public-key-cache-ttl": 120
}
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-as7-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-as7-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-as7-integration-pom</artifactId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak AS7 / JBoss EAP 6 Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -66,6 +66,11 @@ public class JaxrsHttpFacade implements OIDCHttpFacade {
return requestContext.getUriInfo().getRequestUri().toString();
}
@Override
public String getRelativePath() {
return requestContext.getUriInfo().getPath();
}
@Override
public boolean isSecure() {
return securityContext.isSecure();
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak Jetty Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+63 -63
View File
@@ -87,6 +87,10 @@
}
kc.flow = initOptions.flow;
}
if (initOptions.timeSkew != null) {
kc.timeSkew = initOptions.timeSkew;
}
}
if (!kc.responseMode) {
@@ -153,7 +157,7 @@
processCallback(callback, initPromise);
return;
} else if (initOptions) {
if (initOptions.token || initOptions.refreshToken) {
if (initOptions.refreshToken) {
setToken(initOptions.token, initOptions.refreshToken, initOptions.idToken);
if (loginIframe.enable) {
@@ -162,12 +166,8 @@
kc.onAuthSuccess && kc.onAuthSuccess();
initPromise.setSuccess();
}).error(function () {
kc.onAuthError && kc.onAuthError();
if (initOptions.onLoad) {
onLoad();
} else {
initPromise.setError();
}
setToken(null, null, null);
initPromise.setSuccess();
});
});
} else {
@@ -369,6 +369,11 @@
throw 'Not authenticated';
}
if (kc.timeSkew == null) {
console.info('[KEYCLOAK] Unable to determine if token is expired as timeskew is not set');
return true;
}
var expiresIn = kc.tokenParsed['exp'] - Math.ceil(new Date().getTime() / 1000) + kc.timeSkew;
if (minValidity) {
expiresIn -= minValidity;
@@ -379,7 +384,7 @@
kc.updateToken = function(minValidity) {
var promise = createPromise();
if (!kc.tokenParsed || !kc.refreshToken) {
if (!kc.refreshToken) {
promise.setError();
return promise.promise;
}
@@ -388,14 +393,10 @@
var exec = function() {
var refreshToken = false;
if (kc.timeSkew == -1) {
console.info('Skew ' + kc.timeSkew);
refreshToken = true;
console.info('[KEYCLOAK] Refreshing token: time skew not set');
} else if (minValidity == -1) {
if (minValidity == -1) {
refreshToken = true;
console.info('[KEYCLOAK] Refreshing token: forced refresh');
} else if (kc.isTokenExpired(minValidity)) {
} else if (!kc.tokenParsed || kc.isTokenExpired(minValidity)) {
refreshToken = true;
console.info('[KEYCLOAK] Refreshing token: token expired');
}
@@ -638,49 +639,6 @@
kc.tokenTimeoutHandle = null;
}
if (token) {
kc.token = token;
kc.tokenParsed = decodeToken(token);
var sessionId = kc.realm + '/' + kc.tokenParsed.sub;
if (kc.tokenParsed.session_state) {
sessionId = sessionId + '/' + kc.tokenParsed.session_state;
}
kc.sessionId = sessionId;
kc.authenticated = true;
kc.subject = kc.tokenParsed.sub;
kc.realmAccess = kc.tokenParsed.realm_access;
kc.resourceAccess = kc.tokenParsed.resource_access;
if (timeLocal) {
kc.timeSkew = Math.floor(timeLocal / 1000) - kc.tokenParsed.iat;
console.info('[KEYCLOAK] Estimated time difference between browser and server is ' + kc.timeSkew + ' seconds');
} else {
kc.timeSkew = -1;
}
if (kc.onTokenExpired) {
if (kc.timeSkew == -1) {
kc.onTokenExpired();
} else {
var expiresIn = (kc.tokenParsed['exp'] - (new Date().getTime() / 1000) + kc.timeSkew) * 1000;
if (expiresIn <= 0) {
kc.onTokenExpired();
} else {
kc.tokenTimeoutHandle = setTimeout(kc.onTokenExpired, expiresIn);
}
}
}
} else {
delete kc.token;
delete kc.tokenParsed;
delete kc.subject;
delete kc.realmAccess;
delete kc.resourceAccess;
kc.authenticated = false;
}
if (refreshToken) {
kc.refreshToken = refreshToken;
kc.refreshTokenParsed = decodeToken(refreshToken);
@@ -696,6 +654,42 @@
delete kc.idToken;
delete kc.idTokenParsed;
}
if (token) {
kc.token = token;
kc.tokenParsed = decodeToken(token);
kc.sessionId = kc.tokenParsed.session_state;
kc.authenticated = true;
kc.subject = kc.tokenParsed.sub;
kc.realmAccess = kc.tokenParsed.realm_access;
kc.resourceAccess = kc.tokenParsed.resource_access;
if (timeLocal) {
kc.timeSkew = Math.floor(timeLocal / 1000) - kc.tokenParsed.iat;
}
if (kc.timeSkew != null) {
console.info('[KEYCLOAK] Estimated time difference between browser and server is ' + kc.timeSkew + ' seconds');
if (kc.onTokenExpired) {
var expiresIn = (kc.tokenParsed['exp'] - (new Date().getTime() / 1000) + kc.timeSkew) * 1000;
console.info('[KEYCLOAK] Token expires in ' + Math.round(expiresIn / 1000) + ' s');
if (expiresIn <= 0) {
kc.onTokenExpired();
} else {
kc.tokenTimeoutHandle = setTimeout(kc.onTokenExpired, expiresIn);
}
}
}
} else {
delete kc.token;
delete kc.tokenParsed;
delete kc.subject;
delete kc.realmAccess;
delete kc.resourceAccess;
kc.authenticated = false;
}
}
function decodeToken(str) {
@@ -838,22 +832,28 @@
document.body.appendChild(iframe);
var messageCallback = function(event) {
if (event.origin !== loginIframe.iframeOrigin) {
if ((event.origin !== loginIframe.iframeOrigin) || (loginIframe.iframe.contentWindow !== event.source)) {
return;
}
if (event.data != "unchanged") {
if (!(event.data == 'unchanged' || event.data == 'changed' || event.data == 'error')) {
return;
}
if (event.data != 'unchanged') {
kc.clearToken();
}
for (var i = loginIframe.callbackList.length - 1; i >= 0; --i) {
var promise = loginIframe.callbackList[i];
if (event.data == "unchanged") {
var callbacks = loginIframe.callbackList.splice(0, loginIframe.callbackList.length);
for (var i = callbacks.length - 1; i >= 0; --i) {
var promise = callbacks[i];
if (event.data == 'unchanged') {
promise.setSuccess();
} else {
promise.setError();
}
loginIframe.callbackList.splice(i, 1);
}
};
@@ -0,0 +1,49 @@
<!--
~ Copyright 2016 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<script>
function getCookie(cname)
{
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++)
{
var c = ca[i].trim();
if (c.indexOf(name)==0) return c.substring(name.length,c.length);
}
return null;
}
function receiveMessage(event)
{
if (event.origin !== "ORIGIN") {
console.log(event.origin + " does not match built origin");
return;
}
var data = JSON.parse(event.data);
data.loggedIn = false;
var cookie = getCookie('KEYCLOAK_SESSION');
if (cookie) {
data.loggedIn = true;
data.session = cookie;
}
event.source.postMessage(JSON.stringify(data),
event.origin);
}
window.addEventListener("message", receiveMessage, false);
</script>
@@ -35,14 +35,14 @@
req.open('GET', url, true);
req.onreadystatechange = function () {
if (req.readyState == 4) {
if (req.status == 204) {
if (req.readyState === 4) {
if (req.status === 204) {
init = {
clientId: clientId,
origin: origin
}
callback('unchanged');
} else if (req.status = 404) {
} else if (req.status === 404) {
callback('changed');
} else {
callback('error');
@@ -52,8 +52,9 @@
req.send();
} else {
if (clientId == init.clientId && origin == init.origin) {
if (sessionState == cookie) {
if (clientId === init.clientId && origin === init.origin) {
var c = cookie.split('/');
if (sessionState === c[2]) {
callback('unchanged');
} else {
callback('changed');
@@ -71,7 +72,7 @@
for(var i=0; i<ca.length; i++)
{
var c = ca[i].trim();
if (c.indexOf(name)==0) return c.substring(name.length,c.length);
if (c.indexOf(name)===0) return c.substring(name.length,c.length);
}
return null;
}
@@ -81,7 +82,7 @@
var origin = event.origin;
var data = event.data.split(' ');
if (data.length != 2) {
event.source.postMessage('error', origin);
return;
}
var clientId = data[0];
@@ -95,4 +96,4 @@
window.addEventListener("message", receiveMessage, false);
</script>
</body>
</html>
</html>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -0,0 +1,83 @@
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.adapters.osgi;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import org.keycloak.adapters.KeycloakConfigResolver;
import org.keycloak.adapters.KeycloakDeployment;
import org.keycloak.adapters.KeycloakDeploymentBuilder;
import org.keycloak.adapters.spi.HttpFacade;
import org.osgi.framework.BundleContext;
/**
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
*/
public class BundleBasedKeycloakConfigResolver implements KeycloakConfigResolver {
private volatile KeycloakDeployment cachedDeployment;
private BundleContext bundleContext;
private String configLocation = "WEB-INF/keycloak.json";
public BundleContext getBundleContext() {
return bundleContext;
}
public void setBundleContext(BundleContext bundleContext) {
this.bundleContext = bundleContext;
}
public String getConfigLocation() {
return configLocation;
}
public void setConfigLocation(String configLocation) {
this.configLocation = configLocation;
}
@Override
public KeycloakDeployment resolve(HttpFacade.Request request) {
if (cachedDeployment != null) {
return cachedDeployment;
} else {
cachedDeployment = findDeployment(request);
return cachedDeployment;
}
}
protected KeycloakDeployment findDeployment(HttpFacade.Request request) {
if (bundleContext == null) {
throw new IllegalStateException("bundleContext must be set for BundleBasedKeycloakConfigResolver!");
}
URL url = bundleContext.getBundle().getResource(configLocation);
if (url == null) {
throw new IllegalStateException("Failed to find the file " + configLocation + " on classpath.");
}
try {
InputStream is = url.openStream();
return KeycloakDeploymentBuilder.build(is);
} catch (IOException ioe) {
throw new IllegalStateException("Error reading file' " + configLocation + "' from bundle classpath.", ioe);
}
}
}
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<name>Keycloak OIDC Client Adapter Modules</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -218,6 +218,11 @@ public class ServletOAuthClient extends KeycloakDeploymentDelegateOAuthClient {
return servletRequest.getRequestURL().toString();
}
@Override
public String getRelativePath() {
return servletRequest.getServletPath();
}
@Override
public boolean isSecure() {
return servletRequest.isSecure();
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -30,6 +30,12 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import org.keycloak.adapters.AdapterDeploymentContext;
import org.keycloak.adapters.spi.HttpFacade;
import org.keycloak.adapters.springsecurity.config.KeycloakWebSecurityConfigurerAdapter;
import org.keycloak.adapters.springsecurity.facade.SimpleHttpFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
/**
* Provides a Keycloak {@link AuthenticationEntryPoint authentication entry point}. Uses a
@@ -56,12 +62,15 @@ public class KeycloakAuthenticationEntryPoint implements AuthenticationEntryPoin
private final RequestMatcher apiRequestMatcher;
private String loginUri = DEFAULT_LOGIN_URI;
private String realm = DEFAULT_REALM;
private AdapterDeploymentContext adapterDeploymentContext;
/**
* Creates a new Keycloak authentication entry point.
*/
public KeycloakAuthenticationEntryPoint() {
public KeycloakAuthenticationEntryPoint(AdapterDeploymentContext adapterDeploymentContext) {
this(DEFAULT_API_REQUEST_MATCHER);
this.adapterDeploymentContext = adapterDeploymentContext;
}
/**
@@ -79,7 +88,8 @@ public class KeycloakAuthenticationEntryPoint implements AuthenticationEntryPoin
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException
{
if (apiRequestMatcher.matches(request)) {
HttpFacade facade = new SimpleHttpFacade(request, response);
if (apiRequestMatcher.matches(request) || adapterDeploymentContext.resolveDeployment(facade).isBearerOnly()) {
commenceUnauthorizedResponse(request, response);
} else {
commenceLoginRedirect(request, response);
@@ -71,8 +71,8 @@ public abstract class KeycloakWebSecurityConfigurerAdapter extends WebSecurityCo
return factoryBean.getObject();
}
protected AuthenticationEntryPoint authenticationEntryPoint() {
return new KeycloakAuthenticationEntryPoint();
protected AuthenticationEntryPoint authenticationEntryPoint() throws Exception {
return new KeycloakAuthenticationEntryPoint(adapterDeploymentContext());
}
protected KeycloakAuthenticationProvider keycloakAuthenticationProvider() {
@@ -70,6 +70,11 @@ class WrappedHttpServletRequest implements Request {
return buf.toString();
}
@Override
public String getRelativePath() {
return request.getServletPath();
}
@Override
public boolean isSecure() {
return request.isSecure();
@@ -0,0 +1,90 @@
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.adapters.springsecurity.filter;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.keycloak.adapters.AdapterDeploymentContext;
import org.keycloak.adapters.AuthenticatedActionsHandler;
import org.keycloak.adapters.NodesRegistrationManagement;
import org.keycloak.adapters.OIDCHttpFacade;
import org.keycloak.adapters.spi.HttpFacade;
import org.keycloak.adapters.springsecurity.facade.SimpleHttpFacade;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.web.filter.GenericFilterBean;
/**
* Exposes a Keycloak adapter {@link AuthenticatedActionsHandler} as a Spring Security filter.
*
* @author <a href="mailto:srossillo@smartling.com">Scott Rossillo</a>
* @version $Revision: 1 $
*/
public class KeycloakAuthenticatedActionsFilter extends GenericFilterBean implements ApplicationContextAware {
private static final Logger log = LoggerFactory.getLogger(KeycloakAuthenticatedActionsFilter.class);
private final NodesRegistrationManagement management = new NodesRegistrationManagement();
private ApplicationContext applicationContext;
private AdapterDeploymentContext deploymentContext;
public KeycloakAuthenticatedActionsFilter() {
super();
}
@Override
protected void initFilterBean() throws ServletException {
deploymentContext = applicationContext.getBean(AdapterDeploymentContext.class);
}
@Override
public void destroy() {
log.debug("Unregistering deployment");
management.stop();
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
HttpFacade facade = new SimpleHttpFacade((HttpServletRequest)request, (HttpServletResponse)response);
AuthenticatedActionsHandler handler = new AuthenticatedActionsHandler(deploymentContext.resolveDeployment(facade), (OIDCHttpFacade)facade);
boolean handled = handler.handledRequest();
if (handled) {
log.debug("Authenticated filter handled request: {}", ((HttpServletRequest) request).getRequestURI());
} else {
chain.doFilter(request, response);
}
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
}
@@ -142,6 +142,7 @@ public class KeycloakAuthenticationProcessingFilter extends AbstractAuthenticati
if (AuthOutcome.FAILED.equals(result)) {
throw new KeycloakAuthenticationException("Auth outcome: " + result);
}
else if (AuthOutcome.AUTHENTICATED.equals(result)) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
Assert.notNull(authentication, "Authentication SecurityContextHolder was null");
@@ -26,6 +26,15 @@ import org.springframework.mock.web.MockHttpServletResponse;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.keycloak.adapters.AdapterDeploymentContext;
import org.keycloak.adapters.KeycloakDeployment;
import org.keycloak.adapters.spi.HttpFacade;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import org.mockito.Mock;
import static org.mockito.Mockito.when;
import org.mockito.MockitoAnnotations;
import org.springframework.context.ApplicationContext;
/**
* Keycloak authentication entry point tests.
@@ -35,12 +44,24 @@ public class KeycloakAuthenticationEntryPointTest {
private KeycloakAuthenticationEntryPoint authenticationEntryPoint;
private MockHttpServletRequest request;
private MockHttpServletResponse response;
@Mock
private ApplicationContext applicationContext;
@Mock
private AdapterDeploymentContext adapterDeploymentContext;
@Mock
private KeycloakDeployment keycloakDeployment;
@Before
public void setUp() throws Exception {
authenticationEntryPoint = new KeycloakAuthenticationEntryPoint();
MockitoAnnotations.initMocks(this);
authenticationEntryPoint = new KeycloakAuthenticationEntryPoint(adapterDeploymentContext);
request = new MockHttpServletRequest();
response = new MockHttpServletResponse();
when(applicationContext.getBean(eq(AdapterDeploymentContext.class))).thenReturn(adapterDeploymentContext);
when(adapterDeploymentContext.resolveDeployment(any(HttpFacade.class))).thenReturn(keycloakDeployment);
when(keycloakDeployment.isBearerOnly()).thenReturn(Boolean.FALSE);
}
@Test
@@ -154,6 +154,7 @@ public class KeycloakAuthenticationProcessingFilterTest {
when(keycloakDeployment.getResourceName()).thenReturn("resource-name");
when(keycloakDeployment.getStateCookieName()).thenReturn("kc-cookie");
when(keycloakDeployment.getSslRequired()).thenReturn(SslRequired.NONE);
when(keycloakDeployment.isBearerOnly()).thenReturn(Boolean.FALSE);
filter.attemptAuthentication(request, response);
verify(response).setStatus(302);
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak Tomcat Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -25,6 +25,7 @@ import org.apache.catalina.Manager;
import org.apache.catalina.authenticator.FormAuthenticator;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.jboss.logging.Logger;
import org.keycloak.KeycloakSecurityContext;
import org.keycloak.adapters.AdapterDeploymentContext;
import org.keycloak.adapters.AdapterTokenStore;
@@ -48,8 +49,6 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Keycloak authentication valve
@@ -62,7 +61,7 @@ public abstract class AbstractKeycloakAuthenticatorValve extends FormAuthenticat
public static final String TOKEN_STORE_NOTE = "TOKEN_STORE_NOTE";
private final static Logger log = Logger.getLogger(""+AbstractKeycloakAuthenticatorValve.class);
private final static Logger log = Logger.getLogger(AbstractKeycloakAuthenticatorValve.class);
protected CatalinaUserSessionManagement userSessionManagement = new CatalinaUserSessionManagement();
protected AdapterDeploymentContext deploymentContext;
protected NodesRegistrationManagement nodesRegistrationManagement;
@@ -118,22 +117,22 @@ public abstract class AbstractKeycloakAuthenticatorValve extends FormAuthenticat
try {
KeycloakConfigResolver configResolver = (KeycloakConfigResolver) context.getLoader().getClassLoader().loadClass(configResolverClass).newInstance();
deploymentContext = new AdapterDeploymentContext(configResolver);
log.log(Level.INFO, "Using {0} to resolve Keycloak configuration on a per-request basis.", configResolverClass);
log.debugv("Using {0} to resolve Keycloak configuration on a per-request basis.", configResolverClass);
} catch (Exception ex) {
log.log(Level.FINE, "The specified resolver {0} could NOT be loaded. Keycloak is unconfigured and will deny all requests. Reason: {1}", new Object[]{configResolverClass, ex.getMessage()});
log.errorv("The specified resolver {0} could NOT be loaded. Keycloak is unconfigured and will deny all requests. Reason: {1}", configResolverClass, ex.getMessage());
deploymentContext = new AdapterDeploymentContext(new KeycloakDeployment());
}
} else {
InputStream configInputStream = getConfigInputStream(context);
KeycloakDeployment kd;
if (configInputStream == null) {
log.warning("No adapter configuration. Keycloak is unconfigured and will deny all requests.");
log.warn("No adapter configuration. Keycloak is unconfigured and will deny all requests.");
kd = new KeycloakDeployment();
} else {
kd = KeycloakDeploymentBuilder.build(configInputStream);
}
deploymentContext = new AdapterDeploymentContext(kd);
log.fine("Keycloak is using a per-deployment configuration.");
log.debug("Keycloak is using a per-deployment configuration.");
}
context.getServletContext().setAttribute(AdapterDeploymentContext.class.getName(), deploymentContext);
@@ -149,8 +148,7 @@ public abstract class AbstractKeycloakAuthenticatorValve extends FormAuthenticat
if (json == null) {
return null;
}
log.finest("**** using " + AdapterConstants.AUTH_DATA_PARAM_NAME);
log.finest(json);
log.trace("**** using " + AdapterConstants.AUTH_DATA_PARAM_NAME);
return new ByteArrayInputStream(json.getBytes());
}
@@ -159,13 +157,13 @@ public abstract class AbstractKeycloakAuthenticatorValve extends FormAuthenticat
if (is == null) {
String path = context.getServletContext().getInitParameter("keycloak.config.file");
if (path == null) {
log.finest("**** using /WEB-INF/keycloak.json");
log.trace("**** using /WEB-INF/keycloak.json");
is = context.getServletContext().getResourceAsStream("/WEB-INF/keycloak.json");
} else {
try {
is = new FileInputStream(path);
} catch (FileNotFoundException e) {
log.log(Level.SEVERE, "NOT FOUND {0}", path);
log.errorv("NOT FOUND {0}", path);
throw new RuntimeException(e);
}
}
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -173,10 +173,15 @@ public class KeycloakServletExtension implements ServletExtension {
}
});
log.debug("Setting jsession cookie path to: " + deploymentInfo.getContextPath());
ServletSessionConfig cookieConfig = new ServletSessionConfig();
cookieConfig.setPath(deploymentInfo.getContextPath());
deploymentInfo.setServletSessionConfig(cookieConfig);
ServletSessionConfig cookieConfig = deploymentInfo.getServletSessionConfig();
if (cookieConfig == null) {
cookieConfig = new ServletSessionConfig();
}
if (cookieConfig.getPath() == null) {
log.debug("Setting jsession cookie path to: " + deploymentInfo.getContextPath());
cookieConfig.setPath(deploymentInfo.getContextPath());
deploymentInfo.setServletSessionConfig(cookieConfig);
}
ChangeSessionId.turnOffChangeSessionIdOnLogin(deploymentInfo);
deploymentInfo.addListener(new ListenerInfo(UndertowNodesRegistrationManagementWrapper.class, new InstanceFactory<UndertowNodesRegistrationManagementWrapper>() {
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak WildFly Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-parent</artifactId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -21,7 +21,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-parent</artifactId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
+2 -2
View File
@@ -20,10 +20,10 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<name>Keycloak Integration</name>
<name>Keycloak Adapters</name>
<description/>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-eap-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -22,9 +22,10 @@ import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.deploy.LoginConfig;
import org.keycloak.adapters.jbossweb.JBossWebPrincipalFactory;
import org.keycloak.adapters.saml.AbstractSamlAuthenticatorValve;
import org.keycloak.adapters.saml.SamlDeployment;
import org.keycloak.adapters.saml.*;
import org.keycloak.adapters.spi.SessionIdMapperUpdater;
import org.keycloak.adapters.tomcat.GenericPrincipalFactory;
import javax.servlet.http.HttpServletResponse;
@@ -71,4 +72,11 @@ public class SamlAuthenticatorValve extends AbstractSamlAuthenticatorValve {
protected GenericPrincipalFactory createPrincipalFactory() {
return new JBossWebPrincipalFactory();
}
@Override
protected void addTokenStoreUpdaters() {
context.addApplicationListenerInstance(new IdMapperUpdaterSessionListener(mapper));
setIdMapperUpdater(SessionIdMapperUpdater.EXTERNAL);
super.addTokenStoreUpdaters();
}
}
@@ -0,0 +1,111 @@
/*
* Copyright 2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.adapters.saml.jbossweb.infinispan;
import org.keycloak.adapters.spi.SessionIdMapper;
import org.keycloak.adapters.spi.SessionIdMapperUpdater;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletContext;
import org.apache.catalina.Context;
import org.infinispan.Cache;
import org.infinispan.configuration.cache.CacheMode;
import org.infinispan.configuration.cache.Configuration;
import org.infinispan.manager.EmbeddedCacheManager;
import org.jboss.logging.Logger;
/**
*
* @author hmlnarik
*/
public class InfinispanSessionCacheIdMapperUpdater {
private static final Logger LOG = Logger.getLogger(InfinispanSessionCacheIdMapperUpdater.class);
public static final String DEFAULT_CACHE_CONTAINER_JNDI_NAME = "java:jboss/infinispan/container/web";
private static final String DEPLOYMENT_CACHE_CONTAINER_JNDI_NAME_PARAM_NAME = "keycloak.sessionIdMapperUpdater.infinispan.cacheContainerJndi";
private static final String DEPLOYMENT_CACHE_NAME_PARAM_NAME = "keycloak.sessionIdMapperUpdater.infinispan.deploymentCacheName";
private static final String SSO_CACHE_NAME_PARAM_NAME = "keycloak.sessionIdMapperUpdater.infinispan.cacheName";
public static SessionIdMapperUpdater addTokenStoreUpdaters(Context context, SessionIdMapper mapper, SessionIdMapperUpdater previousIdMapperUpdater) {
boolean distributable = context.getDistributable();
if (! distributable) {
LOG.warnv("Deployment {0} does not use supported distributed session cache mechanism", context.getName());
return previousIdMapperUpdater;
}
ServletContext servletContext = context.getServletContext();
String cacheContainerLookup = (servletContext != null && servletContext.getInitParameter(DEPLOYMENT_CACHE_CONTAINER_JNDI_NAME_PARAM_NAME) != null)
? servletContext.getInitParameter(DEPLOYMENT_CACHE_CONTAINER_JNDI_NAME_PARAM_NAME)
: DEFAULT_CACHE_CONTAINER_JNDI_NAME;
// the following is based on https://github.com/jbossas/jboss-as/blob/7.2.0.Final/clustering/web-infinispan/src/main/java/org/jboss/as/clustering/web/infinispan/DistributedCacheManagerFactory.java#L116-L122
String host = context.getParent() == null ? "" : context.getParent().getName();
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "/ROOT";
}
boolean deploymentSessionCacheNamePreset = servletContext != null && servletContext.getInitParameter(DEPLOYMENT_CACHE_NAME_PARAM_NAME) != null;
String deploymentSessionCacheName = deploymentSessionCacheNamePreset
? servletContext.getInitParameter(DEPLOYMENT_CACHE_NAME_PARAM_NAME)
: host + contextPath;
boolean ssoCacheNamePreset = servletContext != null && servletContext.getInitParameter(SSO_CACHE_NAME_PARAM_NAME) != null;
String ssoCacheName = ssoCacheNamePreset
? servletContext.getInitParameter(SSO_CACHE_NAME_PARAM_NAME)
: deploymentSessionCacheName + ".ssoCache";
try {
EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) new InitialContext().lookup(cacheContainerLookup);
Configuration ssoCacheConfiguration = cacheManager.getCacheConfiguration(ssoCacheName);
if (ssoCacheConfiguration == null) {
Configuration cacheConfiguration = cacheManager.getCacheConfiguration(deploymentSessionCacheName);
if (cacheConfiguration == null) {
LOG.debugv("Using default cache container configuration for SSO cache. lookup={0}, looked up configuration of cache={1}", cacheContainerLookup, deploymentSessionCacheName);
ssoCacheConfiguration = cacheManager.getDefaultCacheConfiguration();
} else {
LOG.debugv("Using distributed HTTP session cache configuration for SSO cache. lookup={0}, configuration taken from cache={1}", cacheContainerLookup, deploymentSessionCacheName);
ssoCacheConfiguration = cacheConfiguration;
cacheManager.defineConfiguration(ssoCacheName, ssoCacheConfiguration);
}
} else {
LOG.debugv("Using custom configuration for SSO cache. lookup={0}, cache name={1}", cacheContainerLookup, ssoCacheName);
}
CacheMode ssoCacheMode = ssoCacheConfiguration.clustering().cacheMode();
if (ssoCacheMode != CacheMode.REPL_ASYNC && ssoCacheMode != CacheMode.REPL_SYNC) {
LOG.warnv("SSO cache mode is {0}, it is recommended to use replicated mode instead", ssoCacheConfiguration.clustering().cacheModeString());
}
Cache<String, String[]> ssoCache = cacheManager.getCache(ssoCacheName, true);
ssoCache.addListener(new SsoSessionCacheListener(mapper));
LOG.debugv("Added distributed SSO session cache, lookup={0}, cache name={1}", cacheContainerLookup, deploymentSessionCacheName);
SsoCacheSessionIdMapperUpdater updater = new SsoCacheSessionIdMapperUpdater(ssoCache, previousIdMapperUpdater);
return updater;
} catch (NamingException ex) {
LOG.warnv("Failed to obtain distributed session cache container, lookup={0}", cacheContainerLookup);
return previousIdMapperUpdater;
}
}
}
@@ -0,0 +1,60 @@
/*
* Copyright 2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.adapters.saml.jbossweb.infinispan;
import org.keycloak.adapters.spi.SessionIdMapper;
import org.keycloak.adapters.spi.SessionIdMapperUpdater;
import org.infinispan.Cache;
/**
*
* @author hmlnarik
*/
public class SsoCacheSessionIdMapperUpdater implements SessionIdMapperUpdater {
private final SessionIdMapperUpdater delegate;
/**
* Cache where key is a HTTP session ID, and value is a pair (user session ID, principal name) of Strings.
*/
private final Cache<String, String[]> httpSessionToSsoCache;
public SsoCacheSessionIdMapperUpdater(Cache<String, String[]> httpSessionToSsoCache, SessionIdMapperUpdater previousIdMapperUpdater) {
this.delegate = previousIdMapperUpdater;
this.httpSessionToSsoCache = httpSessionToSsoCache;
}
// SessionIdMapperUpdater methods
@Override
public void clear(SessionIdMapper idMapper) {
httpSessionToSsoCache.clear();
this.delegate.clear(idMapper);
}
@Override
public void map(SessionIdMapper idMapper, String sso, String principal, String httpSessionId) {
httpSessionToSsoCache.put(httpSessionId, new String[] {sso, principal});
this.delegate.map(idMapper, sso, principal, httpSessionId);
}
@Override
public void removeSession(SessionIdMapper idMapper, String httpSessionId) {
httpSessionToSsoCache.remove(httpSessionId);
this.delegate.removeSession(idMapper, httpSessionId);
}
}
@@ -0,0 +1,156 @@
/*
* Copyright 2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.adapters.saml.jbossweb.infinispan;
import org.keycloak.adapters.spi.SessionIdMapper;
import java.util.*;
import java.util.concurrent.*;
import org.infinispan.notifications.Listener;
import org.infinispan.notifications.cachelistener.annotation.*;
import org.infinispan.notifications.cachelistener.event.*;
import org.infinispan.notifications.cachemanagerlistener.annotation.CacheStarted;
import org.infinispan.notifications.cachemanagerlistener.annotation.CacheStopped;
import org.infinispan.notifications.cachemanagerlistener.event.CacheStartedEvent;
import org.infinispan.notifications.cachemanagerlistener.event.CacheStoppedEvent;
import org.infinispan.transaction.xa.GlobalTransaction;
import org.jboss.logging.Logger;
/**
*
* @author hmlnarik
*/
@Listener
public class SsoSessionCacheListener {
private static final Logger LOG = Logger.getLogger(SsoSessionCacheListener.class);
private final ConcurrentMap<GlobalTransaction, Queue<Event>> map = new ConcurrentHashMap<>();
private final SessionIdMapper idMapper;
private ExecutorService executor = Executors.newSingleThreadExecutor();
public SsoSessionCacheListener(SessionIdMapper idMapper) {
this.idMapper = idMapper;
}
@TransactionRegistered
public void startTransaction(TransactionRegisteredEvent event) {
map.put(event.getGlobalTransaction(), new ConcurrentLinkedQueue<Event>());
}
@CacheStarted
public void cacheStarted(CacheStartedEvent event) {
this.executor = Executors.newSingleThreadExecutor();
}
@CacheStopped
public void cacheStopped(CacheStoppedEvent event) {
this.executor.shutdownNow();
}
@CacheEntryCreated
@CacheEntryRemoved
@CacheEntryModified
public void addEvent(TransactionalEvent event) {
if (event.isPre() == false) {
map.get(event.getGlobalTransaction()).add(event);
}
}
@TransactionCompleted
public void endTransaction(TransactionCompletedEvent event) {
Queue<Event> events = map.remove(event.getGlobalTransaction());
if (events == null || ! event.isTransactionSuccessful()) {
return;
}
if (event.isOriginLocal()) {
// Local events are processed by local HTTP session listener
return;
}
for (final Event e : events) {
switch (e.getType()) {
case CACHE_ENTRY_CREATED:
this.executor.submit(new Runnable() {
@Override public void run() {
cacheEntryCreated((CacheEntryCreatedEvent) e);
}
});
break;
case CACHE_ENTRY_MODIFIED:
this.executor.submit(new Runnable() {
@Override public void run() {
cacheEntryModified((CacheEntryModifiedEvent) e);
}
});
break;
case CACHE_ENTRY_REMOVED:
this.executor.submit(new Runnable() {
@Override public void run() {
cacheEntryRemoved((CacheEntryRemovedEvent) e);
}
});
break;
}
}
}
private void cacheEntryCreated(CacheEntryCreatedEvent event) {
if (! (event.getKey() instanceof String) || ! (event.getValue() instanceof String[])) {
return;
}
String httpSessionId = (String) event.getKey();
String[] value = (String[]) event.getValue();
String ssoId = value[0];
String principal = value[1];
LOG.tracev("cacheEntryCreated {0}:{1}", httpSessionId, ssoId);
this.idMapper.map(ssoId, principal, httpSessionId);
}
private void cacheEntryModified(CacheEntryModifiedEvent event) {
if (! (event.getKey() instanceof String) || ! (event.getValue() instanceof String[])) {
return;
}
String httpSessionId = (String) event.getKey();
String[] value = (String[]) event.getValue();
String ssoId = value[0];
String principal = value[1];
LOG.tracev("cacheEntryModified {0}:{1}", httpSessionId, ssoId);
this.idMapper.removeSession(httpSessionId);
this.idMapper.map(ssoId, principal, httpSessionId);
}
private void cacheEntryRemoved(CacheEntryRemovedEvent event) {
if (! (event.getKey() instanceof String)) {
return;
}
LOG.tracev("cacheEntryRemoved {0}", event.getKey());
this.idMapper.removeSession((String) event.getKey());
}
}
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak SAML EAP Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-saml-eap-integration-pom</artifactId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -17,6 +17,7 @@
package org.keycloak.adapters.saml;
import org.keycloak.adapters.saml.SamlDeployment.IDP.SingleSignOnService;
import org.jboss.logging.Logger;
import org.keycloak.adapters.spi.AuthChallenge;
import org.keycloak.adapters.spi.HttpFacade;
@@ -95,21 +96,22 @@ public abstract class AbstractInitiateLogin implements AuthChallenge {
nameIDPolicyFormat = JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get();
}
SingleSignOnService sso = deployment.getIDP().getSingleSignOnService();
SAML2AuthnRequestBuilder authnRequestBuilder = new SAML2AuthnRequestBuilder()
.destination(deployment.getIDP().getSingleSignOnService().getRequestBindingUrl())
.destination(sso.getRequestBindingUrl())
.issuer(issuerURL)
.forceAuthn(deployment.isForceAuthentication()).isPassive(deployment.isIsPassive())
.nameIdPolicy(SAML2NameIDPolicyBuilder.format(nameIDPolicyFormat));
if (deployment.getIDP().getSingleSignOnService().getResponseBinding() != null) {
if (sso.getResponseBinding() != null) {
String protocolBinding = JBossSAMLURIConstants.SAML_HTTP_REDIRECT_BINDING.get();
if (deployment.getIDP().getSingleSignOnService().getResponseBinding() == SamlDeployment.Binding.POST) {
if (sso.getResponseBinding() == SamlDeployment.Binding.POST) {
protocolBinding = JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get();
}
authnRequestBuilder.protocolBinding(protocolBinding);
}
if (deployment.getAssertionConsumerServiceUrl() != null) {
authnRequestBuilder.assertionConsumerUrl(deployment.getAssertionConsumerServiceUrl());
if (sso.getAssertionConsumerServiceUrl() != null) {
authnRequestBuilder.assertionConsumerUrl(sso.getAssertionConsumerServiceUrl());
}
return authnRequestBuilder;
}
@@ -31,6 +31,7 @@ import org.keycloak.adapters.saml.rotation.SamlDescriptorPublicKeyLocator;
import org.keycloak.rotation.CompositeKeyLocator;
import org.keycloak.rotation.HardcodedKeyLocator;
import org.keycloak.rotation.KeyLocator;
import java.net.URI;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -45,6 +46,7 @@ public class DefaultSamlDeployment implements SamlDeployment {
private Binding requestBinding;
private Binding responseBinding;
private String requestBindingUrl;
private URI assertionConsumerServiceUrl;
@Override
public boolean signRequest() {
@@ -76,6 +78,15 @@ public class DefaultSamlDeployment implements SamlDeployment {
return requestBindingUrl;
}
@Override
public URI getAssertionConsumerServiceUrl() {
return assertionConsumerServiceUrl;
}
public void setAssertionConsumerServiceUrl(URI assertionConsumerServiceUrl) {
this.assertionConsumerServiceUrl = assertionConsumerServiceUrl;
}
public void setSignRequest(boolean signRequest) {
this.signRequest = signRequest;
}
@@ -277,7 +288,6 @@ public class DefaultSamlDeployment implements SamlDeployment {
private boolean turnOffChangeSessionIdOnLogin;
private PrivateKey decryptionKey;
private KeyPair signingKeyPair;
private String assertionConsumerServiceUrl;
private Set<String> roleAttributeNames;
private PrincipalNamePolicy principalNamePolicy = PrincipalNamePolicy.FROM_NAME_ID;
private String principalAttributeName;
@@ -340,11 +350,6 @@ public class DefaultSamlDeployment implements SamlDeployment {
return signingKeyPair;
}
@Override
public String getAssertionConsumerServiceUrl() {
return assertionConsumerServiceUrl;
}
@Override
public Set<String> getRoleAttributeNames() {
return roleAttributeNames;
@@ -396,10 +401,6 @@ public class DefaultSamlDeployment implements SamlDeployment {
this.signingKeyPair = signingKeyPair;
}
public void setAssertionConsumerServiceUrl(String assertionConsumerServiceUrl) {
this.assertionConsumerServiceUrl = assertionConsumerServiceUrl;
}
public void setRoleAttributeNames(Set<String> roleAttributeNames) {
this.roleAttributeNames = roleAttributeNames;
}
@@ -25,6 +25,7 @@ import java.security.PrivateKey;
import java.util.Set;
import org.apache.http.client.HttpClient;
import org.keycloak.rotation.KeyLocator;
import java.net.URI;
/**
* Represents SAML deployment configuration.
@@ -103,8 +104,24 @@ public interface SamlDeployment {
*/
boolean validateAssertionSignature();
Binding getRequestBinding();
/**
* SAML allows the client to request what binding type it wants authn responses to use. The default is
* that the client will not request a specific binding type for responses.
* @return
*/
Binding getResponseBinding();
/**
* Returns URL for the IDP login service that the client will send requests to.
* @return
*/
String getRequestBindingUrl();
/**
* Returns URI where the IdP should send the responses to. The default is
* that the client will not request a specific assertion consumer service URL.
* This property is typically accompanied by the ProtocolBinding attribute.
* @return
*/
URI getAssertionConsumerServiceUrl();
}
public interface SingleLogoutService {
@@ -141,7 +158,6 @@ public interface SamlDeployment {
KeyPair getSigningKeyPair();
String getSignatureCanonicalizationMethod();
SignatureAlgorithm getSignatureAlgorithm();
String getAssertionConsumerServiceUrl();
String getLogoutPage();
Set<String> getRoleAttributeNames();
@@ -40,7 +40,7 @@ public class SamlUtil {
httpFacade.getResponse().setHeader("Content-Type", "text/html");
httpFacade.getResponse().setHeader("Pragma", "no-cache");
httpFacade.getResponse().setHeader("Cache-Control", "no-cache, no-store");
httpFacade.getResponse().getOutputStream().write(html.getBytes());
httpFacade.getResponse().getOutputStream().write(html.getBytes(GeneralConstants.SAML_CHARSET));
httpFacade.getResponse().end();
} else {
String uri = asRequest ? binding.redirectBinding(document).requestURI(actionUrl).toString() : binding.redirectBinding(document).responseURI(actionUrl).toString();
@@ -32,6 +32,7 @@ public class IDP implements Serializable {
private String requestBinding;
private String responseBinding;
private String bindingUrl;
private String assertionConsumerServiceUrl;
private boolean validateAssertionSignature;
public boolean isSignRequest() {
@@ -81,6 +82,14 @@ public class IDP implements Serializable {
public void setBindingUrl(String bindingUrl) {
this.bindingUrl = bindingUrl;
}
public String getAssertionConsumerServiceUrl() {
return assertionConsumerServiceUrl;
}
public void setAssertionConsumerServiceUrl(String assertionConsumerServiceUrl) {
this.assertionConsumerServiceUrl = assertionConsumerServiceUrl;
}
}
public static class SingleLogoutService implements Serializable {
@@ -72,6 +72,7 @@ public class ConfigXmlConstants {
public static final String VALIDATE_REQUEST_SIGNATURE_ATTR = "validateRequestSignature";
public static final String POST_BINDING_URL_ATTR = "postBindingUrl";
public static final String REDIRECT_BINDING_URL_ATTR = "redirectBindingUrl";
public static final String ASSERTION_CONSUMER_SERVICE_URL_ATTR = "assertionConsumerServiceUrl";
public static final String HTTP_CLIENT_ELEMENT = "HttpClient";
public static final String ALLOW_ANY_HOSTNAME_ATTR = "allowAnyHostname";
@@ -41,6 +41,7 @@ import java.security.cert.Certificate;
import java.util.HashSet;
import java.util.Set;
import org.keycloak.adapters.cloned.HttpClientBuilder;
import java.net.URI;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -156,6 +157,12 @@ public class DeploymentBuilder {
if (sp.getIdp().getSingleSignOnService().getResponseBinding() != null) {
sso.setResponseBinding(SamlDeployment.Binding.parseBinding(sp.getIdp().getSingleSignOnService().getResponseBinding()));
}
if (sp.getIdp().getSingleSignOnService().getAssertionConsumerServiceUrl() != null) {
if (! sp.getIdp().getSingleSignOnService().getAssertionConsumerServiceUrl().endsWith("/saml")) {
throw new RuntimeException("AssertionConsumerServiceUrl must end with \"/saml\".");
}
sso.setAssertionConsumerServiceUrl(URI.create(sp.getIdp().getSingleSignOnService().getAssertionConsumerServiceUrl()));
}
sso.setSignRequest(sp.getIdp().getSingleSignOnService().isSignRequest());
sso.setValidateResponseSignature(sp.getIdp().getSingleSignOnService().isValidateResponseSignature());
sso.setValidateAssertionSignature(sp.getIdp().getSingleSignOnService().isValidateAssertionSignature());
@@ -118,6 +118,7 @@ public class IDPXmlParser extends AbstractParser {
sso.setRequestBinding(getAttributeValue(element, ConfigXmlConstants.REQUEST_BINDING_ATTR));
sso.setResponseBinding(getAttributeValue(element, ConfigXmlConstants.RESPONSE_BINDING_ATTR));
sso.setBindingUrl(getAttributeValue(element, ConfigXmlConstants.BINDING_URL_ATTR));
sso.setAssertionConsumerServiceUrl(getAttributeValue(element, ConfigXmlConstants.ASSERTION_CONSUMER_SERVICE_URL_ATTR));
return sso;
}
@@ -60,6 +60,7 @@ import org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHolder;
import org.keycloak.saml.processing.core.saml.v2.util.AssertionUtil;
import org.keycloak.saml.processing.web.util.PostBindingUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import java.io.IOException;
@@ -70,14 +71,11 @@ import java.security.KeyManagementException;
import java.security.PublicKey;
import java.security.Signature;
import java.security.SignatureException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
import org.keycloak.dom.saml.v2.SAML2Object;
import org.keycloak.dom.saml.v2.protocol.ExtensionsType;
import org.keycloak.rotation.KeyLocator;
import org.keycloak.saml.processing.core.util.KeycloakKeySamlExtensionGenerator;
import org.w3c.dom.Element;
/**
*
@@ -196,7 +194,7 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
challenge = new AuthChallenge() {
@Override
public boolean challenge(HttpFacade exchange) {
SamlAuthenticationError error = new SamlAuthenticationError(SamlAuthenticationError.Reason.INVALID_SIGNATURE);
SamlAuthenticationError error = new SamlAuthenticationError(SamlAuthenticationError.Reason.INVALID_SIGNATURE, statusResponse);
exchange.getRequest().setError(error);
exchange.getResponse().sendError(403);
return true;
@@ -312,8 +310,25 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
return false;
}
protected AuthOutcome handleLoginResponse(ResponseType responseType, boolean postBinding, OnSessionCreated onCreateSession) {
protected AuthOutcome handleLoginResponse(final ResponseType responseType, boolean postBinding, OnSessionCreated onCreateSession) {
AssertionType assertion = null;
if (! isSuccessfulSamlResponse(responseType) || responseType.getAssertions() == null || responseType.getAssertions().isEmpty()) {
challenge = new AuthChallenge() {
@Override
public boolean challenge(HttpFacade exchange) {
SamlAuthenticationError error = new SamlAuthenticationError(SamlAuthenticationError.Reason.ERROR_STATUS, responseType);
exchange.getRequest().setError(error);
exchange.getResponse().sendError(403);
return true;
}
@Override
public int getResponseCode() {
return 403;
}
};
return AuthOutcome.FAILED;
}
try {
assertion = AssertionUtil.getAssertion(responseType, deployment.getDecryptionKey());
if (AssertionUtil.hasExpired(assertion)) {
@@ -335,6 +350,7 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
return 403;
}
};
return AuthOutcome.FAILED;
}
if (deployment.getIDP().getSingleSignOnService().validateAssertionSignature()) {
@@ -346,7 +362,7 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
challenge = new AuthChallenge() {
@Override
public boolean challenge(HttpFacade exchange) {
SamlAuthenticationError error = new SamlAuthenticationError(SamlAuthenticationError.Reason.INVALID_SIGNATURE);
SamlAuthenticationError error = new SamlAuthenticationError(SamlAuthenticationError.Reason.INVALID_SIGNATURE, responseType);
exchange.getRequest().setError(error);
exchange.getResponse().sendError(403);
return true;
@@ -449,6 +465,14 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
return AuthOutcome.AUTHENTICATED;
}
private boolean isSuccessfulSamlResponse(ResponseType responseType) {
return responseType != null
&& responseType.getStatus() != null
&& responseType.getStatus().getStatusCode() != null
&& responseType.getStatus().getStatusCode().getValue() != null
&& Objects.equals(responseType.getStatus().getStatusCode().getValue().toString(), JBossSAMLURIConstants.STATUS_SUCCESS.get());
}
private String getAttributeValue(Object attrValue) {
String value = null;
if (attrValue instanceof String) {
@@ -571,12 +595,8 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
key = locator.getKey(keyId);
boolean keyLocated = key != null;
if (validateRedirectBindingSignatureForKey(sigAlg, rawQueryBytes, decodedSignature, key)) {
return true;
}
if (keyLocated) {
return false;
return validateRedirectBindingSignatureForKey(sigAlg, rawQueryBytes, decodedSignature, key);
}
} catch (KeyManagementException ex) {
}
@@ -156,7 +156,15 @@ public class EcpAuthenticationHandler extends AbstractSamlAuthenticationHandler
paosRequestHeader.setMustUnderstand(true);
paosRequestHeader.setActor("http://schemas.xmlsoap.org/soap/actor/next");
paosRequestHeader.addAttribute(envelope.createName("service"), JBossSAMLURIConstants.ECP_PROFILE.get());
paosRequestHeader.addAttribute(envelope.createName("responseConsumerURL"), deployment.getAssertionConsumerServiceUrl());
paosRequestHeader.addAttribute(envelope.createName("responseConsumerURL"), getResponseConsumerUrl());
}
private String getResponseConsumerUrl() {
return (deployment.getIDP() == null
|| deployment.getIDP().getSingleSignOnService() == null
|| deployment.getIDP().getSingleSignOnService().getAssertionConsumerServiceUrl() == null
) ? null
: deployment.getIDP().getSingleSignOnService().getAssertionConsumerServiceUrl().toString();
}
};
}
@@ -0,0 +1,456 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<xs:schema version="1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="urn:keycloak:saml:adapter"
targetNamespace="urn:keycloak:saml:adapter"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="keycloak-saml-adapter" type="adapter-type"/>
<xs:complexType name="adapter-type">
<xs:annotation>
<xs:documentation>Keycloak SAML Adapter configuration file.</xs:documentation>
</xs:annotation>
<xs:all>
<xs:element name="SP" maxOccurs="1" minOccurs="0" type="sp-type">
<xs:annotation>
<xs:documentation>Describes SAML service provider configuration.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="sp-type">
<xs:all>
<xs:element name="Keys" type="keys-type" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>
List of service provider encryption and validation keys.
If the IDP requires that the client application (SP) sign all of its requests and/or if the IDP will encrypt assertions, you must define the keys used to do this. For client signed documents you must define both the private and public key or certificate that will be used to sign documents. For encryption, you only have to define the private key that will be used to decrypt.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="PrincipalNameMapping" type="principal-name-mapping-type" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>When creating a Java Principal object that you obtain from methods like HttpServletRequest.getUserPrincipal(), you can define what name that is returned by the Principal.getName() method.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="RoleIdentifiers" type="role-identifiers-type" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Defines what SAML attributes within the assertion received from the user should be used as role identifiers within the Java EE Security Context for the user.
By default Role attribute values are converted to Java EE roles. Some IDPs send roles via a member or memberOf attribute assertion. You can define one or more Attribute elements to specify which SAML attributes must be converted into roles.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="IDP" type="idp-type" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>Describes configuration of SAML identity provider for this service provider.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
<xs:attribute name="entityID" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>This is the identifier for this client. The IDP needs this value to determine who the client is that is communicating with it.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="sslPolicy" type="ssl-policy-type" use="optional">
<xs:annotation>
<xs:documentation>SSL policy the adapter will enforce.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="nameIDPolicyFormat" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>SAML clients can request a specific NameID Subject format. Fill in this value if you want a specific format. It must be a standard SAML format identifier, i.e. urn:oasis:names:tc:SAML:2.0:nameid-format:transient. By default, no special format is requested.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="logoutPage" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>URL of the logout page.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="forceAuthentication" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>SAML clients can request that a user is re-authenticated even if they are already logged in at the IDP. Default value is false.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="isPassive" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>SAML clients can request that a user is never asked to authenticate even if they are not logged in at the IDP. Set this to true if you want this. Do not use together with forceAuthentication as they are opposite. Default value is false.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="turnOffChangeSessionIdOnLogin" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>The session id is changed by default on a successful login on some platforms to plug a security attack vector. Change this to true to disable this. It is recommended you do not turn it off. Default value is false.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="keys-type">
<xs:sequence>
<xs:element name="Key" type="key-type" minOccurs="1" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Describes a single key used for signing or encryption.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="key-type">
<xs:all>
<xs:element name="KeyStore" maxOccurs="1" minOccurs="0" type="key-store-type">
<xs:annotation>
<xs:documentation>Java keystore to load keys and certificates from.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="PrivateKeyPem" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Private key (PEM format)</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="PublicKeyPem" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Public key (PEM format)</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="CertificatePem" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Certificate key (PEM format)</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
<xs:attribute name="signing" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>Flag defining whether the key should be used for signing.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="encryption" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>Flag defining whether the key should be used for encryption</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="key-store-type">
<xs:all>
<xs:element name="PrivateKey" maxOccurs="1" minOccurs="0" type="private-key-type">
<xs:annotation>
<xs:documentation>Private key declaration</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Certificate" type="certificate-type" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Certificate declaration</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
<xs:attribute name="file" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>File path to the key store.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="resource" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>WAR resource path to the key store. This is a path used in method call to ServletContext.getResourceAsStream().</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="password" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>The password of the key store.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="private-key-type">
<xs:attribute name="alias" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>Alias that points to the key or cert within the keystore.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="password" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>Keystores require an additional password to access private keys. In the PrivateKey element you must define this password within a password attribute.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="certificate-type">
<xs:attribute name="alias" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>Alias that points to the key or cert within the keystore.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="principal-name-mapping-type">
<xs:attribute name="policy" type="principal-name-mapping-policy-type" use="required">
<xs:annotation>
<xs:documentation>Policy used to populate value of Java Principal object obtained from methods like HttpServletRequest.getUserPrincipal().</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="attribute" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Name of the SAML assertion attribute to use within.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:simpleType name="principal-name-mapping-policy-type">
<xs:restriction base="xs:string">
<xs:enumeration value="FROM_NAME_ID">
<xs:annotation>
<xs:documentation>This policy just uses whatever the SAML subject value is. This is the default setting</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="FROM_ATTRIBUTE">
<xs:annotation>
<xs:documentation>This will pull the value from one of the attributes declared in the SAML assertion received from the server. You'll need to specify the name of the SAML assertion attribute to use within the attribute XML attribute.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ssl-policy-type">
<xs:restriction base="xs:string">
<xs:enumeration value="ALL">
<xs:annotation>
<xs:documentation>All requests must come in via HTTPS.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="EXTERNAL">
<xs:annotation>
<xs:documentation>Only non-private IP addresses must come over the wire via HTTPS.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="NONE">
<xs:annotation>
<xs:documentation>no requests are required to come over via HTTPS.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="signature-algorithm-type">
<xs:restriction base="xs:string">
<xs:enumeration value="RSA_SHA1"/>
<xs:enumeration value="RSA_SHA256"/>
<xs:enumeration value="RSA_SHA512"/>
<xs:enumeration value="DSA_SHA1"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="binding-type">
<xs:restriction base="xs:string">
<xs:enumeration value="POST"/>
<xs:enumeration value="REDIRECT"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="role-identifiers-type">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Attribute" maxOccurs="unbounded" minOccurs="0" type="attribute-type">
<xs:annotation>
<xs:documentation>Specifies SAML attribute to be converted into roles.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:complexType name="attribute-type">
<xs:attribute name="name" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>Specifies name of the SAML attribute to be converted into roles.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="idp-type">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="SingleSignOnService" maxOccurs="1" minOccurs="1" type="sign-on-type">
<xs:annotation>
<xs:documentation>Configuration of the login SAML endpoint of the IDP.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SingleLogoutService" type="logout-type" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Configuration of the logout SAML endpoint of the IDP</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Keys" type="keys-type" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>The Keys sub element of IDP is only used to define the certificate or public key to use to verify documents signed by the IDP.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="HttpClient" type="http-client-type" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Configuration of HTTP client used for automatic obtaining of certificates containing public keys for IDP signature verification via SAML descriptor of the IDP.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="entityID" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>issuer ID of the IDP.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="signaturesRequired" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>If set to true, the client adapter will sign every document it sends to the IDP. Also, the client will expect that the IDP will be signing any documents sent to it. This switch sets the default for all request and response types.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="signatureAlgorithm" type="signature-algorithm-type" use="optional">
<xs:annotation>
<xs:documentation>Signature algorithm that the IDP expects signed documents to use. Defaults to RSA_SHA256</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="signatureCanonicalizationMethod" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>This is the signature canonicalization method that the IDP expects signed documents to use. The default value is https://www.w3.org/2001/10/xml-exc-c14n# and should be good for most IDPs.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="encryption" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation></xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="sign-on-type">
<xs:attribute name="signRequest" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>Should the client sign authn requests? Defaults to whatever the IDP signaturesRequired element value is.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="validateResponseSignature" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>Should the client expect the IDP to sign the assertion response document sent back from an auhtn request? Defaults to whatever the IDP signaturesRequired element value is.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="validateAssertionSignature" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>Should the client expect the IDP to sign the individual assertions sent back from an auhtn request? Defaults to whatever the IDP signaturesRequired element value is.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="requestBinding" type="binding-type" use="optional">
<xs:annotation>
<xs:documentation>SAML binding type used for communicating with the IDP. The default value is POST, but you can set it to REDIRECT as well.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="responseBinding" type="binding-type" use="optional">
<xs:annotation>
<xs:documentation>SAML allows the client to request what binding type it wants authn responses to use. This value maps to ProtocolBinding attribute in SAML AuthnRequest. The default is that the client will not request a specific binding type for responses.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="bindingUrl" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>This is the URL for the IDP login service that the client will send requests to.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="assertionConsumerServiceUrl" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>URL of the assertion consumer service (ACS) where the IDP login service should send responses to. By default it is unset, relying on the IdP settings. When set, it must end in "/saml". This property is typically accompanied by the responseBinding attribute.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="logout-type">
<xs:attribute name="signRequest" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>Should the client sign authn requests? Defaults to whatever the IDP signaturesRequired element value is.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="signResponse" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>Should the client sign logout responses it sends to the IDP requests? Defaults to whatever the IDP signaturesRequired element value is.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="validateRequestSignature" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>Should the client expect signed logout request documents from the IDP? Defaults to whatever the IDP signaturesRequired element value is.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="validateResponseSignature" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>Should the client expect signed logout response documents from the IDP? Defaults to whatever the IDP signaturesRequired element value is.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="requestBinding" type="binding-type" use="optional">
<xs:annotation>
<xs:documentation>This is the SAML binding type used for communicating SAML requests to the IDP. The default value is POST.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="responseBinding" type="binding-type" use="optional">
<xs:annotation>
<xs:documentation>This is the SAML binding type used for communicating SAML responses to the IDP. The default value is POST.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="postBindingUrl" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>This is the URL for the IDP's logout service when using the POST binding. This setting is REQUIRED if using the POST binding.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="redirectBindingUrl" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>This is the URL for the IDP's logout service when using the REDIRECT binding. This setting is REQUIRED if using the REDIRECT binding.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="http-client-type">
<xs:attribute name="allowAnyHostname" type="xs:boolean" use="optional" default="false">
<xs:annotation>
<xs:documentation>If the the IDP server requires HTTPS and this config option is set to true the IDP's certificate
is validated via the truststore, but host name validation is not done. This setting should only be used during
development and never in production as it will partly disable verification of SSL certificates.
This seting may be useful in test environments. The default value is false.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="clientKeystore" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>This is the file path to a keystore file. This keystore contains client certificate
for two-way SSL when the adapter makes HTTPS requests to the IDP server.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="clientKeystorePassword" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Password for the client keystore and for the client's key.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="connectionPoolSize" type="xs:int" use="optional" default="10">
<xs:annotation>
<xs:documentation>Defines number of pooled connections.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="disableTrustManager" type="xs:boolean" use="optional" default="false">
<xs:annotation>
<xs:documentation>If the the IDP server requires HTTPS and this config option is set to true you do not have to specify a truststore.
This setting should only be used during development and never in production as it will disable verification of SSL certificates.
The default value is false.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="proxyUrl" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>URL to HTTP proxy to use for HTTP connections.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="truststore" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>The value is the file path to a keystore file. If you prefix the path with classpath:,
then the truststore will be obtained from the deployment's classpath instead. Used for outgoing
HTTPS communications to the IDP server. Client making HTTPS requests need
a way to verify the host of the server they are talking to. This is what the trustore does.
The keystore contains one or more trusted host certificates or certificate authorities.
You can create this truststore by extracting the public certificate of the IDP's SSL keystore.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="truststorePassword" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Password for the truststore keystore.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:schema>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak SAML Jetty Integration</name>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<name>Keycloak SAML Client Adapter Modules</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak SAML Tomcat Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -24,13 +24,11 @@ import org.apache.catalina.LifecycleListener;
import org.apache.catalina.authenticator.FormAuthenticator;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.jboss.logging.Logger;
import org.keycloak.adapters.saml.config.parsers.DeploymentBuilder;
import org.keycloak.adapters.saml.config.parsers.ResourceLoader;
import org.keycloak.adapters.spi.AuthChallenge;
import org.keycloak.adapters.spi.AuthOutcome;
import org.keycloak.adapters.spi.HttpFacade;
import org.keycloak.adapters.spi.InMemorySessionIdMapper;
import org.keycloak.adapters.spi.SessionIdMapper;
import org.keycloak.adapters.spi.*;
import org.keycloak.adapters.tomcat.CatalinaHttpFacade;
import org.keycloak.adapters.tomcat.CatalinaUserSessionManagement;
import org.keycloak.adapters.tomcat.GenericPrincipalFactory;
@@ -45,8 +43,8 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.lang.reflect.*;
import java.util.Map;
/**
* Keycloak authentication valve
@@ -59,10 +57,11 @@ public abstract class AbstractSamlAuthenticatorValve extends FormAuthenticator i
public static final String TOKEN_STORE_NOTE = "TOKEN_STORE_NOTE";
private final static Logger log = Logger.getLogger(""+AbstractSamlAuthenticatorValve.class);
private final static Logger log = Logger.getLogger(AbstractSamlAuthenticatorValve.class);
protected CatalinaUserSessionManagement userSessionManagement = new CatalinaUserSessionManagement();
protected SamlDeploymentContext deploymentContext;
protected SessionIdMapper mapper = new InMemorySessionIdMapper();
protected SessionIdMapperUpdater idMapperUpdater = SessionIdMapperUpdater.DIRECT;
@Override
public void lifecycleEvent(LifecycleEvent event) {
@@ -70,7 +69,7 @@ public abstract class AbstractSamlAuthenticatorValve extends FormAuthenticator i
cache = false;
} else if (Lifecycle.AFTER_START_EVENT.equals(event.getType())) {
keycloakInit();
} else if (event.getType() == Lifecycle.BEFORE_STOP_EVENT) {
} else if (Lifecycle.BEFORE_STOP_EVENT.equals(event.getType())) {
beforeStop();
}
}
@@ -103,14 +102,14 @@ public abstract class AbstractSamlAuthenticatorValve extends FormAuthenticator i
//deploymentContext = new SamlDeploymentContext(configResolver);
//log.log(Level.INFO, "Using {0} to resolve Keycloak configuration on a per-request basis.", configResolverClass);
} catch (Exception ex) {
log.log(Level.FINE, "The specified resolver {0} could NOT be loaded. Keycloak is unconfigured and will deny all requests. Reason: {1}", new Object[]{configResolverClass, ex.getMessage()});
log.errorv("The specified resolver {0} could NOT be loaded. Keycloak is unconfigured and will deny all requests. Reason: {1}", configResolverClass, ex.getMessage());
//deploymentContext = new AdapterDeploymentContext(new KeycloakDeployment());
}
} else {
InputStream is = getConfigInputStream(context);
final SamlDeployment deployment;
if (is == null) {
log.info("No adapter configuration. Keycloak is unconfigured and will deny all requests.");
log.error("No adapter configuration. Keycloak is unconfigured and will deny all requests.");
deployment = new DefaultSamlDeployment();
} else {
try {
@@ -126,10 +125,12 @@ public abstract class AbstractSamlAuthenticatorValve extends FormAuthenticator i
}
}
deploymentContext = new SamlDeploymentContext(deployment);
log.fine("Keycloak is using a per-deployment configuration.");
log.debug("Keycloak is using a per-deployment configuration.");
}
context.getServletContext().setAttribute(SamlDeploymentContext.class.getName(), deploymentContext);
addTokenStoreUpdaters();
}
protected void beforeStop() {
@@ -140,8 +141,7 @@ public abstract class AbstractSamlAuthenticatorValve extends FormAuthenticator i
if (xml == null) {
return null;
}
log.finest("**** using " + AdapterConstants.AUTH_DATA_PARAM_NAME);
log.finest(xml);
log.trace("**** using " + AdapterConstants.AUTH_DATA_PARAM_NAME);
return new ByteArrayInputStream(xml.getBytes());
}
@@ -150,13 +150,13 @@ public abstract class AbstractSamlAuthenticatorValve extends FormAuthenticator i
if (is == null) {
String path = context.getServletContext().getInitParameter("keycloak.config.file");
if (path == null) {
log.fine("**** using /WEB-INF/keycloak-saml.xml");
log.trace("**** using /WEB-INF/keycloak-saml.xml");
is = context.getServletContext().getResourceAsStream("/WEB-INF/keycloak-saml.xml");
} else {
try {
is = new FileInputStream(path);
} catch (FileNotFoundException e) {
log.log(Level.SEVERE, "NOT FOUND {0}", path);
log.errorv("NOT FOUND {0}", path);
throw new RuntimeException(e);
}
}
@@ -166,7 +166,7 @@ public abstract class AbstractSamlAuthenticatorValve extends FormAuthenticator i
@Override
public void invoke(Request request, Response response) throws IOException, ServletException {
log.fine("*********************** SAML ************");
log.trace("*********************** SAML ************");
CatalinaHttpFacade facade = new CatalinaHttpFacade(response, request);
SamlDeployment deployment = deploymentContext.resolveDeployment(facade);
if (request.getRequestURI().substring(request.getContextPath().length()).endsWith("/saml")) {
@@ -208,11 +208,11 @@ public abstract class AbstractSamlAuthenticatorValve extends FormAuthenticator i
}
protected boolean authenticateInternal(Request request, HttpServletResponse response, Object loginConfig) throws IOException {
log.fine("authenticateInternal");
log.trace("authenticateInternal");
CatalinaHttpFacade facade = new CatalinaHttpFacade(response, request);
SamlDeployment deployment = deploymentContext.resolveDeployment(facade);
if (deployment == null || !deployment.isConfigured()) {
log.fine("deployment not configured");
log.trace("deployment not configured");
return false;
}
SamlSessionStore tokenStore = getSessionStore(request, facade, deployment);
@@ -225,7 +225,7 @@ public abstract class AbstractSamlAuthenticatorValve extends FormAuthenticator i
protected boolean executeAuthenticator(Request request, HttpServletResponse response, CatalinaHttpFacade facade, SamlDeployment deployment, SamlAuthenticator authenticator) {
AuthOutcome outcome = authenticator.authenticate();
if (outcome == AuthOutcome.AUTHENTICATED) {
log.fine("AUTHENTICATED");
log.trace("AUTHENTICATED");
if (facade.isEnded()) {
return false;
}
@@ -237,13 +237,13 @@ public abstract class AbstractSamlAuthenticatorValve extends FormAuthenticator i
forwardToLogoutPage(request, response, deployment);
}
log.fine("Logging OUT");
log.trace("Logging OUT");
return false;
}
AuthChallenge challenge = authenticator.getChallenge();
if (challenge != null) {
log.fine("challenge");
log.trace("challenge");
challenge.challenge(facade);
}
return false;
@@ -275,8 +275,68 @@ public abstract class AbstractSamlAuthenticatorValve extends FormAuthenticator i
protected SamlSessionStore createSessionStore(Request request, HttpFacade facade, SamlDeployment resolvedDeployment) {
SamlSessionStore store;
store = new CatalinaSamlSessionStore(userSessionManagement, createPrincipalFactory(), mapper, request, this, facade, resolvedDeployment);
store = new CatalinaSamlSessionStore(userSessionManagement, createPrincipalFactory(), mapper, idMapperUpdater, request, this, facade, resolvedDeployment);
return store;
}
protected void addTokenStoreUpdaters() {
SessionIdMapperUpdater updater = getIdMapperUpdater();
try {
String idMapperSessionUpdaterClasses = context.getServletContext().getInitParameter("keycloak.sessionIdMapperUpdater.classes");
if (idMapperSessionUpdaterClasses == null) {
return;
}
for (String clazz : idMapperSessionUpdaterClasses.split("\\s*,\\s*")) {
if (! clazz.isEmpty()) {
updater = invokeAddTokenStoreUpdaterMethod(clazz, updater);
}
}
} finally {
setIdMapperUpdater(updater);
}
}
private SessionIdMapperUpdater invokeAddTokenStoreUpdaterMethod(String idMapperSessionUpdaterClass, SessionIdMapperUpdater previousIdMapperUpdater) {
try {
Class<?> clazz = context.getLoader().getClassLoader().loadClass(idMapperSessionUpdaterClass);
Method addTokenStoreUpdatersMethod = clazz.getMethod("addTokenStoreUpdaters", Context.class, SessionIdMapper.class, SessionIdMapperUpdater.class);
if (! Modifier.isStatic(addTokenStoreUpdatersMethod.getModifiers())
|| ! Modifier.isPublic(addTokenStoreUpdatersMethod.getModifiers())
|| ! SessionIdMapperUpdater.class.isAssignableFrom(addTokenStoreUpdatersMethod.getReturnType())) {
log.errorv("addTokenStoreUpdaters method in class {0} has to be public static. Ignoring class.", idMapperSessionUpdaterClass);
return previousIdMapperUpdater;
}
log.debugv("Initializing sessionIdMapperUpdater class {0}", idMapperSessionUpdaterClass);
return (SessionIdMapperUpdater) addTokenStoreUpdatersMethod.invoke(null, context, mapper, previousIdMapperUpdater);
} catch (ClassNotFoundException ex) {
log.warnv(ex, "Cannot use sessionIdMapperUpdater class {0}", idMapperSessionUpdaterClass);
return previousIdMapperUpdater;
} catch (NoSuchMethodException ex) {
log.warnv(ex, "Cannot use sessionIdMapperUpdater class {0}", idMapperSessionUpdaterClass);
return previousIdMapperUpdater;
} catch (SecurityException ex) {
log.warnv(ex, "Cannot use sessionIdMapperUpdater class {0}", idMapperSessionUpdaterClass);
return previousIdMapperUpdater;
} catch (IllegalAccessException ex) {
log.warnv(ex, "Cannot use {0}.addTokenStoreUpdaters(DeploymentInfo, SessionIdMapper) method", idMapperSessionUpdaterClass);
return previousIdMapperUpdater;
} catch (IllegalArgumentException ex) {
log.warnv(ex, "Cannot use {0}.addTokenStoreUpdaters(DeploymentInfo, SessionIdMapper) method", idMapperSessionUpdaterClass);
return previousIdMapperUpdater;
} catch (InvocationTargetException ex) {
log.warnv(ex, "Cannot use {0}.addTokenStoreUpdaters(DeploymentInfo, SessionIdMapper) method", idMapperSessionUpdaterClass);
return previousIdMapperUpdater;
}
}
public SessionIdMapperUpdater getIdMapperUpdater() {
return idMapperUpdater;
}
public void setIdMapperUpdater(SessionIdMapperUpdater idMapperUpdater) {
this.idMapperUpdater = idMapperUpdater;
}
}
@@ -24,6 +24,7 @@ import org.apache.catalina.realm.GenericPrincipal;
import org.jboss.logging.Logger;
import org.keycloak.adapters.spi.HttpFacade;
import org.keycloak.adapters.spi.SessionIdMapper;
import org.keycloak.adapters.spi.SessionIdMapperUpdater;
import org.keycloak.adapters.tomcat.CatalinaUserSessionManagement;
import org.keycloak.adapters.tomcat.GenericPrincipalFactory;
import org.keycloak.common.util.KeycloakUriBuilder;
@@ -45,17 +46,20 @@ public class CatalinaSamlSessionStore implements SamlSessionStore {
private final CatalinaUserSessionManagement sessionManagement;
protected final GenericPrincipalFactory principalFactory;
private final SessionIdMapper idMapper;
private final SessionIdMapperUpdater idMapperUpdater;
protected final Request request;
protected final AbstractSamlAuthenticatorValve valve;
protected final HttpFacade facade;
protected final SamlDeployment deployment;
public CatalinaSamlSessionStore(CatalinaUserSessionManagement sessionManagement, GenericPrincipalFactory principalFactory,
SessionIdMapper idMapper, Request request, AbstractSamlAuthenticatorValve valve, HttpFacade facade,
SessionIdMapper idMapper, SessionIdMapperUpdater idMapperUpdater,
Request request, AbstractSamlAuthenticatorValve valve, HttpFacade facade,
SamlDeployment deployment) {
this.sessionManagement = sessionManagement;
this.principalFactory = principalFactory;
this.idMapper = idMapper;
this.idMapperUpdater = idMapperUpdater;
this.request = request;
this.valve = valve;
this.facade = facade;
@@ -89,11 +93,13 @@ public class CatalinaSamlSessionStore implements SamlSessionStore {
Session sessionInternal = request.getSessionInternal(false);
if (sessionInternal == null) return;
HttpSession session = sessionInternal.getSession();
List<String> ids = new LinkedList<String>();
if (session != null) {
SamlSession samlSession = (SamlSession)session.getAttribute(SamlSession.class.getName());
if (samlSession != null) {
if (samlSession.getSessionIndex() != null) {
idMapper.removeSession(session.getId());
ids.add(session.getId());
idMapperUpdater.removeSession(idMapper, session.getId());
}
session.removeAttribute(SamlSession.class.getName());
}
@@ -101,6 +107,7 @@ public class CatalinaSamlSessionStore implements SamlSessionStore {
}
sessionInternal.setPrincipal(null);
sessionInternal.setAuthType(null);
logoutSessionIds(ids);
}
@Override
@@ -111,7 +118,7 @@ public class CatalinaSamlSessionStore implements SamlSessionStore {
ids.addAll(sessions);
logoutSessionIds(ids);
for (String id : ids) {
idMapper.removeSession(id);
idMapperUpdater.removeSession(idMapper, id);
}
}
@@ -125,7 +132,7 @@ public class CatalinaSamlSessionStore implements SamlSessionStore {
String sessionId = idMapper.getSessionFromSSO(id);
if (sessionId != null) {
sessionIds.add(sessionId);
idMapper.removeSession(sessionId);
idMapperUpdater.removeSession(idMapper, sessionId);
}
}
@@ -141,7 +148,6 @@ public class CatalinaSamlSessionStore implements SamlSessionStore {
@Override
public boolean isLoggedIn() {
Session session = request.getSessionInternal(false);
if (session == null) return false;
if (session == null) {
log.debug("session was null, returning null");
return false;
@@ -193,7 +199,7 @@ public class CatalinaSamlSessionStore implements SamlSessionStore {
request.setUserPrincipal(principal);
request.setAuthType("KEYCLOAK-SAML");
String newId = changeSessionId(session);
idMapper.map(account.getSessionIndex(), account.getPrincipal().getSamlSubject(), newId);
idMapperUpdater.map(idMapper, account.getSessionIndex(), account.getPrincipal().getSamlSubject(), newId);
}
@@ -0,0 +1,93 @@
/*
* Copyright 2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.adapters.saml;
import org.keycloak.adapters.spi.SessionIdMapper;
import java.util.Objects;
import javax.servlet.http.*;
/**
*
* @author hmlnarik
*/
public class IdMapperUpdaterSessionListener implements HttpSessionListener, HttpSessionAttributeListener {
private final SessionIdMapper idMapper;
public IdMapperUpdaterSessionListener(SessionIdMapper idMapper) {
this.idMapper = idMapper;
}
@Override
public void sessionCreated(HttpSessionEvent hse) {
HttpSession session = hse.getSession();
Object value = session.getAttribute(SamlSession.class.getName());
map(session.getId(), value);
}
@Override
public void sessionDestroyed(HttpSessionEvent hse) {
HttpSession session = hse.getSession();
unmap(session.getId(), session.getAttribute(SamlSession.class.getName()));
}
@Override
public void attributeAdded(HttpSessionBindingEvent hsbe) {
HttpSession session = hsbe.getSession();
if (Objects.equals(hsbe.getName(), SamlSession.class.getName())) {
map(session.getId(), hsbe.getValue());
}
}
@Override
public void attributeRemoved(HttpSessionBindingEvent hsbe) {
HttpSession session = hsbe.getSession();
if (Objects.equals(hsbe.getName(), SamlSession.class.getName())) {
unmap(session.getId(), hsbe.getValue());
}
}
@Override
public void attributeReplaced(HttpSessionBindingEvent hsbe) {
HttpSession session = hsbe.getSession();
if (Objects.equals(hsbe.getName(), SamlSession.class.getName())) {
unmap(session.getId(), hsbe.getValue());
map(session.getId(), session.getAttribute(SamlSession.class.getName()));
}
}
private void map(String sessionId, Object value) {
if (! (value instanceof SamlSession) || sessionId == null) {
return;
}
SamlSession account = (SamlSession) value;
idMapper.map(account.getSessionIndex(), account.getPrincipal().getSamlSubject(), sessionId);
}
private void unmap(String sessionId, Object value) {
if (! (value instanceof SamlSession) || sessionId == null) {
return;
}
SamlSession samlSession = (SamlSession) value;
if (samlSession.getSessionIndex() != null) {
idMapper.removeSession(sessionId);
}
}
}
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.4.0.CR1</version>
<version>2.5.7.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Loaded 100 of 1577 files, more files were not shown because too many files have changed in this diff. Show more