Compare commits

...
892 Commits
Author SHA1 Message Date
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
Stan Silvert 33cd261d83 Merge pull request #3532 from ssilvert/enter-key
KEYCLOAK-3948: Unexpected behavior when pressing Enter with some forms
2016-11-21 14:23:21 -05:00
Stian Thorgersen e515d7bbbe Merge pull request #3531 from stianst/master
Fix travis
2016-11-21 19:30:06 +01:00
Bill Burke 0c05dc093f Merge remote-tracking branch 'upstream/master' 2016-11-21 12:26:24 -05:00
Marek Posolda 68701900d8 Merge pull request #3530 from mposolda/master
KEYCLOAK-3944 Imported legacy LDAP Federation provider doesn't have d…
2016-11-21 18:25:44 +01:00
Stan Silvert ee18d062ab KEYCLOAK-3948: Remove console.info() statements. 2016-11-21 11:48:07 -05:00
Stan Silvert 695213dd31 KEYCLOAK-3948: Unexpected behavior when pressing Enter with some forms 2016-11-21 11:44:58 -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
Stian Thorgersen a52f7f9baa Fix travis 2016-11-21 17:04:39 +01:00
Marek Posolda fc84ffbd65 Merge pull request #3527 from hmlnarik/KEYCLOAK-3469-fix-in-test
KEYCLOAK-3469 Fix in the account test
2016-11-21 16:33:32 +01:00
mposolda 27e5d9672a KEYCLOAK-3944 Imported legacy LDAP Federation provider doesn't have default mappers available 2016-11-21 16:17:49 +01:00
Hynek Mlnarik 8f31425daf KEYCLOAK-3469 Fix in the account test 2016-11-21 16:00:36 +01:00
Marek Posolda 7c4591617b Merge pull request #3524 from hmlnarik/KEYCLOAK-3941
KEYCLOAK-3941 Add dependency to apache httpcomponents to WF/EAP deployments
2016-11-21 15:08:20 +01:00
Marek Posolda c21ab943bb Merge pull request #3525 from mposolda/master
KEYCLOAK-3943 Admin console issues when updating LDAP Storage provider
2016-11-21 15:07:23 +01:00
mposolda d8c8afe070 KEYCLOAK-3943 Admin console issues when updating LDAP Storage provider 2016-11-21 14:22:45 +01:00
Hynek Mlnarik d1a35a5acc KEYCLOAK-3941 2016-11-21 12:15:39 +01:00
Marek Posolda 2d4cda7eda Merge pull request #3522 from mposolda/master
KEYCLOAK-3931 Fix Mongo to have LDAP tests pass
2016-11-21 12:00:30 +01:00
Vaclav Muzikar 5e731d9557 KEYCLOAK-3872 Stabilize PasswordPolicy UI test 2016-11-21 11:31:28 +01:00
mposolda 6df7a80352 KEYCLOAK-3931 Fix Mongo to have LDAP tests pass 2016-11-21 11:25:18 +01:00
Marek Posolda d261bbef88 Merge pull request #3521 from mposolda/master
KEYCLOAK-3936 Fix keycloak-authz-client JDK7 compatibility
2016-11-21 11:05:29 +01:00
mposolda 4fa903a02f KEYCLOAK-3936 Fix keycloak-authz-client JDK7 compatibility 2016-11-21 10:12:23 +01:00
Marek Posolda f0fd9e6137 Merge pull request #3519 from sldab/java7support-adapters
Restore Java 7 compatibility for adapters.
2016-11-21 09:35:25 +01:00
Slawomir Dabek a45ffce118 Restore Java 7 compatibility for adapters. 2016-11-20 22:19:53 +01:00
Marek Posolda c558e7e0b1 Merge pull request #3520 from ramunask/lt-translations-for-2.4
KEYCLOAK-3934 Lithuanian locale update for 2.4 version
2016-11-20 21:07:57 +01:00
Ramunas K bfec70481b translated admin-messages_lt 2016-11-19 23:29:49 +02:00
Marek Posolda a7c8fe4375 Merge pull request #3518 from mposolda/master
KEYCLOAK-3930 KEYCLOAK-3931 LDAP and Mongo fixes
2016-11-18 21:27:58 +01:00
mposolda da52a5c9cf KEYCLOAK-3930 KEYCLOAK-3931 LDAP and Mongo fixes 2016-11-18 20:02:02 +01:00
Marek Posolda 639cf1e038 Merge pull request #3517 from mposolda/master
KEYCLOAK-3895 Make UserSessionProvider and UserSessionPersisterProvid…
2016-11-18 16:31:04 +01:00
mposolda 76bfbad2c4 KEYCLOAK-3895 Make UserSessionProvider and UserSessionPersisterProvider to rely on UserRemovedEvent callbacks 2016-11-18 15:58:33 +01:00
Stian Thorgersen cca352fa9f Merge pull request #3516 from stianst/KEYCLOAK-3881
KEYCLOAK-3881 Fix login status iframe with * origin
2016-11-18 14:09:02 +01:00
Stian Thorgersen 7043ecc21b KEYCLOAK-3881 Fix login status iframe with * origin 2016-11-18 12:50:52 +01:00
Marek Posolda c384b8a81f Merge pull request #3515 from mposolda/master
KEYCLOAK-3928 KEYCLOAK-3880 Fix UserFederation providers list in admi…
2016-11-18 12:26:33 +01:00
mposolda 747738c0fc KEYCLOAK-3928 KEYCLOAK-3880 Fix UserFederation providers list in admin console 2016-11-18 11:57:57 +01:00
Marek Posolda 3e71aeddf3 Merge pull request #3479 from hmlnarik/KEYCLOAK-3469-UserRealmRoleMapper
KEYCLOAK-3469 Make role mappers account for user groups
2016-11-18 09:21:56 +01:00
Marek Posolda a2e00e4c3b Merge pull request #3497 from vramik/KEYCLOAK-3899
KEYCLOAK-3899 Make migration properties available in tests
2016-11-18 09:12:10 +01:00
Marek Posolda 2c6e9be8e5 Merge pull request #3504 from vramik/KEYCLOAK-3907
KEYCLOAK-3907 Test backwards compatibility of realm import
2016-11-18 09:10:59 +01:00
Marek Posolda fce41c0ab8 Merge pull request #3507 from mhajas/KEYCLOAK-3916
KEYCLOAK-3916 Remove classes with missing parent
2016-11-18 09:02:10 +01:00
Marek Posolda ca5c806f58 Merge pull request #3513 from pedroigor/KEYCLOAK-3830
[KEYCLOAK-3830] - Properly handle public resources when using security-constraints
2016-11-18 08:59:21 +01:00
Marek Posolda 1e8f5f1a51 Merge pull request #3514 from pedroigor/KEYCLOAK-3674
[KEYCLOAK-3674] - Review policies dropbox options
2016-11-18 08:56:56 +01:00
Marek Posolda b434c2b9cf Merge pull request #3510 from ssilvert/delete-subflows
KEYCLOAK-3681: Delete top flow doesn't remove all subflows
2016-11-18 08:50:13 +01:00
Marek Posolda 60afd280c3 Merge pull request #3512 from abstractj/KEYCLOAK-3918
[KEYCLOAK-3918] - Server won't boot on Windows
2016-11-18 08:44:37 +01:00
Pedro Igor 9b2ef96b22 [KEYCLOAK-3830] - Allow to configure enforcement-mode to a path definition 2016-11-17 20:50:28 -02:00
Pedro Igor 44ee53b0d8 [KEYCLOAK-3830] - Only enforce permissions when there is a KeycloakSecurityContext. 2016-11-17 20:50:17 -02:00
Pedro Igor Craveiro e Silva cc9131441e [KEYCLOAK-3674] - Review policies dropbox options 2016-11-17 20:43:32 -02:00
Marek Posolda 5e496fb9bb Merge pull request #3511 from mposolda/ispn-invalidations-rebase
KEYCLOAK-3857 Clustered invalidation cache fixes and refactoring. Sup…
2016-11-16 23:10:48 +01:00
Bruno Oliveira 5c089e45d4 [KEYCLOAK-3918] - Server won't boot on Windows 2016-11-16 19:37:48 -02:00
mposolda a27be0cee7 KEYCLOAK-3857 Clustered invalidation cache fixes and refactoring. Support for cross-DC for invalidation caches. 2016-11-16 22:29:23 +01:00
Stan Silvert a0ae8c126e Add comment to test 2016-11-16 12:45:34 -05:00
Stan Silvert 55556fc63c KEYCLOAK-3681: Delete top flow doesn't remove all subflows 2016-11-16 12:43:11 -05:00
mhajas 8fc5b00d91 KEYCLOAK-3653 Tests for cert endpoint 2016-11-16 15:31:48 +01:00
mhajas 475c6403cc KEYCLOAK-3916 Remove classes with missing parent 2016-11-16 15:27:35 +01:00
Stian Thorgersen cf17687b8b Merge pull request #3506 from abstractj/KEYCLOAK-3913
[KEYCLOAK-3913] - Native libraries included within SSSD jar
2016-11-16 14:56:53 +01:00
Vlasta Ramik 50339f6f0e Test backwards compatibility of realm import 2016-11-16 13:17:04 +01:00
Stian Thorgersen 26b1541f4a Merge pull request #3476 from abstractj/KEYCLOAK-3875
[KEYCLOAK-3875] - Conditional OTP Forms not working as expected
2016-11-16 12:44:50 +01:00
Stian Thorgersen 1c3a475d1e Merge pull request #3485 from hmlnarik/KEYCLOAK-3071
KEYCLOAK-3071 Add SOAP and PAOS endpoints to valid redirect URIs on SP import
2016-11-16 12:38:45 +01:00
Stian Thorgersen 65136fabdd Merge pull request #3486 from hmlnarik/KEYCLOAK-3488
KEYCLOAK-3488 Fix typo in SamlPrincipal
2016-11-16 12:21:50 +01:00
Stian Thorgersen 70d1ac7162 Merge pull request #3505 from vramik/KEYCLOAK-3910
KEYCLOAK-3910 review clean-start tests
2016-11-16 12:21:21 +01:00
Stian Thorgersen b1f35ff974 Merge pull request #3491 from hmlnarik/KEYCLOAK-3087-XmlEncryptionUtil
KEYCLOAK-3087 XmlEncryptionUtil cleanup, 3DES removal
2016-11-16 12:17:26 +01:00
Stian Thorgersen f5d4554b39 Merge pull request #3494 from stianst/KEYCLOAK-3882
KEYCLOAK-3882 Move more provider factories and SPIs to private
2016-11-16 12:16:18 +01:00
Bruno Oliveira 8a0cb507c5 [KEYCLOAK-3913] - Native libraries included within SSSD jar
- Revert "[KEYCLOAK-3580] - Migrate DBus Java from Unix Socket C library to jnr-unixsocket"
    This reverts commit 6c5d1b9214.
  - Use JNA RPM, instead of Maven
2016-11-16 09:14:05 -02:00
Stian Thorgersen 89a43b8771 Merge pull request #3466 from melahn/update-maven-version
updated requireMavenVersion in parent pom to 3.2.1
2016-11-16 12:13:48 +01:00
Stian Thorgersen 83571dba5d Merge pull request #3495 from rigon/patch-2
Update README.md
2016-11-16 12:13:00 +01:00
Pedro Igor a6d59faf98 Merge pull request #3503 from pedroigor/KEYCLOAK-3339
[KEYCLOAK-3339] - Enable authorization services to EAP6 adapter
2016-11-16 08:38:44 -02:00
Stan Silvert 9512180406 Merge pull request #3502 from ssilvert/hide-role-selector
KEYCLOAK-3905: Role selector sometimes displayed when client full scope
2016-11-15 10:24:01 -05:00
Vlasta Ramik 0f0f20716f Review clean-start tests 2016-11-15 14:29:13 +01:00
Stian Thorgersen b4f072ed81 KEYCLOAK-3882 Move more provider factories and SPIs to private 2016-11-15 12:05:25 +01:00
Pedro Igor 394a9daa64 [KEYCLOAK-3906] - Update IP-BOM 6.0.10.Final 2016-11-15 01:03:35 +00:00
Pedro Igor a3beef754c [KEYCLOAK-3339] - Enable authorization services to EAP6 adapter 2016-11-15 00:26:29 +00:00
Bill Burke 94afba91a0 Merge pull request #3501 from patriot1burke/master
LDAP port to UserStorageSPI
2016-11-14 17:24:39 -05:00
Bill Burke 8794416241 fix db2 2016-11-14 16:22:30 -05:00
Bill Burke f471ad46c9 fix server-private spi changes 2016-11-14 15:28:08 -05:00
Marek Posolda 989a701e95 Merge pull request #3498 from hmlnarik/KEYCLOAK-3734
KEYCLOAK-3734 Unify master changelog of DB2 and other databases
2016-11-14 21:18:27 +01:00
Marek Posolda 37c1c84e04 Merge pull request #3499 from abstractj/KEYCLOAK-3900
[KEYCLOAK-3900] - SSSD Provider: NullPointerException when SSSD is stopped
2016-11-14 21:16:19 +01:00
Bill Burke 39ffd3d756 fix pom 2016-11-14 15:15:20 -05:00
Stan Silvert b920c7b2c4 KEYCLOAK-3905: Role selector sometimes displayed when client full scope
enabled
2016-11-14 15:11:22 -05:00
Pedro Igor a2c54b03c8 Merge pull request #3500 from pedroigor/KEYCLOAK-3554-new
[KEYCLOAK-3554] - Properly handle dependencies between policies when importing settings
2016-11-14 18:10:37 -02:00
Bill Burke 7666387277 rename directory 2016-11-14 15:10:35 -05:00
Bill Burke cc0eb47814 merge 2016-11-14 15:09:41 -05:00
Bill Burke c280634bfa fix tests 2016-11-14 15:06:17 -05:00
Pedro Igor fb1cd9d27d [KEYCLOAK-3554] - Properly handle dependencies between policies when importing settings 2016-11-14 18:55:53 +00:00
Bruno Oliveira b612415a88 [KEYCLOAK-3900] - SSSD Provider: NullPointerException when SSSD is stopped 2016-11-14 16:04:18 -02:00
Hynek Mlnarik 223041bc6b KEYCLOAK-3734 Unify master changelog of DB2 and other databases 2016-11-14 15:19:54 +01:00
Vlasta Ramik ab0514041e Make migration properties available in tests 2016-11-14 13:09:03 +01:00
Hynek Mlnarik 750e942267 KEYCLOAK-3469 Make role mappers account for user groups 2016-11-14 11:38:00 +01:00
Hynek Mlnarik 17c13043d0 KEYCLOAK-3087 XmlEncryptionUtil cleanup, 3DES removal 2016-11-14 10:26:39 +01:00
Gregory Melahn 750075d0dd Will update the README.md file instead
This reverts commit b58bfe56d6.
2016-11-13 12:40:45 -05:00
Gregory Melahn 9df43e3bd2 Merge branch 'update-maven-version' of https://github.com/melahn/keycloak into update-maven-version 2016-11-13 12:25:30 -05:00
Gregory Melahn d1eaace4cf fixed maven prereq version to match pom 2016-11-13 12:24:01 -05:00
Bruno Oliveira 39f40bc005 [KEYCLOAK-3875] - Conditional OTP Forms not working as expected 2016-11-11 15:16:08 -02:00
Stian Thorgersen 6c64494620 Merge pull request #3493 from stianst/master
Try to fix Travis
2016-11-11 17:00:25 +01:00
Stian Thorgersen c9e3fe9a92 Try to fix Travis 2016-11-11 17:00:11 +01:00
Bill Burke 4ce055cede mongo ldap migration script 2016-11-11 09:06:25 -05:00
Ricardo Gonçalves 1e65174867 Update README.md 2016-11-11 12:30:42 +00:00
Pavel Drozd 1052c71124 Merge pull request #3488 from vramik/KEYCLOAK-3885
KEYCLOAK-3885 Add missing migration test for 2.3.0
2016-11-11 09:46:03 +01:00
Stian Thorgersen a86b5988b5 Merge pull request #3484 from hmlnarik/KEYCLOAK-3658
KEYCLOAK-3658 Fixed typo in condition
2016-11-11 09:41:48 +01:00
Stian Thorgersen 088f0ea630 Merge pull request #3490 from stianst/KEYCLOAK-3086
[KEYCLOAK-3086] -  NPE when accessing Account with invalid clientId s…
2016-11-11 09:35:45 +01:00
Stian Thorgersen 08dbdeb57f Merge pull request #3489 from stianst/KEYCLOAK-3882
KEYCLOAK-3882 Split server-spi into server-spi and server-spi-private
2016-11-11 09:35:08 +01:00
Bill Burke 8a5f817030 ldap jpa migration 2016-11-10 16:52:18 -05:00
Bruno Oliveira 675faee593 [KEYCLOAK-3086] - NPE when accessing Account with invalid clientId set as ?referrer, and additional referrer_uri set 2016-11-10 13:49:40 +01:00
Stian Thorgersen 7e33f4a7d1 KEYCLOAK-3882 Split server-spi into server-spi and server-spi-private 2016-11-10 13:28:42 +01:00
Vlasta Ramik 71c88a8dfc Add missing migration test for 2.3.0 2016-11-10 11:02:26 +01:00
Stian Thorgersen 52a4509ada Merge pull request #3483 from hmlnarik/KEYCLOAK-3870-keycloak-saml-xsd
KEYCLOAK-3870 Schema for keycloak-saml.xml
2016-11-10 08:20:24 +01:00
Stian Thorgersen 1ee6df412e Merge pull request #3482 from vramik/KEYCLOAK-2741
KEYCLOAK-2741 remove KEYCLOAK_REMEMBERME when user logs in without rememberme checked
2016-11-10 07:45:07 +01:00
Bill Burke 94076a3b24 admin console ui 2016-11-09 17:34:07 -05:00
Hynek Mlnarik 43002f7a8a KEYCLOAK-3488 Fix typo 2016-11-09 15:11:45 +01:00
Hynek Mlnarik 8816b55843 KEYCLOAK-3071 Add SOAP and PAOS endpoints to valid redirect URIs on SP import 2016-11-09 14:13:53 +01:00
Hynek Mlnarik 9c724b616d KEYCLOAK-3658 Fixed typo in condition 2016-11-09 11:27:33 +01:00
Hynek Mlnarik 025cf5ebaf KEYCLOAK-3870 Schema for keycloak-saml.xml
Updated schema schema for keycloak-saml.xml (added documentation, set
up enumeration instead of free string where applicable per documentation)
and updated existing keycloak-saml.xml files with schema reference.
2016-11-09 10:45:43 +01:00
Vlasta Ramik 6f1b8e1fee remove KEYCLOAK_REMEMBERME when user logs in without rememberme checked + tests 2016-11-09 10:33:46 +01:00
Stan Silvert 80b071024f KEYCLOAK-2720: Add unique constraint 2016-11-08 15:05:19 -05:00
Bill Burke 4880c0443c ldap port admin console 2016-11-08 12:30:20 -05:00
Pavel Drozd c05057748f Merge pull request #3474 from vramik/KEYCLOAK-3489
KEYCLOAK-3489 migration tests - minor fix
2016-11-08 15:38:14 +01:00
Stian Thorgersen de7006a048 Merge pull request #3473 from hmlnarik/KEYCLOAK-3215
KEYCLOAK-3215 Use RSA-OAEP for key encryption
2016-11-08 10:16:54 +01:00
Vlasta Ramik 2b6811a366 migration tests - minor fix 2016-11-08 09:48:15 +01:00
Pavel Drozd 10f9800327 Merge pull request #3469 from mhajas/KEYCLOAK-3853
KEYCLOAK-3853 Fix keyRotation adapter test
2016-11-08 08:34:11 +01:00
Stian Thorgersen 292777259e Merge pull request #3472 from hmlnarik/KEYCLOAK-1881-saml-key-rotation
Keycloak 1881 - SAML key/cert rotation for IdP
2016-11-08 07:56:25 +01:00
Hynek Mlnarik 01c42f9359 KEYCLOAK-3215 Use RSA-OAEP for key encryption 2016-11-08 07:44:59 +01:00
Stian Thorgersen ef48594d85 Merge pull request #3470 from sebastienblanc/KEYCLOAK-3548
KEYCLOAK-3548 : Send 401 when no keycloak.json for EAP6/AS7 Adapter
2016-11-08 07:37:00 +01:00
Stian Thorgersen c9a58fad15 Merge pull request #3464 from stianst/KEYCLOAK-3692
KEYCLOAK-3692
2016-11-08 07:36:39 +01:00
Stian Thorgersen 5b54375490 Merge pull request #3468 from sebastienblanc/KEYCLOAK-3514
KEYCLOAK-3514 : fix servlet logout on bearer-only client
2016-11-08 07:35:44 +01:00
Stian Thorgersen db4f3561a5 Merge pull request #3454 from ssilvert/keystore-error-messages
KEYCLOAK-3817: More detailed errors when loading keys from JKS
2016-11-08 07:33:43 +01:00
Bill Burke f138eecc27 port KerberosLdapTest 2016-11-06 09:15:49 -05:00
Bill Burke 5a86623c88 merge 2016-11-06 08:52:10 -05:00
Bill Burke 14dc0ff92f Merge remote-tracking branch 'upstream/master' 2016-11-05 20:05:01 -04:00
Bill Burke 4302b440ee ldap port 2016-11-05 20:04:53 -04:00
Bill Burke c75dcb90c2 ldap port 2016-11-04 21:25:47 -04:00
Stan Silvert 3efd103712 KEYCLOAK-2720: Fix PermissionsTest 2016-11-04 19:05:32 -04:00
Stan Silvert f922164a88 Merge pull request #3471 from ssilvert/otp-low-res
KEYCLOAK-3816: Tweak CSS for 1280 x 720 display
2016-11-04 17:10:22 -04:00
Hynek Mlnarik 36257863db KEYCLOAK-1881 Integration tests for key rotation in SAML IdP 2016-11-04 21:53:43 +01:00
Hynek Mlnarik 14f96fdb4b KEYCLOAK-1881 Wildfly, AS7, EAP Adapters 2016-11-04 21:53:43 +01:00
Hynek Mlnarik 570d71c07b KEYCLOAK-1881 Update client adapter configuration
Client adapter configuration was updated to support for customization
of HttpClient used for key retrieval similarly to OIDC. Further, it is
now possible to specify several static public keys for signature
verification in saml-client.xml.
2016-11-04 21:53:43 +01:00
Hynek Mlnarik 8ae1b1740d KEYCLOAK-1881 Client installers 2016-11-04 21:53:43 +01:00
Hynek Mlnarik 4f9e35c0a1 KEYCLOAK-1881 Support for multiple certificates in broker (hardcoded at the moment) 2016-11-04 21:53:43 +01:00
Hynek Mlnarik 67bb9aef3d KEYCLOAK-1881 Add switch to enable/disable generation of <Extensions>
Some SP clients might be confused by using a standard SAML protocol tag
<Extensions> which is used for signed REDIRECT binding messages to
specify signing key ID. To enable the interoperability, generation of
the tag is disabled by default and can be enabled for individual
clients.
2016-11-04 21:53:43 +01:00
Hynek Mlnarik 1ae268ec6f KEYCLOAK-1881 Include key ID for REDIRECT and use it for validation
Contrary to POST binding, signature of SAML protocol message sent using
REDIRECT binding is contained in query parameters and not in the
message. This renders <dsig:KeyName> key ID hint unusable. This commit
adds <Extensions> element in SAML protocol message containing key ID so
that key ID is present in the SAML protocol message.
2016-11-04 21:53:43 +01:00
Hynek Mlnarik 10deac0b06 KEYCLOAK-1881 KeyLocator implementation for SAML descriptor 2016-11-04 21:53:43 +01:00
Hynek Mlnarik 057cc37b60 KEYCLOAK-1881 Clone OIDC adapter HttpClient tools to SAML adapter
and
KEYCLOAK-1881 Extract httpclient configuration from AdapterConfig
2016-11-04 21:53:43 +01:00
Hynek Mlnarik 70a8255eae KEYCLOAK-1881 Basic key locator support 2016-11-04 21:53:43 +01:00
Hynek Mlnarik d5c3bde0af KEYCLOAK-1881 Make SAML descriptor endpoint return all certificates 2016-11-04 21:53:43 +01:00
Hynek Mlnarik 5d840500af KEYCLOAK-1881 Include key ID in <ds:KeyInfo> in SAML assertions and protocol message
Changes of SAML assertion creation/parsing that are required to allow
for validation of rotating realm key: signed SAML assertions and signed
SAML protocol message now contain signing key ID in XML <dsig:KeyName>
element.
2016-11-04 21:53:43 +01:00
Hynek Mlnarik 904a5c3ca5 KEYCLOAK-3864 Add support for SAML2 <Extensions> element in protocol messages 2016-11-04 21:53:43 +01:00
Stan Silvert 66698f60d4 KEYCLOAK-3816: Tweak CSS for 1280 x 720 display 2016-11-04 15:32:19 -04:00
Stan Silvert 3035cbc5db KEYCLOAK-2720: Unit test 2016-11-04 13:11:06 -04:00
sebastien blanc 6c18b300a4 add integration test 2016-11-04 07:39:22 +01:00
Stian Thorgersen 6baf9b89fe Merge pull request #3467 from abstractj/KEYCLOAK-3580
[KEYCLOAK-3580] - Migrate DBus Java from Unix Socket C library to jnr-unixsocket
2016-11-04 05:57:02 +01:00
mhajas fd5f7eb165 KEYCLOAK-3853 Fix keyRotation adapter test 2016-11-03 16:04:31 +01:00
sebastien blanc 76c37de1e8 KEYCLOAK-3545: Send 401 if no kc configuration in EAP6/AS7 2016-11-03 15:39:02 +01:00
Pavel Drozd c3f3c5c6a5 Merge pull request #3453 from vramik/KEYCLOAK-2957
KEYCLOAK-2957 test
2016-11-03 15:26:14 +01:00
Pavel Drozd f2b28d8215 Merge pull request #3456 from vramik/KEYCLOAK-3579
KEYCLOAK-3579 add preview profile assumption to tests
2016-11-03 15:25:17 +01:00
Pavel Drozd 672f5d879b Merge pull request #3465 from mhajas/KEYCLOAK-3854
KEYCLOAK-3854 KEYCLOAK-3579 Move EnfrocerConfigTest out from adapter tests
2016-11-03 15:23:39 +01:00
Pavel Drozd 20a6795f74 Merge pull request #3458 from tkyjovsk/KEYCLOAK-3849
KEYCLOAK-3849 Add ability to select keycloak profile in testsuite
2016-11-03 15:21:22 +01:00
Pavel Drozd c1ef4067bc Merge pull request #3459 from mhajas/KEYCLOAK-3850
KEYCLOAK-3850 Fix test-apps-dist zip file name
2016-11-03 15:18:11 +01:00
Pavel Drozd c1fb71c031 Merge pull request #3463 from mhajas/KEYCLOAK-3841
KEYCLOAK-3841 Remove missing dependency
2016-11-03 15:15:57 +01:00
Pavel Drozd 136f3bc5f9 Merge pull request #3457 from mhajas/KEYCLOAK-3728
KEYCLOAK-3728 Test for turned off script based authenticators
2016-11-03 15:15:32 +01:00
Stian Thorgersen 2052a0dff1 Fix 2016-11-03 14:37:07 +01:00
sebastien blanc ee8c986e8e add integration test 2016-11-03 14:30:42 +01:00
Gregory Melahn b58bfe56d6 updated requireMavenVersion in parent pom to 3.2.1 2016-11-03 08:26:27 -04:00
Bruno Oliveira 6c5d1b9214 [KEYCLOAK-3580] - Migrate DBus Java from Unix Socket C library to jnr-unixsocket 2016-11-03 10:25:45 -02:00
Pedro Igor 97be09a3bc Merge pull request #3462 from pedroigor/KEYCLOAK-3704
[KEYCLOAK-3704] - Owner validation and removal
2016-11-03 09:20:16 -02:00
mhajas 6605ba1362 KEYCLOAK-3854 Move EnfrocerConfigTest out from adapter tests 2016-11-03 09:43:49 +01:00
Stian Thorgersen ac18b6c71e KEYCLOAK-3692 2016-11-03 08:33:56 +01:00
mhajas d9069e0955 KEYCLOAK-3841 Remove missing dependency 2016-11-03 08:27:13 +01:00
Stan Silvert 3f98f23422 Merge pull request #3460 from ssilvert/otp-low-res
KEYCLOAK-3816: Broken OTP setup with smaller resolutions
2016-11-02 20:25:19 -04:00
Pedro Igor 706c1e2660 [KEYCLOAK-3704] - Registering UserSinchronizer to remove resources when the owner is removed 2016-11-02 21:40:58 -02:00
Pedro Igor 95d2130405 [KEYCLOAK-3704] - Checkign if owner is a valid user 2016-11-02 21:01:24 -02:00
Pedro Igor 683428a2c2 Merge pull request #3461 from pedroigor/KEYCLOAK-3555
[KEYCLOAK-3555] - Filtering photoz authz config file to update project version
2016-11-02 20:59:03 -02:00
Pedro Igor a315919dfc [KEYCLOAK-3555] - Filtering photoz authz config file to update project version. 2016-11-02 18:11:30 -02:00
Stan Silvert 1b89472451 KEYCLOAK-3817: Fix tests 2016-11-02 14:21:54 -04:00
Stan Silvert ae2a1e929f KEYCLOAK-3816: Broken OTP setup with smaller resolutions 2016-11-02 13:53:15 -04:00
mhajas ad995934b0 KEYCLOAK-3728 Test for turned off script based authenticators 2016-11-02 16:51:55 +01:00
mhajas c5b6507830 KEYCLOAK-3850 Fix test-apps-dist zip file name 2016-11-02 16:49:25 +01:00
Tomas Kyjovsky d7c5f991c8 KEYCLOAK-3579: added ability to select keycloak.profile in testsuite 2016-11-02 15:58:01 +01:00
Vlasta Ramik cef1973ee4 KEYCLOAK-3579 add preview profile assumption to tests 2016-11-02 14:22:03 +01:00
sebastien blanc d98c375495 KEYCLOAK-3514 : Don't call logout for bearer-only client 2016-11-02 11:39:37 +01:00
Pavel Drozd da516a78b3 Merge pull request #3450 from mhajas/KEYCLOAK-3841
KEYCLOAK-3841 Testing of Hawtio console on EAP6 + Fuse integration
2016-11-02 10:54:52 +01:00
Pavel Drozd a0f359c93c Merge pull request #3452 from mhajas/KEYCLOAK-3142
KEYCLOAK-3142 Check ResourceType in AdminEvent test
2016-11-02 10:27:54 +01:00
Pedro Igor 4bf5da8fac Merge pull request #3371 from brewers/bug/cache-dynamic-resource
KEYCLOAK-3752 : Include programmatically created resources in the resource cache
2016-11-02 07:19:04 -02:00
Pedro Igor 44977207e3 Merge pull request #3402 from brewers/feature/js-entitlement-request
KEYCLOAK-3777: Add client api for requesting entitlements with permission requests
2016-11-02 07:15:02 -02:00
Stan Silvert facdd586a3 KEYCLOAK-2720: Should not allow two groups with the same path. 2016-11-01 16:08:30 -04:00
Pavel Drozd 893963f339 Merge pull request #3449 from vramik/KEYCLOAK-3489
KEYCLOAK-3489 add profile to tests module for testing migration for productized version
2016-11-01 19:10:13 +01:00
Stan Silvert a5e5f4cf9c KEYCLOAK-3817: More detailed errors when loading keys from JKS 2016-11-01 13:54:34 -04:00
Vlasta Ramik fdb7924d3f add test for KEYCLOAK-2957 to arquillian testsuite 2016-11-01 11:31:19 +01:00
mhajas 782620655f KEYCLOAK-3142 Check ResourceType in AdminEvent test 2016-11-01 11:09:43 +01:00
mhajas 446b57b827 KEYCLOAK-3841 Testing of Hawtio console on EAP6 + fuse integration 2016-10-31 14:35:13 +01:00
Pavel Drozd 2c287af977 Merge pull request #3432 from zschwarz/tech-preview-profile
RHSSO-473 Add preview profile job to RH-SSO CI
2016-10-31 11:24:24 +01:00
Vlasta Ramik 4bd567e610 add profile to tests module for testing migration for productized version 2016-10-31 09:29:16 +01:00
Stan Silvert 35b0872ed9 Merge pull request #3447 from ssilvert/enter-doesnt-submit
KEYCLOAK-3281: Pressing Enter in Identity Provider form causes error
2016-10-28 13:22:20 -04:00
Stan Silvert 89348af59e KEYCLOAK-3281: Pressing Enter in Identity Provider form causes error 2016-10-28 12:06:53 -04:00
Bill Burke ccaac40863 Merge pull request #3437 from patriot1burke/master
disable credential type REST and admin ui
2016-10-28 11:33:16 -04:00
Stian Thorgersen 33bd7ca45f Merge pull request #3446 from mstruk/KEYCLOAK-3767
KEYCLOAK-3767 kcreg should show hint for help if required arguments are missing
2016-10-28 14:56:24 +02:00
Marko Strukelj 408850e7bd KEYCLOAK-3767 kcreg should show hint for help if required arguments are missing 2016-10-28 11:54:48 +02:00
Stian Thorgersen f4a77c3d06 Merge pull request #3444 from stianst/KEYCLOAK-3225
KEYCLOAK-3225
2016-10-28 11:51:35 +02:00
Stian Thorgersen 3ea555bae6 Merge pull request #3443 from stianst/KEYCLOAK-3606
KEYCLOAK-3606
2016-10-28 11:51:21 +02:00
Stian Thorgersen c543035f5a Merge pull request #3442 from stianst/KEYCLOAK-3726
KEYCLOAK-3726
2016-10-28 11:51:03 +02:00
Stian Thorgersen b6b567f948 Merge pull request #3441 from stianst/KEYCLOAK-3733
KEYCLOAK-3733 Set default max results for paginated endpoints
2016-10-28 10:36:24 +02:00
Stian Thorgersen 479295cfd2 KEYCLOAK-3225
Modifying user's Identity Provider Links requires manage-realm client role
2016-10-28 10:25:41 +02:00
Stian Thorgersen a78cfa4b2c Merge pull request #3440 from stianst/KEYCLOAK-3667
KEYCLOAK-3667
2016-10-28 10:13:06 +02:00
Stian Thorgersen c6caeb3bec Merge pull request #3439 from stianst/KEYCLOAK-3828
KEYCLOAK-3828
2016-10-28 10:12:51 +02:00
Stian Thorgersen 5f58c96258 KEYCLOAK-3606
keycloak.js calls localStorage.key(localStorage.length) indirectly
2016-10-28 10:05:57 +02:00
Stian Thorgersen bb1d255c40 KEYCLOAK-3726
Add supported WildFly version to server overlay
2016-10-28 09:43:51 +02:00
Stian Thorgersen a9d47287ee KEYCLOAK-3733 Set default max results for paginated endpoints 2016-10-28 09:15:05 +02:00
Stian Thorgersen 3d46b4c425 KEYCLOAK-3667 2016-10-28 08:43:24 +02:00
Stian Thorgersen db428dad1d KEYCLOAK-3828
Component uses wrong role
2016-10-28 07:56:44 +02:00
Stian Thorgersen 4cc44bc174 Merge pull request #3420 from bdalenoord/master
KEYCLOAK-3807: Calling 'setHandler' is forbidden
2016-10-28 06:45:47 +02:00
Stian Thorgersen 3e5f490882 Merge pull request #3424 from sebastienblanc/KEYCLOAK-3669
KEYCLOAK-3669: Fix Tomcat Adapter for 8.5.5
2016-10-28 06:45:01 +02:00
Stian Thorgersen 7579606ac4 Merge pull request #3431 from mstruk/KEYCLOAK-3766
KEYCLOAK-3766 kcreg should display help when no arguments are passed to command
2016-10-28 06:44:07 +02:00
Stian Thorgersen ee4712b2e9 Merge pull request #3434 from sebastienblanc/KEYCLOAK-3796
KEYCLOAK-3796 : add missing setters
2016-10-28 06:42:59 +02:00
Stian Thorgersen 2d1a458f5d Merge pull request #3408 from hmlnarik/KEYCLOAK-3793
KEYCLOAK-3793 Replace httpclient 4.4 calls with those available in 4.3
2016-10-28 06:41:48 +02:00
Stian Thorgersen e958bd254a Merge pull request #3435 from stianst/KEYCLOAK-3331
KEYCLOAK-3331 Reset password leads to 400 bad request when link is op…
2016-10-28 06:40:48 +02:00
Stian Thorgersen 0c6b47b9f2 Merge pull request #3433 from stianst/KEYCLOAK-3641
KEYCLOAK-3641 Clicking an invalid verification link due to re-send re…
2016-10-28 06:40:27 +02:00
Bill Burke 4cea1919f6 Merge remote-tracking branch 'upstream/master' 2016-10-27 16:17:12 -04:00
Bill Burke 91da6a47d7 disable cred types ui 2016-10-27 16:17:02 -04:00
Marek Posolda f13d759a61 Merge pull request #3436 from mposolda/master
KEYCLOAK-3800 Weird behavior when adding Trusted Hosts as Client Regi…
2016-10-27 21:23:54 +02:00
mposolda 21e423ad5f KEYCLOAK-3800 Weird behavior when adding Trusted Hosts as Client Registration Policy 2016-10-27 18:56:05 +02:00
Stian Thorgersen c6ac3266f0 KEYCLOAK-3641 Clicking an invalid verification link due to re-send removes the email verification key from the session 2016-10-27 16:16:52 +02:00
sebastien blanc 621d234adc renaming fields to align with json names 2016-10-27 16:16:30 +02:00
Stian Thorgersen ab72b2b141 KEYCLOAK-3331 Reset password leads to 400 bad request when link is opened in a different browser session 2016-10-27 16:04:45 +02:00
sebastien blanc e8dd05619b KEYCLOAK-3796 : add missing setters 2016-10-27 14:41:52 +02:00
zschwarz 25909b5e79 RHSSO-473 Add preview profile job to RH-SSO CI 2016-10-27 13:09:20 +02:00
Marko Strukelj 5925a99800 KEYCLOAK-3766 kcreg should display help when no arguments are passed to command 2016-10-27 11:08:36 +02:00
Bill Burke 6e773c84e8 Merge remote-tracking branch 'upstream/master' 2016-10-26 15:48:55 -04:00
Bill Burke 73e3f2a89b REST API for disable cred type 2016-10-26 15:48:45 -04:00
Bill Burke 69dddfa73a Merge pull request #3428 from patriot1burke/master
storage link on user detail
2016-10-26 14:58:33 -04:00
Stan Silvert 3b8972e027 Merge pull request #3423 from ssilvert/otp-low-res
KEYCLOAK-3816: Broken OTP setup with smaller resolutions
2016-10-26 13:58:29 -04:00
Stan Silvert 50b181e804 Merge pull request #3427 from ssilvert/highlight-menu
KEYCLOAK-3795: Hightlight not working in nav sidebar
2016-10-26 09:29:34 -04:00
Stian Thorgersen 21459d0f43 Merge pull request #3430 from stianst/KEYCLOAK-3819
KEYCLOAK-3819 Add support to change name of components
2016-10-26 11:39:27 +02:00
Stian Thorgersen fbe1fd8f98 Merge pull request #3429 from stianst/KEY-FIXES
Various fixes for key providers
2016-10-26 11:38:33 +02:00
Stian Thorgersen a8c844828d KEYCLOAK-3819 Add support to change name of components 2016-10-26 10:00:58 +02:00
Stian Thorgersen c0959fc562 KEYCLOAK-3808 Fix enable and active switches on default provider 2016-10-26 09:49:18 +02:00
Stian Thorgersen 6a86bb8ebe KEYCLOAK-3809 Add required to display name for key provider 2016-10-26 09:38:57 +02:00
Stian Thorgersen 76e2598c5c KEYCLOAK-3805 Use ng-if instead of ng-show in component-config template 2016-10-26 09:30:00 +02:00
Stian Thorgersen bf5e724f00 KEYCLOAK-3815 Prevent resubmission of form when creating key provider 2016-10-26 09:20:37 +02:00
Stian Thorgersen 112538a220 Merge pull request #3425 from mstruk/KEYCLOAK-2366
KEYCLOAK-2366 Unable to download key in Safari
2016-10-26 09:04:31 +02:00
Stian Thorgersen 23ea1f8939 Merge pull request #3411 from mstruk/KEYCLOAK-3789
KEYCLOAK-3789 KcRegTests are failing on CI
2016-10-26 08:57:13 +02:00
Stian Thorgersen 93f9def3e8 Merge pull request #3422 from stianst/KEYCLOAK-3811
KEYCLOAK-3811 User federation screen is missing dropdown with provide…
2016-10-26 08:48:21 +02:00
Bill Burke 8a7703b0ef fix link 2016-10-25 20:41:18 -04:00
Bill Burke 2578df1a82 Merge pull request #3426 from patriot1burke/master
user spi cache policy
2016-10-25 20:39:52 -04:00
Marko Strukelj 8dca101069 KEYCLOAK-3789 KcRegTests are failing on CI
- Ignore occasional extra empty lines at end of stream
2016-10-26 01:30:42 +02:00
Marko Strukelj 4ee759d9ec KEYCLOAK-3789 KcRegTests are failing on CI 2016-10-26 01:06:33 +02:00
Bill Burke 3129e392b0 storage link on user detail 2016-10-25 16:50:34 -04:00
Stan Silvert 0d0d614b99 KEYCLOAK-3795: Hightlight not working in nav sidebar 2016-10-25 16:32:26 -04:00
Bill Burke 3fec344fa3 finish cache policy 2016-10-25 16:13:48 -04:00
Bill Burke f8a78d5565 finish cache policy 2016-10-25 16:13:22 -04:00
Bill Burke 68e853b4bd Merge remote-tracking branch 'upstream/master' 2016-10-25 13:40:32 -04:00
Bill Burke 2cc4a920a0 fix 2016-10-25 13:40:24 -04:00
Bill Burke b67cb0e97a Merge remote-tracking branch 'upstream/master' 2016-10-25 11:44:22 -04:00
Marko Strukelj 1b2f6b763a KEYCLOAK-2366 Unable to download key in Safari
- Updated FileSaver.js to version 1.3.3
2016-10-25 16:38:26 +02:00
sebastien blanc 1c2f49ab4e KEYCLOAK-3669: Fix Tomcat Adapter for 8.5.5 2016-10-25 16:27:41 +02:00
Stan Silvert 3c237760b6 KEYCLOAK-3816: Broken OTP setup with smaller resolutions 2016-10-25 08:38:29 -04:00
Bas Dalenoord 859c5cbe1e KEYCLOAK-3807: Use 'setSecurityHandler';
'insertHandler' is a method introduced in Jetty 9, Jetty 8 should
however be supported so 'setSecurityHandler' does the same thing but
works for both 8.x and 9.x;
2016-10-25 13:59:07 +02:00
Stian Thorgersen 28f31ce57f KEYCLOAK-3811 User federation screen is missing dropdown with providers in RH-SSO theme 2016-10-25 12:44:02 +02:00
Stian Thorgersen 317749a7fd Merge pull request #3419 from stianst/KEYCLOAK-3781
KEYCLOAK-3781 Don't allow deleting the last key provider
2016-10-25 12:31:00 +02:00
Stian Thorgersen 94f33473a8 Merge pull request #3409 from matejonnet/master
Fix typo in exception message.
2016-10-25 12:30:10 +02:00
Pavel Drozd 04f2b9ac01 Merge pull request #3368 from zschwarz/oidc-filter
KEYCLOAK-3747 Servlet filter dependencies
2016-10-25 11:44:47 +02:00
Pavel Drozd 7882a6513c Merge pull request #3415 from vramik/KEYCLOAK-3489
KEYCLOAK-3489 add profile for testing migration for productized version
2016-10-25 11:07:02 +02:00
Stian Thorgersen 7e6c49fc74 Merge pull request #3413 from mstruk/KEYCLOAK-3801
KEYCLOAK-3801 Remove --unsafe from 'kcreg update'
2016-10-25 10:53:08 +02:00
Stian Thorgersen 765c3a7b0d Merge pull request #3418 from stianst/KEYCLOAK-3782
KEYCLOAK-3782 Keysize for rsa-generated should be a dropdown
2016-10-25 10:22:00 +02:00
Bas Dalenoord f3df185bb5 KEYCLOAK-3807: Calling 'setHandler' is forbidden
Use 'insertHandler' as suggested in the 'setHandler's log warning.
2016-10-25 09:14:03 +02:00
Stian Thorgersen 8c42167302 KEYCLOAK-3781 Don't allow deleting the last key provider 2016-10-25 08:57:16 +02:00
Stian Thorgersen 4b27e66714 KEYCLOAK-3782 Keysize for rsa-generated should be a dropdown 2016-10-25 08:52:02 +02:00
Bill Burke 3e28ac1e46 user spi cache policy 2016-10-24 15:36:37 -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
Vlasta Ramik 3ca836ffdc add profile for testing migration for productized version 2016-10-24 15:20:17 +02:00
zschwarz bc718471da KEYCLOAK-3747 Servlet filter dependencies 2016-10-24 15:01:16 +02:00
Marko Strukelj e24b27c79e KEYCLOAK-3801 Remove --unsafe from 'kcreg update' 2016-10-24 11:33:06 +02:00
Stan Silvert dcaac76b4b Merge pull request #3414 from ssilvert/cluster-node
KEYCLOAK-2206: Hide last registration field when adding new cluster node
2016-10-21 16:57:09 -04:00
Stan Silvert d741349830 KEYCLOAK-2206: Hide last registration field when adding new cluster node
for client.
2016-10-21 13:06:03 -04:00
Marek Posolda cd3f9ee27c Merge pull request #3407 from mposolda/KEYCLOAK-3792
KEYCLOAK-3792 Fix failing tests on MySQL
2016-10-21 13:47:48 +02:00
Marek Posolda 3320d34c2b Merge pull request #3406 from mposolda/master
KEYCLOAK-3779 ClientRegistrationPolicies test failing
2016-10-21 13:47:15 +02:00
Matej Lazar 036407fd90 Fix type in exception message. 2016-10-21 12:59:59 +02:00
Hynek Mlnarik 8bca84c0e7 KEYCLOAK-3793 Replace httpclient 4.4 calls with those available in 4.3 2016-10-21 11:34:08 +02:00
mposolda f7a6d39b01 KEYCLOAK-3792 Fix failing tests on MySQL 2016-10-21 11:21:01 +02:00
mposolda c79378ca5f KEYCLOAK-3779 ClientRegistrationPolicies test failing 2016-10-21 10:24:51 +02:00
Stian Thorgersen 4d47f758fc Merge pull request #3405 from stianst/master
Bump version
2016-10-21 10:11:59 +02:00
Stian Thorgersen e390cffa63 KEYCLOAK-3779
ClientRegistrationPoliciesTest failing on Travis
2016-10-21 08:11:11 +02:00
Stian Thorgersen c615674cbb Bump version 2016-10-21 07:03:15 +02:00
Stian Thorgersen 1a4f9e656d Merge pull request #3398 from stianst/KEYCLOAK-3774
KEYCLOAK-3774 Fix keycloak.js with prompt=none and new stricter redir…
2016-10-21 06:34:43 +02:00
Bill Burke e1a214351f Merge pull request #3391 from pulgupta/master
Null pointer exception after users logs in
2016-10-20 16:06:30 -04:00
Stian Thorgersen 9801f09a93 KEYCLOAK-3774 Fix keycloak.js with prompt=none and new stricter redirect_uri 2016-10-20 21:31:25 +02:00
Stian Thorgersen 9f8fb98083 Merge pull request #3382 from stianst/KEYCLOAK-3763
KEYCLOAK-3763
2016-10-20 21:24:11 +02:00
Bill Burke fd86f3bda8 Merge pull request #3399 from patriot1burke/master
realm cache event
2016-10-20 14:02:41 -04:00
Stian Thorgersen 390becb935 Merge pull request #3394 from hmlnarik/KEYCLOAK-3769
KEYCLOAK-3769 Workaround for ChangeLogService stale instance
2016-10-20 19:43:24 +02:00
Stian Thorgersen 7d8c79b17b Merge pull request #3397 from hmlnarik/KEYCLOAK-3775
KEYCLOAK-3775 Example: Add missing org.liquibase dependency to CLI command
2016-10-20 19:42:32 +02:00
Stian Thorgersen 772a1580ff Merge pull request #3403 from mposolda/master
KEYCLOAK-3773 Testsuite failing with mongo
2016-10-20 19:31:37 +02:00
Stian Thorgersen 5a00aaefa8 KEYCLOAK-2594
bind credential being leaked in admin tool JSON response

KEYCLOAK-2972
Keycloak leaks configuration passwords in Admin Event logs
2016-10-20 19:30:59 +02:00
Stian Thorgersen 1bf24d26a4 Merge pull request #3395 from stianst/master
KEYCLOAK-3772
2016-10-20 19:27:03 +02:00
Stian Thorgersen 284f49e584 Merge pull request #3396 from mstruk/KEYCLOAK-3740
KEYCLOAK-3740 kcreg.sh doesn't support symlinking
2016-10-20 19:26:53 +02:00
Stan Silvert e7ab53dd5f Merge pull request #3400 from ssilvert/title-addr-theme
KEYCLOAK-3776: Title for account management broken for address theme
2016-10-20 12:41:40 -04:00
Bill Burke 139158e614 fix 2016-10-20 12:36:24 -04:00
mposolda c4ad84945c KEYCLOAK-3773 Testsuite failing with mongo 2016-10-20 17:47:34 +02:00
Cherian Mathew 94d4afa11c Refactor entitlement request argument name 2016-10-20 17:24:41 +02:00
Cherian Mathew d7d91cfbc0 Add client api for requesting entitlements with permission requests 2016-10-20 17:09:41 +02:00
Stan Silvert 757d5c16df KEYCLOAK-3776: Title for account management broken for address theme 2016-10-20 10:38:21 -04:00
Bill Burke 36c2422fa4 realm cache event 2016-10-20 10:35:28 -04:00
Marek Posolda ec0f222f7e Merge pull request #3393 from mposolda/master
KEYCLOAK-3770 OIDC registration with id_token grant type should set p…
2016-10-20 16:35:08 +02:00
Hynek Mlnarik 969b44768a KEYCLOAK-3775 Example: Add missing org.liquibase dependency to CLI command 2016-10-20 15:35:08 +02:00
Marko Strukelj db0024d857 KEYCLOAK-3740 kcreg.sh doesn't support symlinking
- fix buggy patch
2016-10-20 15:05:17 +02:00
Hynek Mlnarik d59f6e397f KEYCLOAK-3769 Workaround for ChangeLogService stale instance
Before applying update or validation operation, Liquibase
ChangeLogService needs to be reset to forget about previously set
change log table. Reason is that the factory creating the
ChangeLogService caches this service per DB connection, not per
Liquibase object, hence changes in name of change log table needed for
custom JpaEntityProvider are not reflected and use only the first
change log table name, i.e. the change log table of the main database.
2016-10-20 14:57:51 +02:00
mposolda 072ccb5c61 KEYCLOAK-3770 OIDC registration with id_token grant type should set publicClient flag to true 2016-10-20 14:10:53 +02:00
Pulkit Gupta 8ee566f5fa Merge branch 'master' of github.com:pulgupta/keycloak 2016-10-20 13:39:54 +05:30
Pulkit Gupta 8e9db1be96 fixed null pointer exception when principal is null 2016-10-20 13:39:04 +05:30
Pulkit Gupta 115f95d90e fixed null pointer exception when principal is null 2016-10-20 13:36:25 +05:30
Cherian Mathew 2bba6af6d9 Include programmatically created resources in the resource cache 2016-10-19 11:04: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
2223 changed files with 99758 additions and 27961 deletions

No files matched your search

+1
View File
@@ -14,6 +14,7 @@
nbactions.xml
nb-configuration.xml
catalog.xml
nbproject
# Compiled source #
###################
+8 -1
View File
@@ -11,6 +11,13 @@ env:
global:
- MAVEN_SKIP_RC=true
- MAVEN_OPTS="-Xms512m -Xmx2048m"
matrix:
- TESTS=group1
- TESTS=group2
- TESTS=group3
- TESTS=group4
- TESTS=adapter
- TESTS=old
jdk:
- oraclejdk8
@@ -22,6 +29,6 @@ install:
- travis_wait 60 mvn install -Pdistribution -DskipTests=true -B -V -q
script:
- mvn test -B
- ./travis-run-tests.sh $TESTS
sudo: false
+1 -1
View File
@@ -9,7 +9,7 @@ For more information about Keycloak visit [Keycloak homepage](http://keycloak.or
Building
--------
Ensure you have JDK 8 (or newer), Maven 3.2.1 (or newer) and Git installed
Ensure you have JDK 8 (or newer), Maven 3.1.1 (or newer) and Git installed
java -version
mvn -version
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.3.0-SNAPSHOT</version>
<version>2.5.4.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) {
@@ -142,9 +142,13 @@ public class AuthenticatedActionsHandler {
AuthorizationContext authorizationContext = policyEnforcer.enforce(facade);
RefreshableKeycloakSecurityContext session = (RefreshableKeycloakSecurityContext) facade.getSecurityContext();
session.setAuthorizationContext(authorizationContext);
if (session != null) {
session.setAuthorizationContext(authorizationContext);
return authorizationContext.isGranted();
return authorizationContext.isGranted();
}
return true;
} catch (Exception e) {
throw new RuntimeException("Failed to enforce policy decisions.", e);
}
@@ -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();
@@ -38,7 +38,7 @@ import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.keycloak.common.util.EnvUtil;
import org.keycloak.common.util.KeystoreUtil;
import org.keycloak.representations.adapters.config.AdapterConfig;
import org.keycloak.representations.adapters.config.AdapterHttpClientConfig;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
@@ -333,7 +333,7 @@ public class HttpClientBuilder {
}
}
public HttpClient build(AdapterConfig adapterConfig) {
public HttpClient build(AdapterHttpClientConfig adapterConfig) {
disableCookieCache(); // disable cookie cache as we don't want sticky sessions for load balancing
String truststorePath = adapterConfig.getTruststore();
@@ -379,13 +379,13 @@ public class HttpClientBuilder {
/**
* Configures a the proxy to use for auth-server requests if provided.
* <p>
* If the given {@link AdapterConfig} contains the attribute {@code proxy-url} we use the
* If the given {@link AdapterHttpClientConfig} contains the attribute {@code proxy-url} we use the
* given URL as a proxy server, otherwise the proxy configuration is ignored.
* </p>
*
* @param adapterConfig
*/
private void configureProxyForAuthServerIfProvided(AdapterConfig adapterConfig) {
private void configureProxyForAuthServerIfProvided(AdapterHttpClientConfig adapterConfig) {
if (adapterConfig == null || adapterConfig.getProxyUrl() == null || adapterConfig.getProxyUrl().trim().isEmpty()) {
return;
@@ -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,8 +17,16 @@
*/
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;
import org.keycloak.adapters.OIDCHttpFacade;
import org.keycloak.adapters.spi.HttpFacade.Request;
import org.keycloak.adapters.spi.HttpFacade.Response;
@@ -31,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>
*/
@@ -47,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;
@@ -56,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) {
@@ -66,40 +67,50 @@ public abstract class AbstractPolicyEnforcer {
return createEmptyAuthorizationContext(true);
}
AccessToken accessToken = httpFacade.getSecurityContext().getToken();
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());
PathConfig pathConfig = this.pathMatcher.matches(path, this.paths);
KeycloakSecurityContext securityContext = httpFacade.getSecurityContext();
LOGGER.debugf("Checking permissions for path [%s] with config [%s].", request.getURI(), pathConfig);
if (securityContext != null) {
AccessToken accessToken = securityContext.getToken();
if (pathConfig == null) {
if (EnforcementMode.PERMISSIVE.equals(enforcementMode)) {
return createAuthorizationContext(accessToken);
if (accessToken != null) {
Request request = httpFacade.getRequest();
Response response = httpFacade.getResponse();
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);
if (pathConfig == null) {
if (EnforcementMode.PERMISSIVE.equals(enforcementMode)) {
return createAuthorizationContext(accessToken);
}
LOGGER.debugf("Could not find a configuration for path [%s]", path);
response.sendError(403, "Could not find a configuration for path [" + path + "].");
return createEmptyAuthorizationContext(false);
}
if (EnforcementMode.DISABLED.equals(pathConfig.getEnforcementMode())) {
return createEmptyAuthorizationContext(true);
}
PathConfig actualPathConfig = resolvePathConfig(pathConfig, request);
Set<String> requiredScopes = getRequiredScopes(actualPathConfig, request);
if (isAuthorized(actualPathConfig, requiredScopes, accessToken, httpFacade)) {
try {
return createAuthorizationContext(accessToken);
} catch (Exception e) {
throw new RuntimeException("Error processing path [" + actualPathConfig.getPath() + "].", e);
}
}
if (!challenge(actualPathConfig, requiredScopes, httpFacade)) {
LOGGER.debugf("Sending challenge to the client. Path [%s]", pathConfig);
response.sendError(403, "Authorization failed.");
}
}
LOGGER.debugf("Could not find a configuration for path [%s]", path);
response.sendError(403, "Could not find a configuration for path [" + path + "].");
return createEmptyAuthorizationContext(false);
}
PathConfig actualPathConfig = resolvePathConfig(pathConfig, request);
Set<String> requiredScopes = getRequiredScopes(actualPathConfig, request);
if (isAuthorized(actualPathConfig, requiredScopes, accessToken, httpFacade)) {
try {
return createAuthorizationContext(accessToken);
} catch (Exception e) {
throw new RuntimeException("Error processing path [" + actualPathConfig.getPath() + "].", e);
}
}
if (!challenge(actualPathConfig, requiredScopes, httpFacade)) {
LOGGER.debugf("Sending challenge to the client. Path [%s]", pathConfig);
response.sendError(403, "Authorization failed.");
}
return createEmptyAuthorizationContext(false);
@@ -110,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.getAccessDeniedPath();
if (accessDeniedPath != null) {
if (request.getURI().contains(accessDeniedPath)) {
return true;
}
if (isDefaultAccessDeniedUri(request, enforcerConfig)) {
return true;
}
AccessToken.Authorization authorization = accessToken.getAuthorization();
@@ -125,14 +133,17 @@ public abstract class AbstractPolicyEnforcer {
}
List<Permission> permissions = authorization.getPermissions();
boolean hasPermission = false;
for (Permission permission : permissions) {
if (permission.getResourceSetId() != null) {
if (isResourcePermission(actualPathConfig, permission)) {
hasPermission = true;
if (actualPathConfig.isInstance() && !matchResourcePermission(actualPathConfig, permission)) {
continue;
}
if (hasResourceScopePermission(requiredScopes, permission, actualPathConfig)) {
LOGGER.debugf("Authorization GRANTED for path [%s]. Permissions [%s].", actualPathConfig, permissions);
if (request.getMethod().equalsIgnoreCase("DELETE") && actualPathConfig.isInstance()) {
@@ -143,16 +154,32 @@ public abstract class AbstractPolicyEnforcer {
}
} else {
if (hasResourceScopePermission(requiredScopes, permission, actualPathConfig)) {
hasPermission = true;
return true;
}
}
}
if (!hasPermission && EnforcementMode.PERMISSIVE.equals(actualPathConfig.getEnforcementMode())) {
return true;
}
LOGGER.debugf("Authorization FAILED for path [%s]. No enough permissions [%s].", actualPathConfig, permissions);
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());
@@ -200,26 +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;
}
@@ -228,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<>();
@@ -41,7 +41,7 @@ public class BearerTokenPolicyEnforcer extends AbstractPolicyEnforcer {
@Override
protected boolean challenge(PathConfig pathConfig, Set<String> requiredScopes, OIDCHttpFacade facade) {
if (getEnforcerConfig().getUmaProtocolConfig() != null) {
if (getEnforcerConfig().getUserManagedAccess() != null) {
challengeUmaAuthentication(pathConfig, requiredScopes, facade);
} else {
challengeEntitlementAuthentication(facade);
@@ -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,44 +51,39 @@ 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
protected boolean challenge(PathConfig pathConfig, Set<String> requiredScopes, OIDCHttpFacade facade) {
String accessDeniedPath = getEnforcerConfig().getAccessDeniedPath();
String accessDeniedPath = getEnforcerConfig().getOnDenyRedirectTo();
HttpFacade.Response response = facade.getResponse();
if (accessDeniedPath != null) {
@@ -107,8 +102,8 @@ public class KeycloakAdapterPolicyEnforcer extends AbstractPolicyEnforcer {
AuthzClient authzClient = getAuthzClient();
KeycloakDeployment deployment = getPolicyEnforcer().getDeployment();
if (getEnforcerConfig().getUmaProtocolConfig() != null) {
LOGGER.debug("Obtaining authorization for authenticated user.");
if (getEnforcerConfig().getUserManagedAccess() != null) {
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,16 +98,29 @@ 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) {
if (enforcerConfig.getPaths().isEmpty()) {
private Map<String, PathConfig> configurePaths(ProtectedResource protectedResource, PolicyEnforcerConfig enforcerConfig) {
boolean loadPathsFromServer = true;
for (PathConfig pathConfig : enforcerConfig.getPaths()) {
if (!PolicyEnforcerConfig.EnforcementMode.DISABLED.equals(pathConfig.getEnforcementMode())) {
loadPathsFromServer = false;
break;
}
}
if (loadPathsFromServer) {
LOGGER.info("No path provided in configuration.");
return configureAllPathsForResourceServer(protectedResource);
} else {
@@ -114,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;
@@ -163,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;
@@ -171,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());
@@ -181,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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -86,7 +86,7 @@ class KeycloakSubsystemParser implements XMLStreamConstants, XMLElementReader<Li
if (!SharedAttributeDefinitons.validateTruststoreSetIfRequired(addRealm)) {
//TODO: externalize the message
throw new XMLStreamException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-maanger is false.");
throw new XMLStreamException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-manager is false.");
}
list.add(addRealm);
@@ -117,7 +117,7 @@ class KeycloakSubsystemParser implements XMLStreamConstants, XMLElementReader<Li
* TODO need to check realm-ref first.
if (!SharedAttributeDefinitons.validateTruststoreSetIfRequired(addSecureDeployment)) {
//TODO: externalize the message
throw new XMLStreamException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-maanger is false.");
throw new XMLStreamException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-manager is false.");
}
*/
@@ -46,7 +46,7 @@ public final class RealmAddHandler extends AbstractAddStepHandler {
if (!SharedAttributeDefinitons.validateTruststoreSetIfRequired(model.clone())) {
//TODO: externalize message
throw new OperationFailedException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-maanger is false.");
throw new OperationFailedException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-manager is false.");
}
}
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -118,12 +118,11 @@
/**
* Obtains all entitlements from a Keycloak Server based on a give resourceServerId.
*/
this.entitlement = function (resourceSeververId) {
this.entitlement = function (resourceSeververId, entitlementRequest ) {
this.then = function (onGrant, onDeny, onError) {
var request = new XMLHttpRequest();
request.open('GET', keycloak.authServerUrl + '/realms/' + keycloak.realm + '/authz/entitlement/' + resourceSeververId, true);
request.setRequestHeader('Authorization', 'Bearer ' + keycloak.token)
request.onreadystatechange = function () {
if (request.readyState == 4) {
@@ -149,7 +148,19 @@
}
};
request.send(null);
var erJson = null
if(entitlementRequest) {
request.open('POST', keycloak.authServerUrl + '/realms/' + keycloak.realm + '/authz/entitlement/' + resourceSeververId, true);
request.setRequestHeader("Content-type", "application/json");
erJson = JSON.stringify(entitlementRequest)
} else {
request.open('GET', keycloak.authServerUrl + '/realms/' + keycloak.realm + '/authz/entitlement/' + resourceSeververId, true);
}
request.setRequestHeader('Authorization', 'Bearer ' + keycloak.token)
request.send(erJson);
};
return this;
+67 -67
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 {
@@ -210,11 +210,18 @@
var nonce = createUUID();
var redirectUri = adapter.redirectUri(options);
if (options && options.prompt) {
redirectUri += (redirectUri.indexOf('?') == -1 ? '?' : '&') + 'prompt=' + options.prompt;
var callbackState = {
state: state,
nonce: nonce,
redirectUri: encodeURIComponent(redirectUri),
}
callbackStorage.add({ state: state, nonce: nonce, redirectUri: encodeURIComponent(redirectUri) });
if (options && options.prompt) {
callbackState.prompt = options.prompt;
}
callbackStorage.add(callbackState);
var action = 'auth';
if (options && options.action == 'register') {
@@ -362,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;
@@ -372,7 +384,7 @@
kc.updateToken = function(minValidity) {
var promise = createPromise();
if (!kc.tokenParsed || !kc.refreshToken) {
if (!kc.refreshToken) {
promise.setError();
return promise.promise;
}
@@ -381,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');
}
@@ -631,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);
@@ -689,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) {
@@ -747,6 +748,7 @@
if (oauthState && (oauth.code || oauth.error || oauth.access_token || oauth.id_token)) {
oauth.redirectUri = oauthState.redirectUri;
oauth.storedNonce = oauthState.nonce;
oauth.prompt = oauthState.prompt;
if (oauth.fragment) {
oauth.newUrl += '#' + oauth.fragment;
@@ -838,14 +840,15 @@
kc.clearToken();
}
for (var i = loginIframe.callbackList.length - 1; i >= 0; --i) {
var promise = loginIframe.callbackList[i];
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);
}
};
@@ -1041,7 +1044,7 @@
function clearExpired() {
var time = new Date().getTime();
for (var i = 1; i <= localStorage.length; i++) {
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
if (key && key.indexOf('kc-callback-') == 0) {
var value = localStorage.getItem(key);
@@ -1218,9 +1221,6 @@
case 'redirect_fragment':
oauth.fragment = queryParams[param];
break;
case 'prompt':
oauth.prompt = queryParams[param];
break;
default:
if (responseMode != 'query' || !handleQueryParam(param, queryParams[param], oauth)) {
oauth.newUrl += (oauth.newUrl.indexOf('?') == -1 ? '?' : '&') + param + '=' + queryParams[param];
@@ -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>
@@ -21,25 +21,28 @@
var init;
function checkState(clientId, origin, sessionState, callback) {
if (!init) {
var cookie = getCookie();
if (!cookie) {
callback('changed');
} else if (!init) {
var req = new XMLHttpRequest();
var url = location.href + "/init";
url += "?client_id=" + encodeURIComponent(clientId);
url += "&origin=" + encodeURIComponent(origin);
url += "&session_state=" + encodeURIComponent(sessionState);
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');
@@ -49,9 +52,9 @@
req.send();
} else {
if (clientId == init.clientId && origin == init.origin) {
var cookie = getCookie();
if (sessionState == cookie) {
if (clientId === init.clientId && origin === init.origin) {
var c = cookie.split('/');
if (sessionState === c[2]) {
callback('unchanged');
} else {
callback('changed');
@@ -69,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;
}
@@ -79,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];
@@ -93,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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -215,7 +215,7 @@ public class KeycloakSpringBootConfiguration {
securityHandler.setConstraintMappings(jettyConstraintMappings);
securityHandler.setAuthenticator(keycloakJettyAuthenticator);
webAppContext.setHandler(securityHandler);
webAppContext.setSecurityHandler(securityHandler);
}
}
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.fine("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);
}
}
@@ -196,6 +194,8 @@ public abstract class AbstractKeycloakAuthenticatorValve extends FormAuthenticat
CatalinaHttpFacade facade = new OIDCCatalinaHttpFacade(request, response);
KeycloakDeployment deployment = deploymentContext.resolveDeployment(facade);
if (deployment == null || !deployment.isConfigured()) {
//needed for the EAP6/AS7 adapter relying on the tomcat core adapter
facade.getResponse().sendError(401);
return false;
}
AdapterTokenStore tokenStore = getTokenStore(request, facade, deployment);
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -39,9 +39,20 @@ import java.util.List;
* @version $Revision: 1 $
*/
public class KeycloakAuthenticatorValve extends AbstractKeycloakAuthenticatorValve {
/**
* Method called by Tomcat < 8.5.5
*/
public boolean authenticate(Request request, HttpServletResponse response) throws IOException {
return authenticateInternal(request, response, request.getContext().getLoginConfig());
}
/**
* Method called by Tomcat >= 8.5.5
*/
protected boolean doAuthenticate(Request request, HttpServletResponse response) throws IOException {
return this.authenticate(request, response);
}
@Override
protected boolean forwardToErrorPageInternal(Request request, HttpServletResponse response, Object loginConfig) throws IOException {
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.3.0-SNAPSHOT</version>
<version>2.5.4.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -92,7 +92,7 @@ public abstract class AbstractUndertowKeycloakAuthMech implements Authentication
UndertowHttpFacade facade = createFacade(exchange);
KeycloakDeployment deployment = deploymentContext.resolveDeployment(facade);
KeycloakSecurityContext ksc = exchange.getAttachment(OIDCUndertowHttpFacade.KEYCLOAK_SECURITY_CONTEXT_KEY);
if (ksc != null && ksc instanceof RefreshableKeycloakSecurityContext) {
if (!deployment.isBearerOnly() && ksc != null && ksc instanceof RefreshableKeycloakSecurityContext) {
((RefreshableKeycloakSecurityContext) ksc).logout(deployment);
}
AdapterTokenStore tokenStore = getTokenStore(exchange, facade, deployment, securityContext);
@@ -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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
@@ -87,7 +87,7 @@ class KeycloakSubsystemParser implements XMLStreamConstants, XMLElementReader<Li
if (!SharedAttributeDefinitons.validateTruststoreSetIfRequired(addRealm)) {
//TODO: externalize the message
throw new XMLStreamException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-maanger is false.");
throw new XMLStreamException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-manager is false.");
}
list.add(addRealm);
@@ -118,7 +118,7 @@ class KeycloakSubsystemParser implements XMLStreamConstants, XMLElementReader<Li
* TODO need to check realm-ref first.
if (!SharedAttributeDefinitons.validateTruststoreSetIfRequired(addSecureDeployment)) {
//TODO: externalize the message
throw new XMLStreamException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-maanger is false.");
throw new XMLStreamException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-manager is false.");
}
*/
@@ -54,7 +54,7 @@ public final class RealmAddHandler extends AbstractAddStepHandler {
if (!SharedAttributeDefinitons.validateTruststoreSetIfRequired(model.clone())) {
//TODO: externalize message
throw new OperationFailedException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-maanger is false.");
throw new OperationFailedException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-manager is false.");
}
}
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.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.3.0-SNAPSHOT</version>
<version>2.5.4.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -105,7 +105,7 @@ public class SamlPrincipal implements Serializable, Principal {
* @return
*/
public List<String> getFriendlyAttributes(String friendlyName) {
List<String> list = friendlyAttributes.get(name);
List<String> list = friendlyAttributes.get(friendlyName);
if (list != null) {
return Collections.unmodifiableList(list);
} else {
Whitespace-only changes.
+7 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.3.0-SNAPSHOT</version>
<version>2.5.4.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -34,6 +34,7 @@
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
</properties>
<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
@@ -70,6 +71,11 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
@@ -0,0 +1,75 @@
/*
* 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.cloned;
/**
* Configuration options relevant for configuring http client that can be used by adapter.
*
* NOTE: keep in sync with core/src/main/java/org/keycloak/representations/adapters/config/AdapterHttpClientConfig.java until unified.
*
* @author hmlnarik
*/
public interface AdapterHttpClientConfig {
/**
* Returns truststore filename.
*/
public String getTruststore();
/**
* Returns truststore password.
*/
public String getTruststorePassword();
/**
* Returns keystore with client keys.
*/
public String getClientKeystore();
/**
* Returns keystore password.
*/
public String getClientKeystorePassword();
/**
* Returns boolean flag whether any hostname verification is done on the server's
* certificate, {@code true} means that verification is not done.
* @return
*/
public boolean isAllowAnyHostname();
/**
* Returns boolean flag whether any trust management and hostname verification is done.
* <p>
* <i>NOTE</i> Disabling trust manager is a security hole, so only set this option
* if you cannot or do not want to verify the identity of the
* host you are communicating with.
*/
public boolean isDisableTrustManager();
/**
* Returns size of connection pool.
*/
public int getConnectionPoolSize();
/**
* Returns URL of HTTP proxy.
*/
public String getProxyUrl();
}
@@ -0,0 +1,78 @@
/*
* 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.cloned;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.crypto.dsig.keyinfo.KeyInfo;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.util.EntityUtils;
import org.keycloak.adapters.saml.descriptor.parsers.SamlDescriptorIDPKeysExtractor;
import org.keycloak.common.util.MultivaluedHashMap;
import org.keycloak.saml.common.exceptions.ParsingException;
/**
* @author <a href="mailto:hmlnarik@redhat.com">Hynek Mlnařík</a>
*/
public class HttpAdapterUtils {
public static MultivaluedHashMap<String, KeyInfo> downloadKeysFromSamlDescriptor(HttpClient client, String descriptorUrl) throws HttpClientAdapterException {
try {
HttpGet httpRequest = new HttpGet(descriptorUrl);
HttpResponse response = client.execute(httpRequest);
int status = response.getStatusLine().getStatusCode();
if (status != HttpStatus.SC_OK) {
EntityUtils.consumeQuietly(response.getEntity());
throw new HttpClientAdapterException("Unexpected status = " + status);
}
HttpEntity entity = response.getEntity();
if (entity == null) {
throw new HttpClientAdapterException("There was no entity.");
}
MultivaluedHashMap<String, KeyInfo> res;
try (InputStream is = entity.getContent()) {
res = extractKeysFromSamlDescriptor(is);
}
EntityUtils.consumeQuietly(entity);
return res;
} catch (IOException | ParsingException e) {
throw new HttpClientAdapterException("IO error", e);
}
}
/**
* Parses SAML descriptor and extracts keys from it.
* @param xmlStream
* @return List of KeyInfo objects containing keys from the descriptor.
* @throws IOException
*/
public static MultivaluedHashMap<String, KeyInfo> extractKeysFromSamlDescriptor(InputStream xmlStream) throws ParsingException {
Object res = new SamlDescriptorIDPKeysExtractor().parse(xmlStream);
return (MultivaluedHashMap<String, KeyInfo>) res;
}
}
@@ -15,17 +15,18 @@
* limitations under the License.
*/
package org.keycloak.models.utils;
import org.keycloak.models.RealmModel;
import org.keycloak.representations.idm.RealmRepresentation;
package org.keycloak.adapters.cloned;
/**
* Helper interface used just because RealmManager is in keycloak-services and not accessible for ImportUtils
*
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
*/
public interface RealmImporter {
public class HttpClientAdapterException extends Exception {
RealmModel importRealm(RealmRepresentation rep);
public HttpClientAdapterException(String message) {
super(message);
}
public HttpClientAdapterException(String message, Throwable t) {
super(message, t);
}
}
@@ -0,0 +1,396 @@
/*
* 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.cloned;
import org.apache.http.HttpHost;
import org.apache.http.client.CookieStore;
import org.apache.http.client.HttpClient;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.params.ConnRoutePNames;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.AllowAllHostnameVerifier;
import org.apache.http.conn.ssl.BrowserCompatHostnameVerifier;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.conn.ssl.StrictHostnameVerifier;
import org.apache.http.conn.ssl.X509HostnameVerifier;
import org.apache.http.cookie.Cookie;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.SingleClientConnManager;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.keycloak.common.util.EnvUtil;
import org.keycloak.common.util.KeystoreUtil;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.io.IOException;
import java.net.URI;
import java.security.KeyStore;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* Abstraction for creating HttpClients. Allows SSL configuration.
*
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
public class HttpClientBuilder {
public static enum HostnameVerificationPolicy {
/**
* Hostname verification is not done on the server's certificate
*/
ANY,
/**
* Allows wildcards in subdomain names i.e. *.foo.com
*/
WILDCARD,
/**
* CN must match hostname connecting to
*/
STRICT
}
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
private static class PassthroughTrustManager implements X509TrustManager {
public void checkClientTrusted(X509Certificate[] chain,
String authType) throws CertificateException {
}
public void checkServerTrusted(X509Certificate[] chain,
String authType) throws CertificateException {
}
public X509Certificate[] getAcceptedIssuers() {
return null;
}
}
protected KeyStore truststore;
protected KeyStore clientKeyStore;
protected String clientPrivateKeyPassword;
protected boolean disableTrustManager;
protected boolean disableCookieCache = true;
protected HostnameVerificationPolicy policy = HostnameVerificationPolicy.WILDCARD;
protected SSLContext sslContext;
protected int connectionPoolSize = 100;
protected int maxPooledPerRoute = 0;
protected long connectionTTL = -1;
protected TimeUnit connectionTTLUnit = TimeUnit.MILLISECONDS;
protected HostnameVerifier verifier = null;
protected long socketTimeout = -1;
protected TimeUnit socketTimeoutUnits = TimeUnit.MILLISECONDS;
protected long establishConnectionTimeout = -1;
protected TimeUnit establishConnectionTimeoutUnits = TimeUnit.MILLISECONDS;
protected HttpHost proxyHost;
/**
* Socket inactivity timeout
*
* @param timeout
* @param unit
* @return
*/
public HttpClientBuilder socketTimeout(long timeout, TimeUnit unit) {
this.socketTimeout = timeout;
this.socketTimeoutUnits = unit;
return this;
}
/**
* When trying to make an initial socket connection, what is the timeout?
*
* @param timeout
* @param unit
* @return
*/
public HttpClientBuilder establishConnectionTimeout(long timeout, TimeUnit unit) {
this.establishConnectionTimeout = timeout;
this.establishConnectionTimeoutUnits = unit;
return this;
}
public HttpClientBuilder connectionTTL(long ttl, TimeUnit unit) {
this.connectionTTL = ttl;
this.connectionTTLUnit = unit;
return this;
}
public HttpClientBuilder maxPooledPerRoute(int maxPooledPerRoute) {
this.maxPooledPerRoute = maxPooledPerRoute;
return this;
}
public HttpClientBuilder connectionPoolSize(int connectionPoolSize) {
this.connectionPoolSize = connectionPoolSize;
return this;
}
/**
* Disable trust management and hostname verification. <i>NOTE</i> this is a security
* hole, so only set this option if you cannot or do not want to verify the identity of the
* host you are communicating with.
*/
public HttpClientBuilder disableTrustManager() {
this.disableTrustManager = true;
return this;
}
public HttpClientBuilder disableCookieCache() {
this.disableCookieCache = true;
return this;
}
/**
* SSL policy used to verify hostnames
*
* @param policy
* @return
*/
public HttpClientBuilder hostnameVerification(HostnameVerificationPolicy policy) {
this.policy = policy;
return this;
}
public HttpClientBuilder sslContext(SSLContext sslContext) {
this.sslContext = sslContext;
return this;
}
public HttpClientBuilder trustStore(KeyStore truststore) {
this.truststore = truststore;
return this;
}
public HttpClientBuilder keyStore(KeyStore keyStore, String password) {
this.clientKeyStore = keyStore;
this.clientPrivateKeyPassword = password;
return this;
}
public HttpClientBuilder keyStore(KeyStore keyStore, char[] password) {
this.clientKeyStore = keyStore;
this.clientPrivateKeyPassword = new String(password);
return this;
}
static class VerifierWrapper implements X509HostnameVerifier {
protected HostnameVerifier verifier;
VerifierWrapper(HostnameVerifier verifier) {
this.verifier = verifier;
}
@Override
public void verify(String host, SSLSocket ssl) throws IOException {
if (!verifier.verify(host, ssl.getSession())) throw new SSLException("Hostname verification failure");
}
@Override
public void verify(String host, X509Certificate cert) throws SSLException {
throw new SSLException("This verification path not implemented");
}
@Override
public void verify(String host, String[] cns, String[] subjectAlts) throws SSLException {
throw new SSLException("This verification path not implemented");
}
@Override
public boolean verify(String s, SSLSession sslSession) {
return verifier.verify(s, sslSession);
}
}
public HttpClient build() {
X509HostnameVerifier verifier = null;
if (this.verifier != null) verifier = new VerifierWrapper(this.verifier);
else {
switch (policy) {
case ANY:
verifier = new AllowAllHostnameVerifier();
break;
case WILDCARD:
verifier = new BrowserCompatHostnameVerifier();
break;
case STRICT:
verifier = new StrictHostnameVerifier();
break;
}
}
try {
SSLSocketFactory sslsf = null;
SSLContext theContext = sslContext;
if (disableTrustManager) {
theContext = SSLContext.getInstance("SSL");
theContext.init(null, new TrustManager[]{new PassthroughTrustManager()},
new SecureRandom());
verifier = new AllowAllHostnameVerifier();
sslsf = new SniSSLSocketFactory(theContext, verifier);
} else if (theContext != null) {
sslsf = new SniSSLSocketFactory(theContext, verifier);
} else if (clientKeyStore != null || truststore != null) {
sslsf = new SniSSLSocketFactory(SSLSocketFactory.TLS, clientKeyStore, clientPrivateKeyPassword, truststore, null, verifier);
} else {
final SSLContext tlsContext = SSLContext.getInstance(SSLSocketFactory.TLS);
tlsContext.init(null, null, null);
sslsf = new SniSSLSocketFactory(tlsContext, verifier);
}
SchemeRegistry registry = new SchemeRegistry();
registry.register(
new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));
Scheme httpsScheme = new Scheme("https", 443, sslsf);
registry.register(httpsScheme);
ClientConnectionManager cm = null;
if (connectionPoolSize > 0) {
ThreadSafeClientConnManager tcm = new ThreadSafeClientConnManager(registry, connectionTTL, connectionTTLUnit);
tcm.setMaxTotal(connectionPoolSize);
if (maxPooledPerRoute == 0) maxPooledPerRoute = connectionPoolSize;
tcm.setDefaultMaxPerRoute(maxPooledPerRoute);
cm = tcm;
} else {
cm = new SingleClientConnManager(registry);
}
BasicHttpParams params = new BasicHttpParams();
if (proxyHost != null) {
params.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxyHost);
}
if (socketTimeout > -1) {
HttpConnectionParams.setSoTimeout(params, (int) socketTimeoutUnits.toMillis(socketTimeout));
}
if (establishConnectionTimeout > -1) {
HttpConnectionParams.setConnectionTimeout(params, (int) establishConnectionTimeoutUnits.toMillis(establishConnectionTimeout));
}
DefaultHttpClient client = new DefaultHttpClient(cm, params);
if (disableCookieCache) {
client.setCookieStore(new CookieStore() {
@Override
public void addCookie(Cookie cookie) {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public List<Cookie> getCookies() {
return Collections.emptyList();
}
@Override
public boolean clearExpired(Date date) {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void clear() {
//To change body of implemented methods use File | Settings | File Templates.
}
});
}
return client;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public HttpClient build(AdapterHttpClientConfig adapterConfig) {
disableCookieCache(); // disable cookie cache as we don't want sticky sessions for load balancing
String truststorePath = adapterConfig.getTruststore();
if (truststorePath != null) {
truststorePath = EnvUtil.replace(truststorePath);
String truststorePassword = adapterConfig.getTruststorePassword();
try {
this.truststore = KeystoreUtil.loadKeyStore(truststorePath, truststorePassword);
} catch (Exception e) {
throw new RuntimeException("Failed to load truststore", e);
}
}
String clientKeystore = adapterConfig.getClientKeystore();
if (clientKeystore != null) {
clientKeystore = EnvUtil.replace(clientKeystore);
String clientKeystorePassword = adapterConfig.getClientKeystorePassword();
try {
KeyStore clientCertKeystore = KeystoreUtil.loadKeyStore(clientKeystore, clientKeystorePassword);
keyStore(clientCertKeystore, clientKeystorePassword);
} catch (Exception e) {
throw new RuntimeException("Failed to load keystore", e);
}
}
int size = 10;
if (adapterConfig.getConnectionPoolSize() > 0)
size = adapterConfig.getConnectionPoolSize();
HttpClientBuilder.HostnameVerificationPolicy policy = HttpClientBuilder.HostnameVerificationPolicy.WILDCARD;
if (adapterConfig.isAllowAnyHostname())
policy = HttpClientBuilder.HostnameVerificationPolicy.ANY;
connectionPoolSize(size);
hostnameVerification(policy);
if (adapterConfig.isDisableTrustManager()) {
disableTrustManager();
} else {
trustStore(truststore);
}
configureProxyForAuthServerIfProvided(adapterConfig);
return build();
}
/**
* Configures a the proxy to use for auth-server requests if provided.
* <p>
* If the given {@link AdapterHttpClientConfig} contains the attribute {@code proxy-url} we use the
* given URL as a proxy server, otherwise the proxy configuration is ignored.
* </p>
*
* @param adapterConfig
*/
private void configureProxyForAuthServerIfProvided(AdapterHttpClientConfig adapterConfig) {
if (adapterConfig == null || adapterConfig.getProxyUrl() == null || adapterConfig.getProxyUrl().trim().isEmpty()) {
return;
}
URI uri = URI.create(adapterConfig.getProxyUrl());
this.proxyHost = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme());
}
}
@@ -0,0 +1,143 @@
/*
* 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.cloned;
import org.apache.http.HttpHost;
import org.apache.http.conn.scheme.HostNameResolver;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.conn.ssl.TrustStrategy;
import org.apache.http.conn.ssl.X509HostnameVerifier;
import org.apache.http.protocol.HttpContext;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.security.AccessController;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* SSLSocketFactory that uses Server Name Indication (SNI) TLS extension.
*
* <p>
* Originally copied from <b>keycloak-adapter-core</b> project.
*
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
* @author <a href="mailto:hmlnarik@redhat.com">Hynek Mlnařík</a>
*/
public class SniSSLSocketFactory extends SSLSocketFactory {
private static final Logger LOG = Logger.getLogger(SniSSLSocketFactory.class.getName());
public SniSSLSocketFactory(String algorithm, KeyStore keystore, String keyPassword, KeyStore truststore, SecureRandom random, HostNameResolver nameResolver) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
super(algorithm, keystore, keyPassword, truststore, random, nameResolver);
}
public SniSSLSocketFactory(String algorithm, KeyStore keystore, String keyPassword, KeyStore truststore, SecureRandom random, TrustStrategy trustStrategy, X509HostnameVerifier hostnameVerifier) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
super(algorithm, keystore, keyPassword, truststore, random, trustStrategy, hostnameVerifier);
}
public SniSSLSocketFactory(String algorithm, KeyStore keystore, String keyPassword, KeyStore truststore, SecureRandom random, X509HostnameVerifier hostnameVerifier) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
super(algorithm, keystore, keyPassword, truststore, random, hostnameVerifier);
}
public SniSSLSocketFactory(KeyStore keystore, String keystorePassword, KeyStore truststore) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
super(keystore, keystorePassword, truststore);
}
public SniSSLSocketFactory(KeyStore keystore, String keystorePassword) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
super(keystore, keystorePassword);
}
public SniSSLSocketFactory(KeyStore truststore) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
super(truststore);
}
public SniSSLSocketFactory(TrustStrategy trustStrategy, X509HostnameVerifier hostnameVerifier) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
super(trustStrategy, hostnameVerifier);
}
public SniSSLSocketFactory(TrustStrategy trustStrategy) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
super(trustStrategy);
}
public SniSSLSocketFactory(SSLContext sslContext) {
super(sslContext);
}
public SniSSLSocketFactory(SSLContext sslContext, HostNameResolver nameResolver) {
super(sslContext, nameResolver);
}
public SniSSLSocketFactory(SSLContext sslContext, X509HostnameVerifier hostnameVerifier) {
super(sslContext, hostnameVerifier);
}
public SniSSLSocketFactory(SSLContext sslContext, String[] supportedProtocols, String[] supportedCipherSuites, X509HostnameVerifier hostnameVerifier) {
super(sslContext, supportedProtocols, supportedCipherSuites, hostnameVerifier);
}
public SniSSLSocketFactory(javax.net.ssl.SSLSocketFactory socketfactory, X509HostnameVerifier hostnameVerifier) {
super(socketfactory, hostnameVerifier);
}
public SniSSLSocketFactory(javax.net.ssl.SSLSocketFactory socketfactory, String[] supportedProtocols, String[] supportedCipherSuites, X509HostnameVerifier hostnameVerifier) {
super(socketfactory, supportedProtocols, supportedCipherSuites, hostnameVerifier);
}
@Override
public Socket connectSocket(int connectTimeout, Socket socket, HttpHost host, InetSocketAddress remoteAddress, InetSocketAddress localAddress, HttpContext context) throws IOException {
return super.connectSocket(connectTimeout, applySNI(socket, host.getHostName()), host, remoteAddress, localAddress, context);
}
@Override
public Socket createLayeredSocket(Socket socket, String target, int port, HttpContext context) throws IOException {
return super.createLayeredSocket(applySNI(socket, target), target, port, context);
}
private Socket applySNI(final Socket socket, String hostname) {
if (socket instanceof SSLSocket) {
try {
Method setHostMethod = AccessController.doPrivileged(new PrivilegedExceptionAction<Method>() {
@Override
public Method run() throws NoSuchMethodException {
return socket.getClass().getMethod("setHost", String.class);
}
});
setHostMethod.invoke(socket, hostname);
LOG.log(Level.FINEST, "Applied SNI to socket for host {0}", hostname);
} catch (PrivilegedActionException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
LOG.log(Level.WARNING, "Failed to apply SNI to SSLSocket", e);
}
}
return socket;
}
}
@@ -79,7 +79,9 @@ public abstract class AbstractInitiateLogin implements AuthChallenge {
binding.canonicalizationMethod(deployment.getSignatureCanonicalizationMethod());
}
binding.signWith(keypair);
binding.signWith(null, keypair);
// TODO: As part of KEYCLOAK-3810, add KeyID to the SAML document
// <related DocumentBuilder>.addExtension(new KeycloakKeySamlExtensionGenerator(<key ID>));
binding.signDocument();
}
return binding;
@@ -23,7 +23,14 @@ import org.keycloak.saml.SignatureAlgorithm;
import java.security.KeyPair;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import org.apache.http.client.HttpClient;
import org.keycloak.adapters.saml.rotation.SamlDescriptorPublicKeyLocator;
import org.keycloak.rotation.CompositeKeyLocator;
import org.keycloak.rotation.HardcodedKeyLocator;
import org.keycloak.rotation.KeyLocator;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -179,10 +186,15 @@ public class DefaultSamlDeployment implements SamlDeployment {
public static class DefaultIDP implements IDP {
private static final int DEFAULT_CACHE_TTL = 24 * 60 * 60;
private String entityID;
private PublicKey signatureValidationKey;
private final CompositeKeyLocator signatureValidationKeyLocator = new CompositeKeyLocator();
private SingleSignOnService singleSignOnService;
private SingleLogoutService singleLogoutService;
private final List<PublicKey> signatureValidationKeys = new LinkedList<>();
private int minTimeBetweenDescriptorRequests;
private HttpClient client;
@Override
public String getEntityID() {
@@ -200,16 +212,25 @@ public class DefaultSamlDeployment implements SamlDeployment {
}
@Override
public PublicKey getSignatureValidationKey() {
return signatureValidationKey;
public KeyLocator getSignatureValidationKeyLocator() {
return this.signatureValidationKeyLocator;
}
@Override
public int getMinTimeBetweenDescriptorRequests() {
return minTimeBetweenDescriptorRequests;
}
public void setMinTimeBetweenDescriptorRequests(int minTimeBetweenDescriptorRequests) {
this.minTimeBetweenDescriptorRequests = minTimeBetweenDescriptorRequests;
}
public void setEntityID(String entityID) {
this.entityID = entityID;
}
public void setSignatureValidationKey(PublicKey signatureValidationKey) {
this.signatureValidationKey = signatureValidationKey;
public void addSignatureValidationKey(PublicKey signatureValidationKey) {
this.signatureValidationKeys.add(signatureValidationKey);
}
public void setSingleSignOnService(SingleSignOnService singleSignOnService) {
@@ -219,6 +240,31 @@ public class DefaultSamlDeployment implements SamlDeployment {
public void setSingleLogoutService(SingleLogoutService singleLogoutService) {
this.singleLogoutService = singleLogoutService;
}
public void refreshKeyLocatorConfiguration() {
this.signatureValidationKeyLocator.clear();
// When key is set, use that (and only that), otherwise configure dynamic key locator
if (! this.signatureValidationKeys.isEmpty()) {
this.signatureValidationKeyLocator.add(new HardcodedKeyLocator(this.signatureValidationKeys));
} else if (this.singleSignOnService != null) {
String samlDescriptorUrl = singleSignOnService.getRequestBindingUrl() + "/descriptor";
HttpClient httpClient = getClient();
SamlDescriptorPublicKeyLocator samlDescriptorPublicKeyLocator =
new SamlDescriptorPublicKeyLocator(
samlDescriptorUrl, this.minTimeBetweenDescriptorRequests, DEFAULT_CACHE_TTL, httpClient);
this.signatureValidationKeyLocator.add(samlDescriptorPublicKeyLocator);
}
}
@Override
public HttpClient getClient() {
return this.client;
}
public void setClient(HttpClient client) {
this.client = client;
}
}
private IDP idp;
@@ -22,14 +22,18 @@ import org.keycloak.saml.SignatureAlgorithm;
import java.security.KeyPair;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.util.Set;
import org.apache.http.client.HttpClient;
import org.keycloak.rotation.KeyLocator;
/**
* Represents SAML deployment configuration.
*
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
public interface SamlDeployment {
enum Binding {
POST,
REDIRECT;
@@ -41,20 +45,68 @@ public interface SamlDeployment {
}
public interface IDP {
/**
* Returns entity identifier of this IdP.
* @return see description.
*/
String getEntityID();
/**
* Returns Single sign on service configuration for this IdP.
* @return see description.
*/
SingleSignOnService getSingleSignOnService();
/**
* Returns Single logout service configuration for this IdP.
* @return see description.
*/
SingleLogoutService getSingleLogoutService();
PublicKey getSignatureValidationKey();
/**
* Returns {@link KeyLocator} looking up public keys used for validation of IdP signatures.
* @return see description.
*/
KeyLocator getSignatureValidationKeyLocator();
/**
* Returns minimum time (in seconds) between issuing requests to IdP SAML descriptor.
* Used e.g. by {@link KeyLocator} looking up public keys for validation of IdP signatures
* to prevent too frequent requests.
*
* @return see description.
*/
int getMinTimeBetweenDescriptorRequests();
/**
* Returns {@link HttpClient} instance that will be used for http communication with this IdP.
* @return see description
*/
HttpClient getClient();
public interface SingleSignOnService {
/**
* Returns {@code true} if the requests to IdP need to be signed by SP key.
* @return see dscription
*/
boolean signRequest();
/**
* Returns {@code true} if the complete response message from IdP should
* be checked for valid signature.
* @return see dscription
*/
boolean validateResponseSignature();
/**
* Returns {@code true} if individual assertions in response from IdP should
* be checked for valid signature.
* @return see dscription
*/
boolean validateAssertionSignature();
Binding getRequestBinding();
Binding getResponseBinding();
String getRequestBindingUrl();
}
public interface SingleLogoutService {
boolean validateRequestSignature();
boolean validateResponseSignature();
@@ -67,10 +119,19 @@ public interface SamlDeployment {
}
}
/**
* Returns Identity Provider configuration for this SAML deployment.
* @return see description.
*/
public IDP getIDP();
public boolean isConfigured();
SslRequired getSslRequired();
/**
* Returns entity identifier of this SP.
* @return see description.
*/
String getEntityID();
String getNameIDPolicyFormat();
boolean isForceAuthentication();
@@ -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();
@@ -19,6 +19,7 @@ package org.keycloak.adapters.saml.config;
import java.io.Serializable;
import java.util.List;
import org.keycloak.adapters.cloned.AdapterHttpClientConfig;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -157,12 +158,97 @@ public class IDP implements Serializable {
}
}
public static class HttpClientConfig implements AdapterHttpClientConfig {
private String truststore;
private String truststorePassword;
private String clientKeystore;
private String clientKeystorePassword;
private boolean allowAnyHostname;
private boolean disableTrustManager;
private int connectionPoolSize;
private String proxyUrl;
@Override
public String getTruststore() {
return truststore;
}
public void setTruststore(String truststore) {
this.truststore = truststore;
}
@Override
public String getTruststorePassword() {
return truststorePassword;
}
public void setTruststorePassword(String truststorePassword) {
this.truststorePassword = truststorePassword;
}
@Override
public String getClientKeystore() {
return clientKeystore;
}
public void setClientKeystore(String clientKeystore) {
this.clientKeystore = clientKeystore;
}
@Override
public String getClientKeystorePassword() {
return clientKeystorePassword;
}
public void setClientKeystorePassword(String clientKeystorePassword) {
this.clientKeystorePassword = clientKeystorePassword;
}
@Override
public boolean isAllowAnyHostname() {
return allowAnyHostname;
}
public void setAllowAnyHostname(boolean allowAnyHostname) {
this.allowAnyHostname = allowAnyHostname;
}
@Override
public boolean isDisableTrustManager() {
return disableTrustManager;
}
public void setDisableTrustManager(boolean disableTrustManager) {
this.disableTrustManager = disableTrustManager;
}
@Override
public int getConnectionPoolSize() {
return connectionPoolSize;
}
public void setConnectionPoolSize(int connectionPoolSize) {
this.connectionPoolSize = connectionPoolSize;
}
@Override
public String getProxyUrl() {
return proxyUrl;
}
public void setProxyUrl(String proxyUrl) {
this.proxyUrl = proxyUrl;
}
}
private String entityID;
private String signatureAlgorithm;
private String signatureCanonicalizationMethod;
private SingleSignOnService singleSignOnService;
private SingleLogoutService singleLogoutService;
private List<Key> keys;
private AdapterHttpClientConfig httpClientConfig = new HttpClientConfig();
public String getEntityID() {
return entityID;
@@ -212,4 +298,12 @@ public class IDP implements Serializable {
this.signatureCanonicalizationMethod = signatureCanonicalizationMethod;
}
public AdapterHttpClientConfig getHttpClientConfig() {
return httpClientConfig;
}
public void setHttpClientConfig(AdapterHttpClientConfig httpClientConfig) {
this.httpClientConfig = httpClientConfig;
}
}
@@ -72,4 +72,15 @@ 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 HTTP_CLIENT_ELEMENT = "HttpClient";
public static final String ALLOW_ANY_HOSTNAME_ATTR = "allowAnyHostname";
public static final String CLIENT_KEYSTORE_ATTR = "clientKeystore";
public static final String CLIENT_KEYSTORE_PASSWORD_ATTR = "clientKeystorePassword";
public static final String CONNECTION_POOL_SIZE_ATTR = "connectionPoolSize";
public static final String DISABLE_TRUST_MANAGER_ATTR = "disableTrustManager";
public static final String PROXY_URL_ATTR = "proxyUrl";
public static final String TRUSTSTORE_ATTR = "truststore";
public static final String TRUSTSTORE_PASSWORD_ATTR = "truststorePassword";
}
@@ -40,6 +40,7 @@ import java.security.PublicKey;
import java.security.cert.Certificate;
import java.util.HashSet;
import java.util.Set;
import org.keycloak.adapters.cloned.HttpClientBuilder;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -178,35 +179,39 @@ public class DeploymentBuilder {
if (sp.getIdp().getKeys() != null) {
for (Key key : sp.getIdp().getKeys()) {
if (key.isSigning()) {
if (key.getKeystore() != null) {
KeyStore keyStore = loadKeystore(resourceLoader, key);
Certificate cert = null;
try {
cert = keyStore.getCertificate(key.getKeystore().getCertificateAlias());
} catch (KeyStoreException e) {
throw new RuntimeException(e);
}
idp.setSignatureValidationKey(cert.getPublicKey());
} else {
if (key.getPublicKeyPem() == null && key.getCertificatePem() == null) {
throw new RuntimeException("IDP signing key must have a PublicKey or Certificate defined");
}
try {
PublicKey publicKey = getPublicKeyFromPem(key);
idp.setSignatureValidationKey(publicKey);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
processSigningKey(idp, key, resourceLoader);
}
}
}
idp.setClient(new HttpClientBuilder().build(sp.getIdp().getHttpClientConfig()));
idp.refreshKeyLocatorConfiguration();
return deployment;
}
protected static PublicKey getPublicKeyFromPem(Key key) throws Exception {
private void processSigningKey(DefaultSamlDeployment.DefaultIDP idp, Key key, ResourceLoader resourceLoader) throws RuntimeException {
PublicKey publicKey;
if (key.getKeystore() != null) {
KeyStore keyStore = loadKeystore(resourceLoader, key);
Certificate cert = null;
try {
cert = keyStore.getCertificate(key.getKeystore().getCertificateAlias());
} catch (KeyStoreException e) {
throw new RuntimeException(e);
}
publicKey = cert.getPublicKey();
} else {
if (key.getPublicKeyPem() == null && key.getCertificatePem() == null) {
throw new RuntimeException("IDP signing key must have a PublicKey or Certificate defined");
}
publicKey = getPublicKeyFromPem(key);
}
idp.addSignatureValidationKey(publicKey);
}
protected static PublicKey getPublicKeyFromPem(Key key) {
PublicKey publicKey;
if (key.getPublicKeyPem() != null) {
publicKey = PemUtils.decodePublicKey(key.getPublicKeyPem().trim());
@@ -29,6 +29,10 @@ import javax.xml.stream.events.EndElement;
import javax.xml.stream.events.StartElement;
import javax.xml.stream.events.XMLEvent;
import java.util.List;
import org.keycloak.adapters.saml.config.IDP.HttpClientConfig;
import static org.keycloak.adapters.saml.config.parsers.SPXmlParser.getAttributeValue;
import static org.keycloak.adapters.saml.config.parsers.SPXmlParser.getBooleanAttributeValue;
import static org.keycloak.adapters.saml.config.parsers.SPXmlParser.getIntegerAttributeValue;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -41,16 +45,16 @@ public class IDPXmlParser extends AbstractParser {
StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
StaxParserUtil.validate(startElement, ConfigXmlConstants.IDP_ELEMENT);
IDP idp = new IDP();
String entityID = SPXmlParser.getAttributeValue(startElement, ConfigXmlConstants.ENTITY_ID_ATTR);
String entityID = getAttributeValue(startElement, ConfigXmlConstants.ENTITY_ID_ATTR);
if (entityID == null) {
throw new ParsingException("entityID must be set on IDP");
}
idp.setEntityID(entityID);
boolean signaturesRequired = SPXmlParser.getBooleanAttributeValue(startElement, ConfigXmlConstants.SIGNATURES_REQUIRED_ATTR);
idp.setSignatureCanonicalizationMethod(SPXmlParser.getAttributeValue(startElement, ConfigXmlConstants.SIGNATURE_CANONICALIZATION_METHOD_ATTR));
idp.setSignatureAlgorithm(SPXmlParser.getAttributeValue(startElement, ConfigXmlConstants.SIGNATURE_ALGORITHM_ATTR));
boolean signaturesRequired = getBooleanAttributeValue(startElement, ConfigXmlConstants.SIGNATURES_REQUIRED_ATTR);
idp.setSignatureCanonicalizationMethod(getAttributeValue(startElement, ConfigXmlConstants.SIGNATURE_CANONICALIZATION_METHOD_ATTR));
idp.setSignatureAlgorithm(getAttributeValue(startElement, ConfigXmlConstants.SIGNATURE_ALGORITHM_ATTR));
while (xmlEventReader.hasNext()) {
XMLEvent xmlEvent = StaxParserUtil.peek(xmlEventReader);
if (xmlEvent == null)
@@ -75,6 +79,10 @@ public class IDPXmlParser extends AbstractParser {
IDP.SingleLogoutService slo = parseSingleLogoutService(xmlEventReader, signaturesRequired);
idp.setSingleLogoutService(slo);
} else if (tag.equals(ConfigXmlConstants.HTTP_CLIENT_ELEMENT)) {
HttpClientConfig config = parseHttpClientElement(xmlEventReader);
idp.setHttpClientConfig(config);
} else if (tag.equals(ConfigXmlConstants.KEYS_ELEMENT)) {
KeysXmlParser parser = new KeysXmlParser();
List<Key> keys = (List<Key>)parser.parse(xmlEventReader);
@@ -90,29 +98,63 @@ public class IDPXmlParser extends AbstractParser {
protected IDP.SingleLogoutService parseSingleLogoutService(XMLEventReader xmlEventReader, boolean signaturesRequired) throws ParsingException {
IDP.SingleLogoutService slo = new IDP.SingleLogoutService();
StartElement element = StaxParserUtil.getNextStartElement(xmlEventReader);
slo.setSignRequest(SPXmlParser.getBooleanAttributeValue(element, ConfigXmlConstants.SIGN_REQUEST_ATTR, signaturesRequired));
slo.setValidateResponseSignature(SPXmlParser.getBooleanAttributeValue(element, ConfigXmlConstants.VALIDATE_RESPONSE_SIGNATURE_ATTR, signaturesRequired));
slo.setValidateRequestSignature(SPXmlParser.getBooleanAttributeValue(element, ConfigXmlConstants.VALIDATE_REQUEST_SIGNATURE_ATTR, signaturesRequired));
slo.setRequestBinding(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.REQUEST_BINDING_ATTR));
slo.setResponseBinding(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.RESPONSE_BINDING_ATTR));
slo.setSignResponse(SPXmlParser.getBooleanAttributeValue(element, ConfigXmlConstants.SIGN_RESPONSE_ATTR, signaturesRequired));
slo.setPostBindingUrl(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.POST_BINDING_URL_ATTR));
slo.setRedirectBindingUrl(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.REDIRECT_BINDING_URL_ATTR));
slo.setSignRequest(getBooleanAttributeValue(element, ConfigXmlConstants.SIGN_REQUEST_ATTR, signaturesRequired));
slo.setValidateResponseSignature(getBooleanAttributeValue(element, ConfigXmlConstants.VALIDATE_RESPONSE_SIGNATURE_ATTR, signaturesRequired));
slo.setValidateRequestSignature(getBooleanAttributeValue(element, ConfigXmlConstants.VALIDATE_REQUEST_SIGNATURE_ATTR, signaturesRequired));
slo.setRequestBinding(getAttributeValue(element, ConfigXmlConstants.REQUEST_BINDING_ATTR));
slo.setResponseBinding(getAttributeValue(element, ConfigXmlConstants.RESPONSE_BINDING_ATTR));
slo.setSignResponse(getBooleanAttributeValue(element, ConfigXmlConstants.SIGN_RESPONSE_ATTR, signaturesRequired));
slo.setPostBindingUrl(getAttributeValue(element, ConfigXmlConstants.POST_BINDING_URL_ATTR));
slo.setRedirectBindingUrl(getAttributeValue(element, ConfigXmlConstants.REDIRECT_BINDING_URL_ATTR));
return slo;
}
protected IDP.SingleSignOnService parseSingleSignOnService(XMLEventReader xmlEventReader, boolean signaturesRequired) throws ParsingException {
IDP.SingleSignOnService sso = new IDP.SingleSignOnService();
StartElement element = StaxParserUtil.getNextStartElement(xmlEventReader);
sso.setSignRequest(SPXmlParser.getBooleanAttributeValue(element, ConfigXmlConstants.SIGN_REQUEST_ATTR, signaturesRequired));
sso.setValidateResponseSignature(SPXmlParser.getBooleanAttributeValue(element, ConfigXmlConstants.VALIDATE_RESPONSE_SIGNATURE_ATTR, signaturesRequired));
sso.setValidateAssertionSignature(SPXmlParser.getBooleanAttributeValue(element, ConfigXmlConstants.VALIDATE_ASSERTION_SIGNATURE_ATTR));
sso.setRequestBinding(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.REQUEST_BINDING_ATTR));
sso.setResponseBinding(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.RESPONSE_BINDING_ATTR));
sso.setBindingUrl(SPXmlParser.getAttributeValue(element, ConfigXmlConstants.BINDING_URL_ATTR));
sso.setSignRequest(getBooleanAttributeValue(element, ConfigXmlConstants.SIGN_REQUEST_ATTR, signaturesRequired));
sso.setValidateResponseSignature(getBooleanAttributeValue(element, ConfigXmlConstants.VALIDATE_RESPONSE_SIGNATURE_ATTR, signaturesRequired));
sso.setValidateAssertionSignature(getBooleanAttributeValue(element, ConfigXmlConstants.VALIDATE_ASSERTION_SIGNATURE_ATTR));
sso.setRequestBinding(getAttributeValue(element, ConfigXmlConstants.REQUEST_BINDING_ATTR));
sso.setResponseBinding(getAttributeValue(element, ConfigXmlConstants.RESPONSE_BINDING_ATTR));
sso.setBindingUrl(getAttributeValue(element, ConfigXmlConstants.BINDING_URL_ATTR));
return sso;
}
private HttpClientConfig parseHttpClientElement(XMLEventReader xmlEventReader) throws ParsingException {
StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
StaxParserUtil.validate(startElement, ConfigXmlConstants.HTTP_CLIENT_ELEMENT);
HttpClientConfig config = new HttpClientConfig();
config.setAllowAnyHostname(getBooleanAttributeValue(startElement, ConfigXmlConstants.ALLOW_ANY_HOSTNAME_ATTR, false));
config.setClientKeystore(getAttributeValue(startElement, ConfigXmlConstants.CLIENT_KEYSTORE_ATTR));
config.setClientKeystorePassword(getAttributeValue(startElement, ConfigXmlConstants.CLIENT_KEYSTORE_PASSWORD_ATTR));
config.setConnectionPoolSize(getIntegerAttributeValue(startElement, ConfigXmlConstants.CONNECTION_POOL_SIZE_ATTR, 0));
config.setDisableTrustManager(getBooleanAttributeValue(startElement, ConfigXmlConstants.ALLOW_ANY_HOSTNAME_ATTR, false));
config.setProxyUrl(getAttributeValue(startElement, ConfigXmlConstants.PROXY_URL_ATTR));
config.setTruststore(getAttributeValue(startElement, ConfigXmlConstants.TRUSTSTORE_ATTR));
config.setTruststorePassword(getAttributeValue(startElement, ConfigXmlConstants.TRUSTSTORE_PASSWORD_ATTR));
while (xmlEventReader.hasNext()) {
XMLEvent xmlEvent = StaxParserUtil.peek(xmlEventReader);
if (xmlEvent == null)
break;
if (xmlEvent instanceof EndElement) {
EndElement endElement = (EndElement) StaxParserUtil.getNextEvent(xmlEventReader);
String endElementName = StaxParserUtil.getEndElementName(endElement);
if (endElementName.equals(ConfigXmlConstants.ROLE_IDENTIFIERS_ELEMENT))
break;
else
continue;
}
String tag = StaxParserUtil.getStartElementName(startElement);
StaxParserUtil.bypassElementBlock(xmlEventReader, tag);
}
return config;
}
@Override
public boolean supports(QName qname) {
return false;
@@ -48,6 +48,13 @@ public class SPXmlParser extends AbstractParser {
return str;
}
public static int getIntegerAttributeValue(StartElement startElement, String tag, int defaultValue) {
String result = getAttributeValue(startElement, tag);
if (result == null)
return defaultValue;
return Integer.valueOf(result);
}
public static boolean getBooleanAttributeValue(StartElement startElement, String tag, boolean defaultValue) {
String result = getAttributeValue(startElement, tag);
if (result == null)
@@ -0,0 +1,101 @@
/*
* 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.saml.descriptor.parsers;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.crypto.MarshalException;
import javax.xml.crypto.dom.DOMStructure;
import javax.xml.crypto.dsig.keyinfo.KeyInfo;
import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.keycloak.common.util.MultivaluedHashMap;
import org.keycloak.saml.common.constants.JBossSAMLConstants;
import org.keycloak.saml.common.constants.JBossSAMLURIConstants;
import org.keycloak.saml.common.exceptions.ParsingException;
import org.keycloak.saml.processing.core.util.NamespaceContext;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
/**
* Goes through the given XML file and extracts names, certificates and keys from the KeyInfo elements.
* @author hmlnarik
*/
public class SamlDescriptorIDPKeysExtractor {
private static final NamespaceContext NS_CONTEXT = new NamespaceContext();
static {
NS_CONTEXT.addNsUriPair("m", JBossSAMLURIConstants.METADATA_NSURI.get());
NS_CONTEXT.addNsUriPair("dsig", JBossSAMLURIConstants.XMLDSIG_NSURI.get());
}
private final KeyInfoFactory kif = KeyInfoFactory.getInstance();
private final XPathFactory xPathfactory = XPathFactory.newInstance();
private final XPath xpath = xPathfactory.newXPath();
{
xpath.setNamespaceContext(NS_CONTEXT);
}
public MultivaluedHashMap<String, KeyInfo> parse(InputStream stream) throws ParsingException {
MultivaluedHashMap<String, KeyInfo> res = new MultivaluedHashMap<>();
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(stream);
XPathExpression expr = xpath.compile("/m:EntitiesDescriptor/m:EntityDescriptor/m:IDPSSODescriptor/m:KeyDescriptor");
NodeList keyDescriptors = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
for (int i = 0; i < keyDescriptors.getLength(); i ++) {
Node keyDescriptor = keyDescriptors.item(i);
Element keyDescriptorEl = (Element) keyDescriptor;
KeyInfo ki = processKeyDescriptor(keyDescriptorEl);
if (ki != null) {
String use = keyDescriptorEl.getAttribute(JBossSAMLConstants.USE.get());
res.add(use, ki);
}
}
} catch (SAXException | IOException | ParserConfigurationException | MarshalException | XPathExpressionException e) {
throw new ParsingException("Error parsing SAML descriptor", e);
}
return res;
}
private KeyInfo processKeyDescriptor(Element keyDescriptor) throws MarshalException {
NodeList childNodes = keyDescriptor.getElementsByTagNameNS(JBossSAMLURIConstants.XMLDSIG_NSURI.get(), JBossSAMLConstants.KEY_INFO.get());
if (childNodes.getLength() == 0) {
return null;
}
Node keyInfoNode = childNodes.item(0);
return (keyInfoNode == null) ? null : kif.unmarshalKeyInfo(new DOMStructure(keyInfoNode));
}
}
@@ -60,15 +60,22 @@ 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;
import java.net.URI;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.KeyManagementException;
import java.security.PublicKey;
import java.security.Signature;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.security.SignatureException;
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;
/**
*
@@ -187,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;
@@ -257,13 +264,44 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
}
private void validateSamlSignature(SAMLDocumentHolder holder, boolean postBinding, String paramKey) throws VerificationException {
KeyLocator signatureValidationKey = deployment.getIDP().getSignatureValidationKeyLocator();
if (postBinding) {
verifyPostBindingSignature(holder.getSamlDocument(), deployment.getIDP().getSignatureValidationKey());
verifyPostBindingSignature(holder.getSamlDocument(), signatureValidationKey);
} else {
verifyRedirectBindingSignature(deployment.getIDP().getSignatureValidationKey(), paramKey);
String keyId = getMessageSigningKeyId(holder.getSamlObject());
verifyRedirectBindingSignature(paramKey, signatureValidationKey, keyId);
}
}
private String getMessageSigningKeyId(SAML2Object doc) {
final ExtensionsType extensions;
if (doc instanceof RequestAbstractType) {
extensions = ((RequestAbstractType) doc).getExtensions();
} else if (doc instanceof StatusResponseType) {
extensions = ((StatusResponseType) doc).getExtensions();
} else {
return null;
}
if (extensions == null) {
return null;
}
for (Object ext : extensions.getAny()) {
if (! (ext instanceof Element)) {
continue;
}
String res = KeycloakKeySamlExtensionGenerator.getMessageSigningKeyIdFromElement((Element) ext);
if (res != null) {
return res;
}
}
return null;
}
private boolean checkStatusCodeValue(StatusCodeType statusCode, String expectedValue){
if(statusCode != null && statusCode.getValue()!=null){
String v = statusCode.getValue().toString();
@@ -272,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)) {
@@ -295,6 +350,7 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
return 403;
}
};
return AuthOutcome.FAILED;
}
if (deployment.getIDP().getSingleSignOnService().validateAssertionSignature()) {
@@ -306,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;
@@ -409,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) {
@@ -473,10 +537,10 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
return false;
}
public void verifyPostBindingSignature(Document document, PublicKey publicKey) throws VerificationException {
public void verifyPostBindingSignature(Document document, KeyLocator keyLocator) throws VerificationException {
SAML2Signature saml2Signature = new SAML2Signature();
try {
if (!saml2Signature.validate(document, publicKey)) {
if (!saml2Signature.validate(document, keyLocator)) {
throw new VerificationException("Invalid signature on document");
}
} catch (ProcessingException e) {
@@ -484,7 +548,7 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
}
}
public void verifyRedirectBindingSignature(PublicKey publicKey, String paramKey) throws VerificationException {
private void verifyRedirectBindingSignature(String paramKey, KeyLocator keyLocator, String keyId) throws VerificationException {
String request = facade.getRequest().getQueryParamValue(paramKey);
String algorithm = facade.getRequest().getQueryParamValue(GeneralConstants.SAML_SIG_ALG_REQUEST_KEY);
String signature = facade.getRequest().getQueryParamValue(GeneralConstants.SAML_SIGNATURE_REQUEST_KEY);
@@ -511,16 +575,76 @@ public abstract class AbstractSamlAuthenticationHandler implements SamlAuthentic
try {
//byte[] decodedSignature = RedirectBindingUtil.urlBase64Decode(signature);
byte[] decodedSignature = Base64.decode(signature);
byte[] rawQueryBytes = rawQuery.getBytes("UTF-8");
SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.getFromXmlMethod(decodedAlgorithm);
Signature validator = signatureAlgorithm.createSignature(); // todo plugin signature alg
validator.initVerify(publicKey);
validator.update(rawQuery.getBytes("UTF-8"));
if (!validator.verify(decodedSignature)) {
if (! validateRedirectBindingSignature(signatureAlgorithm, rawQueryBytes, decodedSignature, keyLocator, keyId)) {
throw new VerificationException("Invalid query param signature");
}
} catch (Exception e) {
throw new VerificationException(e);
}
}
private boolean validateRedirectBindingSignature(SignatureAlgorithm sigAlg, byte[] rawQueryBytes, byte[] decodedSignature, KeyLocator locator, String keyId)
throws KeyManagementException, VerificationException {
try {
Key key;
try {
key = locator.getKey(keyId);
boolean keyLocated = key != null;
if (keyLocated) {
return validateRedirectBindingSignatureForKey(sigAlg, rawQueryBytes, decodedSignature, key);
}
} catch (KeyManagementException ex) {
}
} catch (SignatureException ex) {
log.debug("Verification failed for key %s: %s", keyId, ex);
log.trace(ex);
}
if (locator instanceof Iterable) {
Iterable<Key> availableKeys = (Iterable<Key>) locator;
log.trace("Trying hard to validate XML signature using all available keys.");
for (Key key : availableKeys) {
try {
if (validateRedirectBindingSignatureForKey(sigAlg, rawQueryBytes, decodedSignature, key)) {
return true;
}
} catch (SignatureException ex) {
log.debug("Verification failed: %s", ex);
}
}
}
return false;
}
private boolean validateRedirectBindingSignatureForKey(SignatureAlgorithm sigAlg, byte[] rawQueryBytes, byte[] decodedSignature, Key key)
throws SignatureException {
if (key == null) {
return false;
}
if (! (key instanceof PublicKey)) {
log.warnf("Unusable key for signature validation: %s", key);
return false;
}
Signature signature = sigAlg.createSignature(); // todo plugin signature alg
try {
signature.initVerify((PublicKey) key);
} catch (InvalidKeyException ex) {
log.warnf(ex, "Unusable key for signature validation: %s", key);
return false;
}
signature.update(rawQueryBytes);
return signature.verify(decodedSignature);
}
}
Loaded 100 of 2223 files, more files were not shown because too many files have changed in this diff. Show more