Compare commits

..
406 Commits
Author SHA1 Message Date
keycloak-bot 517588ecca Set version to 3.4.3.Final 2018-01-04 08:16:17 +00:00
stianst 74fbe3ff6d Include Jetty 9.1 in product profile 2018-01-04 09:14:05 +01:00
Hynek Mlnarik 1c7fff0e92 KEYCLOAK-6108 Remove DROP INDEX in postgres (handled automatically)
(cherry picked from commit 2bb39911edaa911e4e03179349e454ba440bf48d)
2018-01-04 09:03:57 +01:00
Hynek Mlnarik c724a25a77 KEYCLOAK-6095 Include schema in custom SQL
(cherry picked from commit 2b4cbe9b0447d19f1e0fbe87f8fae44a94156dd9)
2018-01-04 09:03:57 +01:00
Hynek Mlnarik c2a20cbd34 KEYCLOAK-6106 Put dotless ids first in identity broker state
(cherry picked from commit 6a44edcc918ed04f360afee89a410f12f6cc103d)
2018-01-03 08:10:46 +01:00
stianst d40dac5e40 KEYCLOAK-6079 2018-01-02 15:15:47 +01:00
stianst ecc08b9c09 KEYCLOAK-6090 Add missing cors headers with invalid username/password and resource owner grant 2018-01-02 15:15:17 +01:00
keycloak-bot ec5616b96d Set version to 3.4.3.Final-SNAPSHOT 2017-12-21 13:44:06 +00:00
keycloak-bot 4bbd603a0e Set version to 3.4.2.Final 2017-12-21 12:57:58 +00:00
Marko Strukelj 23d0afbfd8 KEYCLOAK-6058 Partial import should ignore built-in clients 2017-12-21 13:52:58 +01:00
stianst e3995c0154 KEYCLOAK-6079 2017-12-21 12:18:12 +01:00
stianst e4185496fd KEYCLOAK-6078
Account2 is listed as disabled feature in product even though it's not included at all
2017-12-21 11:45:00 +01:00
stianst c7ce279aef KEYCLOAK-6076 Exclude transitive dependencies in Fuse ZIP 2017-12-21 09:03:21 +01:00
John Ament 156ce0c0ea KEYCLOAK-4853 Introduce dedicated utility for parsing ID from URI 2017-12-20 15:00:07 +01:00
Hynek Mlnarik 0f047ac9f5 KEYCLOAK-6067 Allow http for performance testsuite realms 2017-12-20 14:56:42 +01:00
stianst f0c5752ef9 KEYCLOAK-5443 Fix update user account when both email as username and edit username are enabled 2017-12-20 14:40:03 +01:00
Martin Kanis 351dbffaf2 KEYCLOAK-5172 Set oidc as default protocol to clients 2017-12-20 13:38:12 +01:00
Bruno Oliveira 811cd3a04a KEYCLOAK-6011 2017-12-20 13:37:11 +01:00
Marko Strukelj ae573f4814 KEYCLOAK-5617 KEYCLOAK-5993 Race condition putting new user in user cache 2017-12-20 13:35:35 +01:00
Pedro Igor 7e072abf74 Merge pull request #4873 from pedroigor/master
[KEYCLOAK-5806] - Returning from child policy not restoring state
2017-12-20 08:53:50 -02:00
stianst e96c6a4bcb KEYCLOAK-6068 Fix preflight request on admin endpoints 2017-12-20 10:19:34 +01:00
stianst 7d2d7e41d9 KEYCLOAK-6065 Prevent password managers from saving credentials in admin console 2017-12-20 06:46:54 +01:00
Hynek Mlnarik 626004e782 KEYCLOAK-6066 Be less strict when handling cookies 2017-12-19 21:39:41 +01:00
pedroigor 3846cfdb4f [KEYCLOAK-5806] - Changing apply policy component and more tests 2017-12-19 17:28:46 -02:00
stianst 902b799bdf KEYCLOAK-6064 Fix identity providers page when realm has no configured providers 2017-12-19 17:56:48 +01:00
stianst 465675ac28 KEYCLOAK-5019 Fixes for password managers 2017-12-19 16:13:16 +01:00
pedroigor 2ace312501 [KEYCLOAK-5806] - More UI tests for parent/child policy flow 2017-12-19 12:13:04 -02:00
pedroigor c00d89aec3 [KEYCLOAK-5806] - Returning from child policy not restoring state 2017-12-19 10:00:14 -02:00
stianst 61fe554617 KEYCLOAK-6051 Fix licenses 2017-12-19 08:20:29 +01:00
mposolda 5a66f577eb KEYCLOAK-5982 Fix NPEs when client 'account' was renamed/removed 2017-12-18 21:47:17 +01:00
pskopek e29ccebc21 KEYCLOAK-5666 removed not needed decodeToObject methods 2017-12-18 19:19:00 +01:00
stianst 27b5e1aae2 KEYCLOAK-6050 Fix export doesn't export internal realm rep 2017-12-18 13:15:42 +01:00
stianst 71e6f52f7d KEYCLOAK-6022 2017-12-18 11:48:39 +01:00
stianst b303acaaba KEYCLOAK-2120 Added manual setup page for OTP 2017-12-18 11:20:20 +01:00
Bill Burke 118e998570 Merge pull request #4834 from pedroigor/KEYCLOAK-5806
[KEYCLOAK-5806] - Create policy button to associated policies
2017-12-16 23:44:35 -05:00
Bill Burke f3fcac2d8d Merge pull request #4865 from patriot1burke/master
KEYCLOAK-5420
2017-12-16 14:31:37 -05:00
Bill Burke b5ae7e836d smaller times 2017-12-16 13:18:41 -05:00
Bill Burke a27097e9ef reset defaults 2017-12-16 11:28:15 -05:00
Bill Burke 003f27e9bd fix more 2017-12-16 08:31:33 -05:00
Bill Burke 76cccc3f2b fix more 2017-12-16 08:29:58 -05:00
Bill Burke 80be4c9dbc fix more 2017-12-16 07:12:32 -05:00
pedroigor 5d7ba39e0c [KEYCLOAK-5806] - Create policy component to permission pages 2017-12-15 23:41:52 -02:00
pedroigor e2118856ca [KEYCLOAK-5806] - Adding table of selected policies 2017-12-15 22:04:37 -02:00
pedroigor 3ee760ed23 [KEYCLOAK-5806] - More tests asserting creation of child policies 2017-12-15 22:04:37 -02:00
pedroigor eba47b3c89 [KEYCLOAK-5806] - Create policy button to Aggregated Policies 2017-12-15 22:04:37 -02:00
Pavel Drozd b121306749 Merge pull request #4866 from pdrozd/KEYCLOAK-6054
KEYCLOAK-6054 Fuse adapter tests - add httpclient dependency
2017-12-15 23:44:33 +01:00
Pavel Drozd 4097a81142 Merge pull request #4860 from pdrozd/KEYCLOAK-6047
KEYCLOAK-6047 Added ide time window to mellon test
2017-12-15 22:23:19 +01:00
Pavel Drozd ce6f73ce74 KEYCLOAK-6054 Fuse adapter tests - add httpclient dependency 2017-12-15 22:22:16 +01:00
Bill Burke 1eec2747ef fix stupidity 2017-12-15 15:31:14 -05:00
Pedro Igor 6bfdc9451d Merge pull request #4861 from pedroigor/KEYCLOAK-6023
[KEYCLOAK-6023] - Upgrading Drools to 6.5.0.Final
2017-12-15 15:46:28 -02:00
Pedro Igor a66fe003d3 Merge pull request #4863 from pedroigor/KEYCLOAK-5877
[KEYCLOAK-5877] - Allow save permissions without policies
2017-12-15 15:45:38 -02:00
Bill Burke 7cb39c2dfc KEYCLOAK-5420 2017-12-15 12:16:24 -05:00
Bill Burke 90b5dd60fd Merge pull request #4864 from patriot1burke/master
KEYCLOAK-4427
2017-12-15 11:44:16 -05:00
Stan Silvert a719b73808 KEYCLOAK-5935: No success msg on client role add/remove 2017-12-15 10:54:43 -05:00
Bill Burke 1c38cec10f KEYCLOAK-4427 2017-12-15 10:53:13 -05:00
Bill Burke e7c25f76a7 KEYCLOAK-4427 2017-12-15 10:49:51 -05:00
pedroigor 94928323ee [KEYCLOAK-5877] - Allow saving permissions without policies 2017-12-15 12:55:07 -02:00
Hynek Mlnarik e4a91c0706 KEYCLOAK-6042 Encode user ID before storing in auth session 2017-12-15 15:16:26 +01:00
Pavel Drozd a7c6eb4999 KEYCLOAK-6047 Added ide time window to mellon test 2017-12-15 14:57:26 +01:00
Pavel Drozd 1b14f9e73e Merge pull request #4847 from vramik/KEYCLOAK-4793
KEYCLOAK-4793 moved profile a lever lower due to migration test
2017-12-15 14:52:04 +01:00
pedroigor 569378b446 [KEYCLOAK-6023] - Upgrading Drools to 6.5.0.Final 2017-12-15 10:22:05 -02:00
stianst a8943fb323 KEYCLOAK-6043 Use same urls for get and posts in account 2017-12-15 08:31:04 +01:00
Bruno Oliveira 1a541889f4 [KEYCLOAK-6015] replyTo can be empty string in DB 2017-12-15 07:01:15 +01:00
stianst b672229efc KEYCLOAK-6032 Fix error page when internationalization is enabled 2017-12-15 06:32:00 +01:00
Stan Silvert 2b11938084 KEYCLOAK-5932: Remove social idp from dropdown if already defined 2017-12-14 20:18:56 -05:00
Stan Silvert 97e3b26a5c KEYCLOAK-5934: Event filters allowing free values in select2 inputs 2017-12-14 16:38:02 -05:00
Vlastimil Elias 7e20a65989 KEYCLOAK-6040 AuthenticationSessionModel pushing into
EmailTemplateProvider
2017-12-14 15:51:04 +01:00
Martin Kanis 47721957b7 KEYCLOAK-6018 Create BOM for Drools dependencies 2017-12-14 14:51:25 +01:00
Stan Silvert 068785f227 KEYCLOAK-6042: Remove keycloak-preview from product build. 2017-12-14 14:09:04 +01:00
sebastienblanc a96c9d34c9 set auth contraint to true when wildcard is used 2017-12-14 14:00:03 +01:00
Hisanobu Okuda 3d0512efd8 KEYCLOAK-3842 SPNEGO: Support for multiple kerberos realms 2017-12-14 12:54:20 +01:00
vramik abea430802 KEYCLOAK-4793 2017-12-14 11:30:28 +01:00
Hynek Mlnarik 2a2e6c839b KEYCLOAK-5635 2017-12-13 21:07:46 +01:00
mposolda 6696c0f0b2 KEYCLOAK-5245 Restart failures when deleting a client with existing sessions/offline_tokens 2017-12-13 15:53:10 +01:00
Hynek Mlnarik 958185ec51 KEYCLOAK-4809 Support for SAML AttributeAuthorityDescriptor.Attribute elements 2017-12-13 11:55:40 +01:00
Hynek Mlnarik e6a64e234b KEYCLOAK-5644 Skip Advice tag in SAML messages 2017-12-13 11:55:40 +01:00
mposolda b793e42c53 KEYCLOAK-5017 Adding user to newly created group caused sync all groups to LDAP 2017-12-13 09:15:47 +01:00
Bill Burke f80811a065 Merge pull request #4841 from patriot1burke/master
KEYCLOAK-5923
2017-12-12 16:07:52 -05:00
Bill Burke ea3417253f KEYCLOAK-5923 2017-12-12 16:07:09 -05:00
Hynek Mlnarik 7174c0b4ec KEYCLOAK-6025 Simplify easy access to current session in action token handlers 2017-12-12 17:53:44 +01:00
Bruno Oliveira 0a9055e112 [KEYCLOAK-5175] Importing certificate to saml client takes too long 2017-12-12 14:45:24 +01:00
stianst f939818252 KEYCLOAK-5907 Use client manager to delete clients in client registration services 2017-12-12 14:25:05 +01:00
mposolda b8416dfa3e KEYCLOAK-5981 Test Impersonation works when authenticationSession exists 2017-12-12 09:43:34 +01:00
mposolda 63efee6e15 KEYCLOAK-5938 Authentication sessions: Support for logins of multiple tabs of same client 2017-12-12 08:01:02 +01:00
Pavel Drozd c3855510ef Merge pull request #4822 from vmuzikar/fix-nodejs-test
KEYCLOAK-6007 Fix failing integration Node.js adapter test
2017-12-12 00:10:37 +01:00
Pavel Drozd 20f8e5e572 Merge pull request #4821 from mhajas/KEYCLOAK-6005
KEYCLOAK-6005 Fail build when adapters installation fails
2017-12-12 00:09:45 +01:00
Pavel Drozd 047fdb55a2 Merge pull request #4803 from mhajas/KEYCLOAK-5896
KEYCLOAK-5896 Run localization test only in community
2017-12-12 00:09:02 +01:00
Pavel Drozd be36f5358c Merge pull request #4802 from mhajas/KEYCLOAK-5986
KEYCLOAK-5986 Fix token javacsript tests
2017-12-12 00:07:16 +01:00
Pavel Drozd 21dcea87c5 Merge pull request #4795 from mhajas/KEYCLOAK-4995
KEYCLOAK-4995 Fix Cluster tests on product and wildfly 10
2017-12-12 00:06:35 +01:00
Bruno Oliveira 79c4d3e7cf [KEYCLOAK-6002] - keycloak-test-helper should use the same resteasy dependency version as the parent 2017-12-11 14:34:28 +01:00
Stan Silvert a60fdcedcd KEYCLOAK-5929: Submit buttons in wrong position 2017-12-11 08:27:39 -05:00
stianst dac6c6bd7e KEYCLOAK-6000 Fix output in execute actions email 2017-12-11 14:24:37 +01:00
stianst 867de9de50 KEYCLOAK-6010 Add CORS headers to keycloak.js 2017-12-11 14:24:12 +01:00
stianst 74442ae820 Added script to check Java version in JARs within ZIPs 2017-12-11 13:15:24 +01:00
k-tamura d7a90817f2 KEYCLOAK-6009 Fix incorrect String.format usage 2017-12-10 20:56:36 +01:00
Bill Burke c9b218db71 Merge pull request #4823 from patriot1burke/master
KEYCLOAK-5724
2017-12-08 20:03:05 -05:00
Bill Burke 7c031505e2 add test 2017-12-08 17:38:00 -05:00
Tomas Kyjovsky 03e43f8964 KEYCLOAK-5966 Adjust defaults for performance testsuite provisioning 2017-12-08 21:06:12 +01:00
Tomas Kyjovsky b5c7be574b KEYCLOAK-5967 Move configuration of load-balancer from Dockerfile to maven 2017-12-08 21:05:26 +01:00
Bill Burke eea315a83b KEYCLOAK-5724 2017-12-08 10:26:28 -05:00
Bill Burke ce9f4bf97a KEYCLOAK-5724 2017-12-08 10:25:30 -05:00
Bill Burke 5d5a200413 Merge pull request #4818 from patriot1burke/master
KEYCLOAK-5926
2017-12-08 09:59:32 -05:00
vmuzikar 874dbcb3e1 KEYCLOAK-6007 Fix failing integration Node.js adapter test 2017-12-08 15:46:17 +01:00
mhajas 10219c1157 KEYCLOAK-6005 Fail build when adapters installation fails 2017-12-08 13:32:44 +01:00
Hynek Mlnarik 00fb36437d KEYCLOAK-5861 Remove AUTH_SESSION_ID when END_AFTER_REQUIRED_ACTIONS set 2017-12-08 09:52:14 +01:00
Hynek Mlnarik 4a012b73ea KEYCLOAK-4998 Fix NPE in AttributeToRoleMapper 2017-12-08 09:21:21 +01:00
Bill Burke fce16fe030 last fix 2017-12-08 02:30:48 -05:00
Bill Burke 67149ce3c3 fix test 2017-12-08 02:23:41 -05:00
Bill Burke 49ba71fd8f add logic for sync 2017-12-07 20:03:10 -05:00
Bill Burke 0dee393071 KEYCLOAK-5926 2017-12-07 19:49:10 -05:00
Bill Burke 464535ac81 Merge pull request #4815 from abstractj/KEYCLOAK-5467-i18-buttons
KEYCLOAK-5467 X.509 Auth - missing internationalization support
2017-12-07 10:08:11 -05:00
Bill Burke efa5949f69 Merge pull request #4814 from patriot1burke/master
KEYCLOAK-5350
2017-12-07 10:07:35 -05:00
Bruno Oliveira 3f3d50b9ad KEYCLOAK-5467 X.509 Auth - missing internationalization support
This adds the missing i18n support for login buttons
2017-12-07 08:52:16 -02:00
Pavel Drozd e567dcb888 Merge pull request #4809 from vramik/KEYCLOAK-4641
KEYCLOAK-4641 migrate remaining Adapter tests from old testsuite
2017-12-07 11:06:47 +01:00
stianst f2ba699520 Update RH-SSO target version 2017-12-07 10:46:13 +01:00
stianst c055ffb083 KEYCLOAK-4215 Consider session expiration when setting token timeouts 2017-12-07 10:45:02 +01:00
stianst 5fd3c9161d KEYCLOAK-5868 2017-12-07 10:42:21 +01:00
Tomas Kyjovsky 5fd00a0def KEYCLOAK-5971 Replace "numOfIterations" parameter with "steadyLoadPeriod" 2017-12-06 22:46:53 +01:00
Bill Burke 64f8d7ce25 KEYCLOAK-5350 2017-12-06 16:00:23 -05:00
Stan Silvert b8da95e901 KEYCLOAK-5930: Submit button on cred screen should start as disabled 2017-12-06 15:35:00 -05:00
stianst cccddebfd0 KEYCLOAK-5984 Fix error message in client initiated 2017-12-06 19:46:11 +01:00
vramik 5a8ff72cb6 KEYCLOAK-4641 migrate remaining Adapter tests from old testsuite 2017-12-06 15:12:37 +01:00
stianst ecfabe4ebe KEYCLOAK-5913 Move Chinese translations into resources-community 2017-12-06 13:58:52 +01:00
mposolda 8a0fa521c4 KEYCLOAK-5915 Support for sticky sessions managed by loadbalancer. Support for KeyAffinityService 2017-12-06 13:06:54 +01:00
mhajas 09348b2aff KEYCLOAK-5896 Run localization test only in community 2017-12-06 10:09:46 +01:00
mhajas 896e216f99 KEYCLOAK-5986 Fix token javacsript tests 2017-12-06 10:08:32 +01:00
stianst 35e60e0aa4 KEYCLOAK-5957 2017-12-06 08:59:40 +01:00
stianst 6d1c33ccdc KEYCLOAK-5667 2017-12-06 06:45:23 +01:00
Bill Burke f669fdf0df Merge pull request #4797 from stianst/KEYCLOAK-5734
KEYCLOAK-5734
2017-12-05 17:31:36 -05:00
Stan Silvert 30ad2899b8 KEYCLOAK-5933: Configure TOTP to Configure OTP 2017-12-05 17:24:54 -05:00
stianst 94ce97b972 KEYCLOAK-5734 2017-12-05 21:22:47 +01:00
Tomas Kyjovsky 3a7fd9e732 KEYCLOAK-5980 Dataset properties not loaded properly before test run - fix 2017-12-05 20:56:31 +01:00
Tomas Kyjovsky 503ad712dc KEYCLOAK-5955 Add ability to remotely monitor Infinispan and load balancer 2017-12-05 13:36:23 +01:00
mposolda f9e40326c1 KEYCLOAK-5961 Remove CrossDataCenter README file from codebase 2017-12-05 12:15:36 +01:00
mhajas 76029c7006 KEYCLOAK-4995 Fix Cluster tests on product and wildfly 10 2017-12-05 10:29:55 +01:00
James Stapleton 92cce7a6d4 [KEYCLOAK-5912] Add better improper SAML assertion error handling 2017-12-05 09:48:48 +01:00
Tomas Kyjovsky 916ba573bc KEYCLOAK-5965 fix 2017-12-05 09:21:56 +01:00
mposolda 6c34b4c418 KEYCLOAK-5914 Periodic clean of detached client sessions 2017-12-05 08:25:30 +01:00
stianst 5467d67c91 KEYCLOAK-5945 Strip default ports from urls 2017-12-04 19:56:01 +01:00
stianst c3d9f4704e KEYCLOAK-5946 Make sure wildcard origin is never returned 2017-12-04 19:55:34 +01:00
stianst 4541acc628 KEYCLOAK-5176 Strip headers from PEM when uploading to client 2017-12-04 19:54:15 +01:00
Stan Silvert 19cfbbf7ff KEYCLOAK-5972: i18n broken on keycloak-preview acct mgt 2017-12-04 13:44:16 -05:00
mposolda ff6fcd30d9 KEYCLOAK-4478 OIDC auth response lacks session_state in some cases 2017-12-04 16:13:22 +01:00
Samuel Mendenhall d69fe27cf9 set error instead of throw 2017-12-04 16:03:47 +01:00
Samuel Mendenhall ca324c29e8 processInit should return a promise for setupCheckLoginIframe and should only call processCallback if that setupCheckLoginIframe is successful 2017-12-04 16:03:47 +01:00
Hynek Mlnarik b4532ec629 KEYCLOAK-5964 Fix keycloak-install-base.cli client session caches 2017-12-04 12:15:07 +01:00
stianst 3ee269da87 Align dependencies 2017-12-04 10:14:30 +01:00
pedroigor b1127ffafe [KEYCLOAK-5953] - Making elytron dependencies optional 2017-12-04 10:13:55 +01:00
stianst 37de8e9f69 Bump version to 3.4.2.Final-SNAPSHOT 2017-12-01 09:34:48 +01:00
Stan Silvert 4d4ee33d1d KEYCLOAK-5937: Not possible to select role w/ hardocded LDAP role mapper 2017-11-30 15:29:36 -05:00
stianst 4daf6aaec5 KEYCLOAK-5940 2017-11-30 13:43:15 +01:00
vramik 6bb04617a6 KEYCLOAK-5802 fix install-adapters.sh script for wildfly10 and below 2017-11-30 12:58:11 +01:00
mposolda 7b03eed9c8 KEYCLOAK-5797 Refactoring authenticationSessions to support login in multiple browser tabs with different clients 2017-11-30 12:56:45 +01:00
Hynek Mlnarik b466f4d0b6 KEYCLOAK-5910 Retry sending notification when remote cache is unavailable 2017-11-30 11:48:26 +01:00
Peter Nalyvayko b8e5fd2b99 KC-4335: working on adding a reverse proxy support to allow X.509 client certificate authentication when running keycloak behind a reverse proxy
KC-4335: reverse proxy => a swtich to change a type of reverse proxy when running the X509 integration tests; changes to the names of the reverse proxy providers

KC-4335: updated the migration scripts to add x509 spi to standalone and domain configurations; removed the HAproxy and apache x509 spi configuration
2017-11-30 11:00:32 +01:00
Domenico Briganti b72b01bb9d fix logger class 2017-11-30 10:52:26 +01:00
Martin Kanis 603052c594 KEYCLOAK-5883 Deploy testsuite during product build 2017-11-30 10:50:06 +01:00
Marko Strukelj 106599b52c KEYCLOAK-5742 [Admin CLI] Output filtering for nested attributes doesn't work 2017-11-30 10:47:40 +01:00
pedroigor 17748d5ba8 [KEYCLOAK-5660] - Adding UserQueryProvider.getUsersCount(realm, includeServiceAccount) method 2017-11-30 10:45:54 +01:00
pedroigor 4caa40fd0a [KEYCLOAK-5660] - Fixing test, it should not consider users count for service accounts 2017-11-30 10:45:54 +01:00
pedroigor 674fb31a2c [KEYCLOAK-5660] - Rest API User count returns wrong value 2017-11-30 10:45:54 +01:00
Marko Strukelj c5d9301951 KEYCLOAK-4920 NPE when exporting configuration without alias 2017-11-30 10:40:25 +01:00
pedroigor 5f43a6a342 [KEYCLOAK-3629] - Adding confidential-port attribute to wildfly adapter subsystem 2017-11-30 10:39:21 +01:00
pedroigor 6587cfa084 [KEYCLOAK-3629] - Some Adapters do not work with SSL Redirect 2017-11-30 10:39:21 +01:00
Bruno Oliveira 6a528a3ee6 [KEYCLOAK-2645] Reset password page says 'You need to change your password to activate your account.' 2017-11-30 10:37:21 +01:00
stianst 2be78a0239 KEYCLOAK-5924 Add error handler for uncaught errors 2017-11-30 10:33:13 +01:00
Pavel Drozd 4408cdb5c7 Merge pull request #4756 from tkyjovsk/KEYCLOAK-5922
KEYCLOAK-5922 Cluster tests don't work with non-undertow server
2017-11-30 09:24:39 +01:00
Marek Posolda a3288d5f8e Merge pull request #4767 from hmlnarik/KEYCLOAK-5908-ClassCastException-to-org-infinispan-xsite-XSiteReplicateCommand
KEYCLOAK-5908 Fix relay configuration
2017-11-30 07:04:48 +01:00
Hynek Mlnarik 9cae8b79e4 KEYCLOAK-5908 Fix relay configuration 2017-11-29 22:22:35 +01:00
stianst 0bd2e63162 KEYCLOAK-5939 Align dependencies with WildFly 11 2017-11-29 20:39:10 +01:00
pedroigor 9ffc11d04f [KEYCLOAK-4231] - Unable to import PEM certificate > 2048 2017-11-29 20:26:22 +01:00
Bruno Oliveira af66c5dbd2 [KEYCLOAK-5483] X.509 Auth - log in attempt is not sometimes logged in the Login Events 2017-11-29 20:08:22 +01:00
Tomas Kyjovsky 83136c1bd8 KEYCLOAK-5897 Support for multiple provisioning options in performance testsuite 2017-11-29 18:05:31 +01:00
Pedro Igor d22c58ee30 Merge pull request #4760 from pedroigor/KEYCLOAK-5900
[KEYCLOAK-5900] - Returning error response when resource does not exist
2017-11-29 10:38:44 -02:00
Pedro Igor de6301e65a Merge pull request #4759 from pedroigor/KEYCLOAK-5901
[KEYCLOAK-5901] - Changing response to return a 400 in case scope is invalid
2017-11-29 10:38:07 -02:00
Pavel Drozd c02c07d78e Merge pull request #4749 from wyvie/springboot-testing-fix
[KEYCLOAK-3837] added additional profile to springboot prod testing
2017-11-29 00:05:21 +01:00
Pedro Igor f48509c32c Merge pull request #4741 from pedroigor/KEYCLOAK-2517
[KEYCLOAK-2517] - Doesn't work always refresh token
2017-11-28 20:58:56 -02:00
pedroigor c5b06f23e9 [KEYCLOAK-5900] - Returning error response when resource does not exist 2017-11-28 19:46:18 -02:00
Stan Silvert fc8a8b1dd8 KEYCLOAK-5905: 'Disable Credentials' not displayed after reset password. 2017-11-28 16:40:41 -05:00
pedroigor bf73375a5c [KEYCLOAK-5901] - Changing response to return a 400 in case scope is invalid 2017-11-28 19:32:41 -02:00
Tomas Kyjovsky 4240295af9 KEYCLOAK-5922 Cluster tests don't work with non-undertow server 2017-11-28 17:35:13 +01:00
Bill Burke 3afb635110 Merge pull request #4754 from patriot1burke/master
KEYCLOAK-5904
2017-11-28 09:14:51 -05:00
Bill Burke c36b3cd296 KEYCLOAK-5904 2017-11-28 09:10:43 -05:00
Bill Burke 683fe6fa03 Merge pull request #4744 from mposolda/crossdc-rebase
KEYCLOAK-4188 CrossDataCenter docs in the README file
2017-11-28 08:58:03 -05:00
Bill Burke 0a8995efc7 Merge pull request #4747 from mstruk/KEYCLOAK-5741
KEYCLOAK-5741 [Admin CLI] Fix instructions in build-in help
2017-11-28 08:57:29 -05:00
Bill Burke c398f6619f Merge pull request #4748 from mstruk/KEYCLOAK-5762
KEYCLOAK-5762 [Client Registration CLI] Fix instructions in built-in help
2017-11-28 08:57:15 -05:00
Bill Burke 33c38ceb8b Merge pull request #4753 from pedroigor/KEYCLOAK-5925
[KEYCLOAK-5925] - Trace-level should log tokens without signatures
2017-11-28 08:56:14 -05:00
wyvie b0b28e6282 [KEYCLOAK-3837] added additional profile to springboot prod testing 2017-11-28 14:44:08 +01:00
pedroigor 792ffdf39b [KEYCLOAK-5925] - Trace-level should log tokens without their signatures 2017-11-28 09:54:57 -02:00
stianst 36314c51d6 KEYCLOAK-5856 Fix infinite loop 2017-11-28 07:54:49 +01:00
stianst 24b7e318ca KEYCLOAK-5913 Fix all locales showing in RH-SSO 2017-11-28 07:54:26 +01:00
Stian Thorgersen cf485c3fc9 KEYCLOAK-5308 Fix updating protocol mappers on Oracle 2017-11-27 19:46:12 +01:00
Stian Thorgersen 5666bfe88b KEYCLOAK-4962 Fix updating mappers for identity providers on Oracle 2017-11-27 19:46:12 +01:00
Stan Silvert 27268044ae KEYCLOAK-5906: Active page not highlighted in nav sidebar 2017-11-27 12:43:43 -05:00
Alex Szczuczko c860ca61c3 KEYCLOAK-5843 Add custom license processing plugin to avoid directory symlinks (#4723)
Symlinks are frequently unavailable on Windows (must be on NTFS and user must
have SeCreateSymbolicLinkPrivilege). Removing the symlinks for licenses/common/
should enable the build to function mostly normally on Windows. The individual
license files will be incorrect, but that shouldn't matter for local builds.
Release builds are done on *nix.

The plugin rolls several different plugin executions into one. The common files
are distributed using a resource jar, used by and unpacked by the plugin.
2017-11-27 12:31:31 -05:00
mposolda 1782d220c7 KEYCLOAK-4188 CrossDC documentation. Addressed some questions and comments based on feedback. 2017-11-27 18:04:07 +01:00
Marko Strukelj c35c6e6ab7 KEYCLOAK-5762 [Client Registration CLI] Fix instructions in built-in help 2017-11-27 17:00:48 +01:00
Marko Strukelj 0e2332196d KEYCLOAK-5741 [Admin CLI] Fix instructions in build-in help 2017-11-27 16:12:00 +01:00
Pavel Drozd a8bcdfb401 Merge pull request #4735 from vmuzikar/fix-ui
KEYCLOAK-5816, KEYCLOAK-5815 UI tests fixes
2017-11-27 15:12:35 +01:00
Pavel Drozd 96e481fe45 Merge pull request #4732 from vramik/KEYCLOAK-5705
KEYCLOAK-5705 add missing dependency to module.xml for mssql migration server
2017-11-27 15:10:26 +01:00
Pavel Drozd 87b17a6e6c Merge pull request #4743 from wyvie/springboot-testing-fix
[KEYCLOAK-3837] fix to spring boot test application for jenkins
2017-11-27 15:07:22 +01:00
wyvie 6035e5c831 [KEYCLOAK-3837] fix to spring boot test application for jenkins 2017-11-27 13:58:36 +01:00
Bruno Oliveira 9d35891e7d [KEYCLOAK-5467] X.509 Auth - missing internationalization support 2017-11-27 13:44:38 +01:00
Bruno Oliveira 00677a6b92 [KEYCLOAK-5898] X.509 Auth - add tests for CRL with direct grant 2017-11-27 13:43:37 +01:00
Bruno Oliveira 697caaa805 [KEYCLOAK-4683] Add key usage tests for X.509 Authentication
These tests cover the scenarios already available at our certificates:
* Key Usage with the flag critical
* Extended Key Usage without the flag critical
2017-11-27 13:42:57 +01:00
mposolda fda491a966 KEYCLOAK-4188 CrossDataCenter docs in the README file 2017-11-27 13:37:38 +01:00
Pedro Igor 92504e8ba3 Merge pull request #4653 from cadimmek/patch-1
KEYCLOAK-5134
2017-11-27 09:12:21 -02:00
Thomas Kuestermann bb900f9db8 KEYCLOAK-5753 fixed NPE thrown when using custom RequestMatcher 2017-11-27 09:55:32 +01:00
pedroigor 819a60932e [KEYCLOAK-2517] - Doesn't work always refresh token 2017-11-24 23:40:29 -02:00
Pedro Igor e4a6ee19d1 Merge pull request #4740 from pedroigor/KEYCLOAK-5909
[KEYCLOAK-5909] - Allow providing username as owner when creating resources
2017-11-24 17:57:50 -02:00
pedroigor aef682cd5b [KEYCLOAK-5909] - Allow providing username as owner when creating resources 2017-11-24 17:08:21 -02:00
Marek Posolda dd6502013e Merge pull request #4734 from rmartinc/ui_locales
KEYCLOAK-5896: Parameter "ui_locales" not redirected to login page in java adapters
2017-11-24 10:59:26 +01:00
rmartinc ecbf6e5386 KEYCLOAK-5896: adding a test for the ui_locales change. 2017-11-24 08:21:37 +01:00
pedroigor 2721e6a5e4 [KEYCLOAK-5770] - Logout event test 2017-11-23 21:08:07 +01:00
pedroigor e3c9fa25a3 [KEYCLOAK-5770] - Global Saml Logout doesn't create logout event 2017-11-23 21:08:07 +01:00
mposolda 6d91ab674b KEYCLOAK-5895 CrossDC: NotSerializableException when opening sessions tab in admin console 2017-11-23 20:03:12 +01:00
vmuzikar 6f4ab8870e KEYCLOAK-5816, KEYCLOAK-5815 UI tests fixes 2017-11-23 13:51:38 +01:00
rmartinc 0b3ae30473 Parameter "ui_locales" not redirected to login page in java adapters 2017-11-23 11:18:29 +01:00
Pavel Drozd 94ba85c210 Merge pull request #4720 from vramik/KEYCLOAK-5872
KEYCLOAK-5872 add preview assumption to InvalidationCrossDCTest.authz…
2017-11-23 07:42:31 +01:00
Bill Burke 2117db5e6d Merge pull request #4730 from patriot1burke/master
KEYCLOAK-4715
2017-11-22 12:45:23 -05:00
Bill Burke 116bfb05c2 fix 2017-11-22 11:55:10 -05:00
Bill Burke aee6d16f58 fix more stupidity 2017-11-22 10:22:47 -05:00
Bill Burke ae29e36e1f fix my stupidity 2017-11-22 08:19:30 -05:00
vramik 02220558e6 KEYCLOAK-5705 add missing dependency to module.xml for mssql migration server 2017-11-22 14:09:01 +01:00
Pavel Drozd 12bdf48ecc Merge pull request #4707 from abstractj/KEYCLOAK-5858
[KEYCLOAK-5858] Failing TokensTest in Console UI Tests
2017-11-22 13:22:28 +01:00
mposolda bd1072d2eb KEYCLOAK-5747 Ensure refreshToken doesn't need to send request to the other DC. Other fixes and polishing 2017-11-22 11:55:12 +01:00
mposolda 61c5a332b4 KEYCLOAK-5832 Fix the issue with RemoveExpiredCommand exception on JDG side 2017-11-22 11:55:12 +01:00
Bill Burke 75d517a1e8 cleanup test 2017-11-21 21:49:51 -05:00
Bill Burke 8993ca08ad KEYCLOAK-4715 2017-11-21 17:46:48 -05:00
vramik afd906b9a9 KEYCLOAK-5705 add missing dependency to module.xml for mssql in eap module 2017-11-21 21:51:19 +01:00
vramik c083c1c4cf KEYCLOAK-5873 set DB_CLOSE_ON_EXIT to false when crossdc tests are run on in memory H2 2017-11-21 21:46:59 +01:00
Bill Burke d78bc37253 Merge pull request #4724 from mstruk/KEYCLOAK-5842
KEYCLOAK-5842 Fix NPE in admin-cli ParseUtil.mergeAttributes
2017-11-21 12:36:38 -05:00
Bill Burke d0ee1e6ee5 Merge pull request #4725 from hmlnarik/KEYCLOAK-5183-Support-for-AssertionConsumerServiceUrl-in-Saml-Adapter-subsystem
KEYCLOAK-5183 Support for AssertionConsumerServiceUrl in Saml Adapter subsystem
2017-11-21 12:35:10 -05:00
Bill Burke c16c02b0cf Merge pull request #4727 from vmuzikar/fix-social
KEYCLOAK-5879 Fix SocialLoginTest with -Pauth-server-wildfly
2017-11-21 12:34:28 -05:00
vmuzikar 7fd237b40b KEYCLOAK-5879 Fix SocialLoginTest with -Pauth-server-wildfly 2017-11-21 11:12:21 +01:00
pskopek a993f6fb75 [KEYCLOAK-4979] make schema location map unmodifiable after initial setup + log message change 2017-11-21 09:28:15 +01:00
Thomas Skjølberg 5f20df00d0 [KEYCLOAK-4979] Move picketlink schema, fix resolver and some related tests 2017-11-21 09:28:15 +01:00
Bill Burke 186b10ab53 Merge pull request #4726 from patriot1burke/master
KEYCLOAK-5878
2017-11-20 17:39:58 -05:00
Bill Burke 06762ba13d KEYCLOAK-5878 2017-11-20 17:03:28 -05:00
Bill Burke 08ca03051c Merge pull request #4549 from pkadej/KEYCLOAK-5662
KEYCLOAK-5662
2017-11-20 14:37:07 -05:00
Marko Strukelj 8f82440103 KEYCLOAK-5842 Fix NPE in admin-cli ParseUtil.mergeAttributes 2017-11-20 16:06:27 +01:00
David De VreeseandHynek Mlnarik 9485a63157 KEYCLOAK-5183 Support for AssertionConsumerServiceUrl in Saml Adapter subsystem
Co-Authored-By: Hynek Mlnarik <hmlnarik@redhat.com>
2017-11-20 15:59:47 +01:00
vramik 37b625fd99 KEYCLOAK-5872 add preview assumption to InvalidationCrossDCTest.authzResourceInvalidationTest 2017-11-20 11:30:44 +01:00
Marek Posolda 8e53ccf5ab Merge pull request #4706 from stianst/KEYCLOAK-5383
KEYCLOAK-5383 Fix creating password in LDAP through admin create user…
2017-11-20 09:17:45 +01:00
Bill Burke 7c0c48da01 Merge pull request #4717 from patriot1burke/master
KEYCLOAK-5715
2017-11-17 12:59:36 -05:00
Bill Burke ff5010cdd0 Merge pull request #4663 from mstruk/KEYCLOAK-5702
KEYCLOAK-5702 kcadm delete realm fails with nullpointer
2017-11-17 11:57:58 -05:00
Bill Burke 0940c922ef Merge pull request #4711 from tkyjovsk/KEYCLOAK-5588
KEYCLOAK-5588 Cross-dc: docker setup
2017-11-17 11:55:13 -05:00
Bill Burke 83ff0eab10 remove irrelevant comments 2017-11-17 11:36:49 -05:00
Bill Burke c66ff60c58 KEYCLOAK-5715 2017-11-17 11:34:32 -05:00
Stian Thorgersen feaf834184 KEYCLOAK-5863 Fix error when updating mapper twice in a row 2017-11-17 12:20:43 +01:00
Tomas Kyjovsky 805e9288fa KEYCLOAK-5588 Cross-dc: docker setup 2017-11-16 21:25:58 +01:00
Bruno Oliveira 641069d4fd [KEYCLOAK-5866] MigrationTest fails for extracting realm keys 2017-11-16 19:44:09 +01:00
Pavel Drozd a06fd31412 Merge pull request #4688 from vramik/KEYCLOAK-5678
KEYCLOAK-5678 configs for rh-sso and keycloak are different, skip tes…
2017-11-16 08:38:12 +01:00
Bruno Oliveira 07aa718cb9 [KEYCLOAK-5379] MigrationTest fails for migration to 3.3.0 2017-11-16 07:22:57 +01:00
Shon T. Urbas f186ea12c6 Removal of duplicate cuff. 2017-11-16 07:18:49 +01:00
Stan Silvert dc05134e41 KEYCLOAK-5850: Del realm role broken on permissions & Users tabs. 2017-11-16 07:05:08 +01:00
Pedro Igor f96c3312e2 [KEYCLOAK-5841] - Test 2017-11-16 07:03:08 +01:00
Bruno Oliveira d1579f62a3 [KEYCLOAK-5858] Failing TokensTest in Console UI Tests 2017-11-16 00:24:12 -02:00
Stian Thorgersen 86fb18395e KEYCLOAK-5383 Fix creating password in LDAP through admin create user endpoint 2017-11-15 21:20:00 +01:00
Bruno Oliveira bc28223a77 KEYCLOAK-5859 2017-11-15 20:00:58 +01:00
Stan Silvert f923211e9f KEYCLOAK-5849: Multiple errors in acct page displays '<br/>' 2017-11-15 19:59:54 +01:00
Marek Posolda 6f2ba821a6 Merge pull request #4701 from mposolda/master
LDAP performance improvements
2017-11-15 16:34:45 +01:00
Bill Burke 8839278da7 Merge pull request #4702 from patriot1burke/master
KEYCLOAK-5676
2017-11-15 10:30:12 -05:00
Bill Burke 485ba4a3e4 KEYCLOAK-5676 2017-11-15 10:29:02 -05:00
mposolda bd25040e22 KEYCLOAK-5827 Retrieve member attribute from LDAP on group/role queries just when necessary 2017-11-15 15:29:19 +01:00
mposolda c4a1764801 KEYCLOAK-5836 More logging around LDAP performance. Added LdapManyObjectsInitializerCommand to easily add many users and groups to the LDAP 2017-11-15 15:29:19 +01:00
Hynek Mlnařík 3c48ee39d9 Merge pull request #4699 from hmlnarik/KEYCLOAK-5425-Manual-migration---cannot-apply-generated-sql-script
KEYCLOAK-5425 Have preconditions evaluated in manual mode
2017-11-15 14:51:59 +01:00
Hynek Mlnarik a787cfa33a KEYCLOAK-5425 Have preconditions evaluated in manual mode 2017-11-15 13:37:32 +01:00
Pedro Igor 1bd2f0e98f Merge pull request #4674 from thomasdarimont/issue/fix-npe-in-userpermissions
KEYCLOAK-5841 Fix NPE in deletePermissionSetup in UserPermissions
2017-11-15 10:22:44 -02:00
Hynek Mlnařík 393fae74b3 Merge pull request #4693 from hmlnarik/KEYCLOAK-5349-JS-client-breaks-login-session
KEYCLOAK-5349 User session count in IdP-initiated flow tests
2017-11-15 12:35:19 +01:00
Hynek Mlnarik a2f6c16764 KEYCLOAK-5349 User session count in IdP-initiated flow tests 2017-11-15 11:41:45 +01:00
Bill Burke a70461b726 Merge pull request #4695 from patriot1burke/master
KEYCLOAK-5459 KEYCLOAK-5855
2017-11-14 22:02:13 -05:00
Bill Burke 6b8ead6c4b KEYCLOAK-5459 2017-11-14 19:37:07 -05:00
Stan Silvert 8b023f57f9 KEYCLOAK-5474: Unexp behavior with "login w/ email" and "Dup emails" (#4683)
settings.
2017-11-14 16:12:56 -05:00
Pedro Igor eebf0b0499 Merge pull request #4690 from pedroigor/KEYCLOAK-5824
[KEYCLOAK-5824] - Keycloak throws "Error while evaluating permissions" exception often
2017-11-14 18:35:56 -02:00
Pedro Igor 63a01b1e1f Merge pull request #4689 from pedroigor/KEYCLOAK-5844
[KEYCLOAK-5844] - Refreshing PAT instead of obtaining a new one every time
2017-11-14 18:25:24 -02:00
Marek Posolda 913c94dbd1 Merge pull request #4691 from mposolda/master
KEYCLOAK-5848 Possibility to configure different attribute for GET_GR…
2017-11-14 16:09:26 +01:00
mposolda 0c414eee80 KEYCLOAK-5848 Possibility to configure different attribute for GET_GROUPS_FROM_USER_MEMBEROF_STRATEGY 2017-11-14 15:05:26 +01:00
Pedro Igor b0ccce397a [KEYCLOAK-5824] - Fixing logging of error mesages 2017-11-14 11:28:21 -02:00
Pedro Igor 6731c55429 [KEYCLOAK-5824] - Wrong usage of SimpleDateFormat 2017-11-14 11:27:57 -02:00
Pedro Igor fdb618219f [KEYCLOAK-5844] - Refreshing PAT instead of obtaining a new one every time 2017-11-14 11:24:45 -02:00
Stian Thorgersen 89f4b87038 KEYCLOAK-5567 Set correct status code on login error pages 2017-11-14 12:33:29 +01:00
vramik ea869a3008 KEYCLOAK-5678 configs for rh-sso and keycloak are different, skip test interfaces for now 2017-11-14 11:27:03 +01:00
Hynek Mlnařík 1412fed265 Merge pull request #4676 from abstractj/KEYCLOAK-2052
[KEYCLOAK-2052] Allows independently set timeouts for e-mail verification link and rest e.g. forgot password link
2017-11-14 09:19:57 +01:00
Stian Thorgersen de72542151 KEYCLOAK-5795 Strip ids of client export from admin console 2017-11-14 08:49:58 +01:00
Bruno OliveiraandHynek Mlnarik 03d0488335 [KEYCLOAK-2052] Allows independently set timeouts for e-mail verification link and rest e.g. forgot password link
Co-authored-by: Hynek Mlnarik <hmlnarik@redhat.com>
2017-11-13 19:57:04 -02:00
Stian Thorgersen 925d5e1dea KEYCLOAK-3173 enable logout offline refresh token using OIDC logout endpoint 2017-11-13 18:23:39 +01:00
Martin Kanis d8b3654011 KEYCLOAK-5187 Split jackson version property 2017-11-13 18:22:32 +01:00
Stian Thorgersen 51c7917853 KEYCLOAK-5772 Missing produces type on welcome resource post 2017-11-13 16:38:42 +01:00
Stian Thorgersen d30bf938ee KEYCLOAK-5821 Fix basic auth tests with embedded Undertow 2017-11-13 16:34:25 +01:00
Thomas Darimont 5d8f449ea0 KEYCLOAK-5840 Remove unused config map in AddUser command
The only value put into this config map is the
password hash iterations count.
But `iterations` is used directly with the
hashProvider.

See:
https://lgtm.com/projects/g/keycloak/keycloak/snapshot/73c82d296e70e09343f6f55eeea56a085075b289/files/wildfly/adduser/src/main/java/org/keycloak/wildfly/adduser/AddUser.java?sort=name&dir=ASC&mode=heatmap&excluded=false#x490b537b199a8415:1
2017-11-13 15:41:11 +01:00
Hynek Mlnařík 290f6ed2ad Merge pull request #4671 from thomasdarimont/issues/remove-duplicate-check-in-saml11requestwriter
KEYCLOAK-5837 Remove duplicate check in SAML11AuthenticationQueryType
2017-11-13 14:49:11 +01:00
Hynek Mlnařík 98a46c4497 Merge pull request #4672 from thomasdarimont/issues/fix-comparison-in-saml-11-request-response-parsers
KEYCLOAK-5838 Fix comparison in SAMLSloRequestParser and SAMLSloResponseParser
2017-11-13 14:46:56 +01:00
Stian Thorgersen d02ffd33b3 KEYCLOAK-5721 Moved state checker from separate cookie to claim on identity cookie 2017-11-13 14:11:28 +01:00
Thomas Darimont a5b73a365d KEYCLOAK-5841 Fix NPE in deletePermissionSetup in UserPermissions
Previously a call to `UserPermissions#deletePermissionSetup`
always resulted in a NPE if the usersResource was null.

We now only try to delete the resourceStore information if
the given usersResource is not null.
2017-11-13 13:35:40 +01:00
Thomas Darimont 71df504834 KEYCLOAK-5838 Fix comparison in SAMLSloRequestParser and SAMLSloResponseParser
The previous comparison was broken (always returned false)
since it compared the enum value with a string.
Calling `.get()` on the enum value to compare the string this the
given local-part fixes the comparison.

See:
https://lgtm.com/projects/g/keycloak/keycloak/snapshot/73c82d296e70e09343f6f55eeea56a085075b289/files/saml-core/src/main/java/org/keycloak/saml/processing/core/parsers/saml/SAMLSloRequestParser.java?sort=name&dir=ASC&mode=heatmap&excluded=false#xe3bb353ac67565ed:1
https://lgtm.com/projects/g/keycloak/keycloak/snapshot/73c82d296e70e09343f6f55eeea56a085075b289/files/saml-core/src/main/java/org/keycloak/saml/processing/core/parsers/saml/SAMLSloResponseParser.java?sort=name&dir=ASC&mode=heatmap&excluded=false#xdd5c8cb1952defd:1
2017-11-13 13:30:01 +01:00
Thomas Darimont 8cfbb8d0b3 KEYCLOAK-5837 Remove duplicate check in SAML11AuthenticationQueryType
The same check is applied in line 83.
2017-11-13 13:26:15 +01:00
Pavel Drozd 0f4b8be2b0 Merge pull request #4643 from vramik/KEYCLOAK-5678
KEYCLOAK-5678 Extend server-config-migration tests to test also exten…
2017-11-13 12:02:46 +01:00
Pavel Drozd af97a84108 Merge pull request #4635 from vmuzikar/fix-x509
KEYCLOAK-5720 Fix X.509 tests
2017-11-13 11:56:16 +01:00
Przemysław Kadej e28f402b6b KEYCLOAK-5662 - CachePolicy.MAX_LIFESPAN - Cached LDAP users aren't being refreshed at all 2017-11-13 11:36:31 +01:00
Marek Posolda 0dfbe01c73 Merge pull request #4666 from mposolda/crossdc
KEYCLOAK-5828 Ensure sessions preloading works for remote distributed…
2017-11-10 14:13:31 +01:00
Stian Thorgersen 90900b1a1f KEYCLOAK-5825 Clear state checker for welcome on form submit 2017-11-10 13:40:29 +01:00
Stian Thorgersen 4295f4ec31 KEYCLOAK-1886 Added cors headers to errors in token endpoint 2017-11-10 12:01:21 +01:00
mposolda c530a061cc KEYCLOAK-5828 Ensure sessions preloading works for remote distributed caches as well 2017-11-10 11:27:24 +01:00
Thomas Recloux 04ad634986 Add configuration for KeycloakAuthenticatedActionsFilter
Fixes KEYCLOAK-5227
2017-11-10 10:44:12 +01:00
Bartłomiej Piech d4b9c3c014 KEYCLOAK-5679 2017-11-10 10:42:26 +01:00
Marek Posolda bc3515fd1b Merge pull request #4664 from mposolda/crossdc
KEYCLOAK-5371 SessionExpirationCrossDCTest - improve stability. Remov…
2017-11-09 23:15:48 +01:00
mposolda b033ce0669 KEYCLOAK-5371 SessionExpirationCrossDCTest - improve stability. Remove checks for counts of sent messages 2017-11-09 22:18:47 +01:00
Marko Strukelj 7035a4647d KEYCLOAK-5702 kcadm delete realm fails with nullpointer 2017-11-09 20:57:49 +01:00
Marek Posolda 39345b0b61 Merge pull request #4660 from mposolda/crossdc
KEYCLOAK-5618 Fix SessionsPreloadCrossDCTest. Update HOW-TO-RUN docs.…
2017-11-09 20:50:38 +01:00
emilienbondu 8b8e694c60 Fix https://issues.jboss.org/browse/KEYCLOAK-5636 NPE 2017-11-09 19:32:27 +01:00
mposolda a98f085be6 KEYCLOAK-5618 Fix SessionsPreloadCrossDCTest. Update HOW-TO-RUN docs. Ensure it's executed in travis. 2017-11-09 17:39:04 +01:00
Stian Thorgersen 128ff12f8f Bump versions 2017-11-09 15:37:21 +01:00
Stian Thorgersen e28652489e KEYCLOAK-5565 Change theme files to writable to permit patching 2017-11-09 15:37:01 +01:00
Marko Strukelj dae0fafc8a KEYCLOAK-5040 ProfileAssume needs to use server info endpoint 2017-11-09 14:19:06 +01:00
Xiaojian Liu 19eed51582 KEYCLOAK-5352 Basic Auth fails if password contains a ':' 2017-11-09 13:56:02 +01:00
Xiaojian Liu 9ff22f596d KEYCLOAK-5352 Basic Auth fails if password contains a ':' 2017-11-09 13:56:02 +01:00
Xiaojian Liu e1af9f133f KEYCLOAK-5352 Basic Auth fails if password contains a ':' 2017-11-09 13:56:02 +01:00
Bruno Oliveira 26e253f4a5 [KEYCLOAK-5284] 2017-11-09 13:45:06 +01:00
Marko Strukelj 2854a2006e KEYCLOAK-5810 ClientTokenExchangeTest failures with -Pproduct profile 2017-11-09 13:44:10 +01:00
cadimmek 518824e41b KEYCLOAK-5134
UnsupportedOperationException when using policy-enforcer-config with keycloak-spring-boot-adapter
2017-11-09 10:43:50 +01:00
vmuzikar 3bf1904269 KEYCLOAK-5786 Fix testsuite not working with auth-server-eap profile 2017-11-09 08:10:58 +01:00
vmuzikar 2c2a332f80 KEYCLOAK-5332 Fix GitLab social test 2017-11-09 07:19:01 +01:00
Stan Silvert 8759b42e6b KEYCLOAK-4461: Missing error msg when add idp mapper 2017-11-09 07:13:38 +01:00
Marko Strukelj bf937452c6 KEYCLOAK-5617 Intermittent ConcurrencyTest failures 2017-11-09 07:12:33 +01:00
liuzheng712 9243430b75 fix(Chinese language): add # encoding: utf-8 2017-11-09 07:10:59 +01:00
vmuzikar b21d5bbf04 KEYCLOAK-5805 Fix tests in the 'other' module 2017-11-09 07:01:27 +01:00
Pedro Igor 5119dc3ad5 Merge pull request #4650 from pedroigor/KEYCLOAK-4439
[KEYCLOAK-4439] - Fixing elytron adapter for standalone apps
2017-11-08 22:10:25 -02:00
Pedro Igor 476dd1cef5 [KEYCLOAK-4439] - Fixing saml adapter 2017-11-08 19:01:54 -02:00
Pedro Igor a8ba3eb7f9 [KEYCLOAK-4439] - Fixing elytron adapter for standalone apps 2017-11-08 14:09:34 -02:00
Stan Silvert d3b270d025 KEYCLOAK-5475: UI glitches when alias blank in auth config (#4645) 2017-11-08 08:21:28 -05:00
Albert-Jan Verhees b8f3c8a445 Fixed typo in Dutch translations 2017-11-08 12:59:55 +01:00
Alex Szczuczko eb46f403d6 Extract the license files with maven-dependency-plugin instead of wildfly-server-provisioning-maven-plugin
This works around WFBUILD-27 aka wildfly/wildfly-build-tools#39. Once that's merged and new version is released this commit can be reverted.
2017-11-08 12:58:38 +01:00
Alex Szczuczko 9c0ec8cb10 Enforce a standard sort order on deduplication in download-license-files.sh
This will avoid noise in the diffs (files switching between symlink and regular
status) when users on systems with a different default sort order run the
script. `LC_ALL=C sort` will sort by byte order.
2017-11-08 12:58:38 +01:00
Alex Szczuczko d268412738 Initial run of download-license-files.sh on license XMLs
Command line used:

find -path '*/src/main/resources/licenses' | while read -r r; do pushd "$r"; common/download-license-files.sh rh-sso/licenses.xml; common/download-license-files.sh keycloak/licenses.xml; popd; done
2017-11-08 12:58:38 +01:00
Alex Szczuczko e360aadcd4 Explicitly define the dependency for unpacking in js-adapter-zip.
This makes it visible to append-product-licenses.groovy and other plugins.
2017-11-08 12:58:38 +01:00
Alex Szczuczko f88b3cddb6 Port forward license data from maintenance, with improvements.
org.keycloak dependencies will be automatically added to the xml during the
build, removing the need for runs of download-license-files.sh every time the
keycloak version changes.

Documentation on "why and how" for the license data has also been added.

To reduce code duplication issues, plugin definitions are stored in
keycloak-parent, but only active in the projects that need them (not bound to
any phase by default). Also, the common files have been moved into
licenses/common/, so that a single symlink will suffice to replicate the
current and future files needed by the plugin executions. While the
assembly.xml definitions remain duplicated, they are fairly minimal and
shouldn't need to change often.

License data is available for all adapters shipped in the product, plus
server-feature-pack.

The keycloak slot is populated with data, in addition to the rh-sso slot. A
number of the adapters don't depend on any third-party artifacts, so they have
(mostly) blank license.xml files.
2017-11-08 12:58:38 +01:00
Stian Thorgersen 56548fcaf0 Upgrade to EAP 7.1 CR4 (#4649) 2017-11-08 11:40:06 +01:00
Marek Posolda fce9cc205c Merge pull request #4647 from mposolda/crossdc
KEYCLOAK-5371 More stable cross-dc tests
2017-11-08 11:14:37 +01:00
mposolda 701b7acd80 KEYCLOAK-5371 More stable cross-dc tests 2017-11-08 10:03:04 +01:00
vramik 819181007c KEYCLOAK-5678 Extend server-config-migration tests to test also extensions and management 2017-11-07 12:46:13 +01:00
Marek Posolda 7cf52044b2 Merge pull request #4640 from mposolda/crossdc
KEYCLOAK-5716 KEYCLOAK-5738 Avoid infinispan deadlock. Ensure code-to…
2017-11-07 11:04:10 +01:00
Paramvir-JIndal d1468eaa45 [KEYCLOAK-5767]IE9 sometimes using HTTP status code 1223 instead of 204 (#4628) 2017-11-07 10:46:13 +01:00
Hynek Mlnařík afb4a59b19 KEYCLOAK-5789 Update PR policy (#4634) 2017-11-07 10:32:26 +01:00
Stian Thorgersen b1a05dfce2 KEYCLOAK-5664 (#4604) 2017-11-07 10:09:34 +01:00
mposolda 62a1c187a2 KEYCLOAK-5716 KEYCLOAK-5738 Avoid infinispan deadlock. Ensure code-to-token works correctly in cross-dc 2017-11-07 09:01:59 +01:00
Stan Silvert 1db3134df8 KEYCLOAK-5506: Set empty fed config prop fails in admin console (#4625) 2017-11-06 12:44:13 -05:00
Hynek Mlnařík ffc0d7fc7c Merge pull request #4636 from hmlnarik/KEYCLOAK-5581-SAML2-Undeclared-name-space-prefix-ds-
KEYCLOAK-5581 Fix SAML identity broker context serialization
2017-11-03 22:05:13 +01:00
Hynek Mlnarik fe2f65daac KEYCLOAK-5581 Fix SAML identity broker context serialization 2017-11-03 21:09:18 +01:00
vmuzikar ef8adc15f4 KEYCLOAK-5720 Fix X.509 tests 2017-11-03 17:09:46 +01:00
Pedro Igor 1ac9bd510b Merge pull request #4623 from pedroigor/KEYCLOAK-5728
[KEYCLOAK-5728] - Permission Claims support
2017-11-03 05:42:06 -03:00
Hynek Mlnařík 4d0d28c222 Merge pull request #4621 from hmlnarik/KEYCLOAK-5230-Indexes-on-USER-ID-missing-from-the-federated-user-tables
KEYCLOAK-5230 Add indices to FED_* tables
2017-10-31 08:48:34 +01:00
Pedro Igor 6b0c58bab3 Merge pull request #4622 from pedroigor/KEYCLOAK-5763
[KEYCLOAK-5763] - Forward credentials when using Elytron Adapter
2017-10-27 14:45:13 -03:00
Pedro Igor 3716fa44ac [KEYCLOAK-5728] - Permission Claims support 2017-10-27 12:40:30 -02:00
Pedro Igor d3dee07956 [KEYCLOAK-5763] - Forward credentials when using Elytron Adapter 2017-10-27 12:34:31 -02:00
Stan Silvert 986540ab34 KEYCLOAK-4383: Dbl-click login button leads to "already logged in" page (#4614) 2017-10-27 10:29:37 -04:00
Hynek Mlnarik c9aa5e638e KEYCLOAK-5230 Add indices to FED_* tables 2017-10-27 12:43:22 +02:00
Hynek Mlnařík 8d879867b5 Merge pull request #4620 from hmlnarik/KEYCLOAK-5745-Extract-client-sessions-from-user-sessions-2
KEYCLOAK-5745 Fix ActionTokenCrossDCTest and improve logging
2017-10-27 09:55:03 +02:00
Hynek Mlnarik 92027e4c57 KEYCLOAK-5745 Fix ActionTokenCrossDCTest and improve logging 2017-10-27 08:45:05 +02:00
Pedro Igor 081ad09ed8 Merge pull request #4619 from pedroigor/KEYCLOAK-4901
[KEYCLOAK-4901] - Reviewing methods on provider spi
2017-10-26 15:33:09 -03:00
Hynek Mlnařík b0d88be420 Merge pull request #4572 from tkyjovsk/db-failover
KEYCLOAK-5691 Galera cluster, full testsuite
2017-10-26 20:22:47 +02:00
Pedro Igor 57d3c44bb7 [KEYCLOAK-4901] - New policy mgmt rest api should return specific representations for a policy type 2017-10-26 15:26:40 -02:00
Pedro Igor a70cab502c [KEYCLOAK-4901] - Reviewing methods on provider spis 2017-10-26 13:39:57 -02:00
Pavel Drozd 12b2e72162 Merge pull request #4618 from vramik/KEYCLOAK-5244
KEYCLOAK-5244 fix blacklists.path in tests
2017-10-26 15:30:14 +02:00
Tomas Kyjovsky a45a2acc4c KEYCLOAK-5691 Galera cluster, full testsuite 2017-10-26 15:27:57 +02:00
vramik 8cbdbb2fed KEYCLOAK-5244 add PasswordPolicyTest to travis-run-tests.sh 2017-10-26 14:38:57 +02:00
Marek Posolda 9e2ab2750a Merge pull request #4616 from vramik/KEYCLOAK-5749
KEYCLOAK-5749 Update migration scripts for WildFly 11 Final
2017-10-26 13:24:29 +02:00
Marek Posolda aabd47ecdf Merge pull request #4613 from tkyjovsk/KEYCLOAK-5751
KEYCLOAK-5751 Login/logout performance test scenario failing
2017-10-26 13:11:41 +02:00
Hynek Mlnařík 248da4687a Merge pull request #4610 from hmlnarik/KEYCLOAK-5745-Extract-client-sessions-from-user-sessions
KEYCLOAK-5745 Separate user and client sessions in infinispan
2017-10-26 13:09:06 +02:00
vramik 2b44cb70af KEYCLOAK-5244 fix blacklists.path in tests 2017-10-26 12:28:50 +02:00
vramik 906538e6aa KEYCLOAK-5749 Update migration scripts for WildFly 11 Final 2017-10-26 11:21:48 +02:00
Hynek Mlnarik 75c354fd94 KEYCLOAK-5745 Separate user and client sessions in infinispan 2017-10-26 10:39:41 +02:00
Tomas Kyjovsky 9bd5d31c1f Added "&amp; to &" rewrite for login form URI in the perf tests. 2017-10-25 22:28:46 +02:00
Bill Burke 903a4dd849 Merge pull request #4612 from patriot1burke/master
KEYCLOAK-5273
2017-10-25 13:54:32 -04:00
Bill Burke de6eab6d5d fix 2017-10-25 13:00:58 -04:00
Bill Burke 8c1a3253fb KEYCLOAK-5273 2017-10-25 10:31:11 -04:00
Bruno Oliveira da Silva 375e01a074 KEYCLOAK-5278 (#4606) 2017-10-25 15:27:24 +02:00
Marek Posolda 74f5c1c160 Merge pull request #4611 from mposolda/ldap-eviction-day
KEYCLOAK-5746 Bad label for evictionDay in admin console in EVICT_WEE…
2017-10-25 11:14:18 +02:00
mposolda 5f889dd3c6 KEYCLOAK-5746 Bad label for evictionDay in admin console in EVICT_WEEKLY cache policy 2017-10-25 09:08:33 +02:00
Bill Burke 50ccb5e5f6 Merge pull request #4591 from abstractj/KEYCLOAK-5717
KEYCLOAK-5717
2017-10-24 17:38:28 -04:00
Marek Posolda 9793e6aa25 Merge pull request #4608 from mposolda/wf-upgrade
KEYCLOAK-4936 Upgrade to WildFly 11.0.0.Final
2017-10-24 22:35:40 +02:00
mposolda 2dd6a2e655 KEYCLOAK-4936 Upgrade to WildFly 11.0.0.Final 2017-10-24 21:23:19 +02:00
Pedro Igor 1840cc54e4 Merge pull request #4601 from pedroigor/KEYCLOAK-5726
[KEYCLOAK-5726] - Support define enforcement mode for scopes on the adapter config
2017-10-24 12:51:52 -02:00
Hynek Mlnařík 7190820fc4 Merge pull request #4566 from vramik/KEYCLOAK-4928
KEYCLOAK-4928 Add primary key constraints
2017-10-24 15:40:37 +02:00
Pedro Igor 80e9b08bb6 [KEYCLOAK-5726] - Tests for scopes-enforcement-mode ALL and ANY 2017-10-24 11:37:41 -02:00
Bruno Oliveira 4d762159ef KEYCLOAK-5717 2017-10-24 10:55:02 -02:00
Marek Posolda a7bc294a08 Merge pull request #4594 from hmlnarik/KEYCLOAK-5688-Externalizer-for-entities-shared-across-DC-2
KEYCLOAK-5688 Externalizers for cluster messages and predicates
2017-10-24 14:41:16 +02:00
Hynek Mlnařík 8e0cc2a5ea Merge pull request #4605 from mposolda/master
KEYCLOAK-5710 Change cache-server to use backups based caches
2017-10-24 14:40:01 +02:00
Pedro Igor bc12193c3c [KEYCLOAK-5726] - Fixes the parameter value when making queries 2017-10-24 10:39:55 -02:00
Pedro Igor 7dd7b6b984 [KEYCLOAK-5726] - Defaults to true in case no required scopes are defined 2017-10-24 10:39:55 -02:00
Pedro Igor 711aa83d31 [KEYCLOAK-5726] - Fixing web origins on photoz quickstart 2017-10-24 10:39:55 -02:00
Pedro Igor a6e1413d58 [KEYCLOAK-5726] - Support define enforcement mode for scopes on the adapter configuration 2017-10-24 10:39:54 -02:00
Pavel Drozd a4ec32ba66 Merge pull request #4602 from vramik/KEYCLOAK-5244
KEYCLOAK-5244 fix PasswordPolicyTest.testBlacklistPasswordPolicyWithT…
2017-10-24 14:17:35 +02:00
mposolda 9a19e95b60 KEYCLOAK-5710 Change cache-server to use backups based caches 2017-10-24 11:52:08 +02:00
Stian Thorgersen f0bbcbf0fd KEYCLOAK-5487 (#4603) 2017-10-24 10:49:08 +02:00
vramik 223713bc53 KEYCLOAK-4928 Add primary key constraints 2017-10-24 10:46:46 +02:00
Stan Silvert 330f2acc29 KEYCLOAK-5732: Freemarker pages using ?html (#4607) 2017-10-23 16:35:45 -04:00
Pavel Drozd 4010e5e247 Merge pull request #4588 from tkyjovsk/KEYCLOAK-5711
KEYCLOAK-5711 Adapter test module for Wildfly has compilation error
2017-10-23 22:27:31 +02:00
Stan Silvert 574fd42534 KEYCLOAK-5681: Upgrade AngularJS for Admin Console (#4571) 2017-10-23 12:03:46 -04:00
Stan Silvert 9083e5fe5c KEYCLOAK-5298: Enable autoescaping in Freemarker (#4561)
* KEYCLOAK-5298: Enable autoescaping in Freemarker

* Fix several of the failing tests.

* Fix broken tests in integration-deprecated

* Fix last failing test.
2017-10-23 12:03:00 -04:00
Pavel Drozd 1eb2d894e5 Merge pull request #4593 from vmuzikar/ssl-fix
KEYCLOAK-5719 fix auth server ssl with base testsuite
2017-10-23 16:39:22 +02:00
Stian Thorgersen 9b75b603e3 KEYCLOAK-5234 (#4585) 2017-10-23 16:13:22 +02:00
Hynek Mlnarik faf830dc77 KEYCLOAK-5688 Externalizers for cluster messages and predicates 2017-10-23 12:18:56 +02:00
vramik a3a1761eb7 KEYCLOAK-5244 fix PasswordPolicyTest.testBlacklistPasswordPolicyWithTestBlacklist on Wildfly 2017-10-23 12:11:36 +02:00
vmuzikar 1dd2a90e20 KEYCLOAK-5719 fix auth server ssl with base testsuite 2017-10-20 14:10:06 +02:00
Tomas Kyjovsky bd706418c9 KEYCLOAK-5711 Adapter test module for Wildfly has compilation error 2017-10-19 19:41:31 +02:00
1603 changed files with 52302 additions and 8595 deletions

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -206,6 +206,16 @@ public class AdapterDeploymentContext {
public void setBearerOnly(boolean bearerOnly) {
delegate.setBearerOnly(bearerOnly);
}
@Override
public boolean isAutodetectBearerOnly() {
return delegate.isAutodetectBearerOnly();
}
@Override
public void setAutodetectBearerOnly(boolean autodetectBearerOnly) {
delegate.setAutodetectBearerOnly(autodetectBearerOnly);
}
@Override
public boolean isEnableBasicAuth() {
@@ -277,6 +287,16 @@ public class AdapterDeploymentContext {
delegate.setSslRequired(sslRequired);
}
@Override
public int getConfidentialPort() {
return delegate.getConfidentialPort();
}
@Override
public void setConfidentialPort(int confidentialPort) {
delegate.setConfidentialPort(confidentialPort);
}
@Override
public TokenStore getTokenStore() {
return delegate.getTokenStore();
@@ -71,9 +71,10 @@ public class BasicAuthRequestAuthenticator extends BearerTokenRequestAuthenticat
AccessTokenResponse atr=null;
try {
String userpw=new String(Base64.decode(tokenString));
String[] parts=userpw.split(":");
atr = getToken(parts[0], parts[1]);
int seperatorIndex = userpw.indexOf(":");
String user = userpw.substring(0, seperatorIndex);
String pw = userpw.substring(seperatorIndex + 1);
atr = getToken(user, pw);
tokenString = atr.getToken();
} catch (Exception e) {
log.debug("Failed to obtain token", e);
@@ -82,8 +83,8 @@ public class BasicAuthRequestAuthenticator extends BearerTokenRequestAuthenticat
}
return authenticateToken(exchange, atr.getToken());
}
}
private AccessTokenResponse getToken(String username, String password) throws Exception {
AccessTokenResponse tokenResponse=null;
HttpClient client = deployment.getClient();
@@ -23,6 +23,8 @@ 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.jose.jws.JWSInput;
import org.keycloak.jose.jws.JWSInputException;
import org.keycloak.representations.AccessToken;
import javax.security.cert.X509Certificate;
@@ -83,6 +85,16 @@ public class BearerTokenRequestAuthenticator {
}
protected AuthOutcome authenticateToken(HttpFacade exchange, String tokenString) {
log.debug("Verifying access_token");
if (log.isTraceEnabled()) {
try {
JWSInput jwsInput = new JWSInput(tokenString);
String wireString = jwsInput.getWireString();
log.tracef("\taccess_token: %s", wireString.substring(0, wireString.lastIndexOf(".")) + ".signature");
} catch (JWSInputException e) {
log.errorf(e, "Failed to parse access_token: %s", tokenString);
}
}
try {
token = AdapterRSATokenVerifier.verifyToken(tokenString, deployment);
} catch (VerificationException e) {
@@ -124,6 +136,7 @@ public class BearerTokenRequestAuthenticator {
}
surrogate = chain[0].getSubjectDN().getName();
}
log.debug("successful authorized");
return AuthOutcome.AUTHENTICATED;
}
@@ -57,6 +57,8 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.apache.http.client.params.ClientPNames;
import org.apache.http.client.params.CookiePolicy;
/**
* Abstraction for creating HttpClients. Allows SSL configuration.
@@ -289,6 +291,7 @@ public class HttpClientBuilder {
cm = new SingleClientConnManager(registry);
}
BasicHttpParams params = new BasicHttpParams();
params.setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY);
if (proxyHost != null) {
params.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxyHost);
@@ -68,6 +68,7 @@ public class KeycloakDeployment {
protected String scope;
protected SslRequired sslRequired = SslRequired.ALL;
protected int confidentialPort = -1;
protected TokenStore tokenStore = TokenStore.SESSION;
protected String stateCookieName = "OAuth_Token_Request_State";
protected boolean useResourceRoleMappings;
@@ -153,6 +154,8 @@ public class KeycloakDeployment {
log.debug("resolveUrls");
}
authServerBaseUrl = authUrlBuilder.build().toString();
String login = authUrlBuilder.clone().path(ServiceUrlConstants.AUTH_PATH).build(getRealm()).toString();
authUrl = KeycloakUriBuilder.fromUri(login);
realmInfoUrl = authUrlBuilder.clone().path(ServiceUrlConstants.REALM_INFO_PATH).build(getRealm()).toString();
@@ -277,6 +280,14 @@ public class KeycloakDeployment {
this.sslRequired = sslRequired;
}
public int getConfidentialPort() {
return confidentialPort;
}
public void setConfidentialPort(int confidentialPort) {
this.confidentialPort = confidentialPort;
}
public TokenStore getTokenStore() {
return tokenStore;
}
@@ -78,6 +78,11 @@ public class KeycloakDeploymentBuilder {
} else {
deployment.setSslRequired(SslRequired.EXTERNAL);
}
if (adapterConfig.getConfidentialPort() != -1) {
deployment.setConfidentialPort(adapterConfig.getConfidentialPort());
}
if (adapterConfig.getTokenStore() != null) {
deployment.setTokenStore(TokenStore.valueOf(adapterConfig.getTokenStore().toUpperCase()));
} else {
@@ -66,7 +66,7 @@ public class OAuthRequestAuthenticator {
this.reqAuthenticator = requestAuthenticator;
this.facade = facade;
this.deployment = deployment;
this.sslRedirectPort = sslRedirectPort;
this.sslRedirectPort = deployment.getConfidentialPort() != -1 ? deployment.getConfidentialPort() : sslRedirectPort;
this.tokenStore = tokenStore;
}
@@ -170,6 +170,9 @@ public class OAuthRequestAuthenticator {
String maxAge = getQueryParamValue(OAuth2Constants.MAX_AGE);
url = UriUtils.stripQueryParam(url, OAuth2Constants.MAX_AGE);
String uiLocales = getQueryParamValue(OAuth2Constants.UI_LOCALES_PARAM);
url = UriUtils.stripQueryParam(url, OAuth2Constants.UI_LOCALES_PARAM);
KeycloakUriBuilder redirectUriBuilder = deployment.getAuthUrl().clone()
.queryParam(OAuth2Constants.RESPONSE_TYPE, OAuth2Constants.CODE)
.queryParam(OAuth2Constants.CLIENT_ID, deployment.getResourceName())
@@ -188,6 +191,9 @@ public class OAuthRequestAuthenticator {
if (maxAge != null && maxAge.length() > 0) {
redirectUriBuilder.queryParam(OAuth2Constants.MAX_AGE, maxAge);
}
if (uiLocales != null && uiLocales.length() > 0) {
redirectUriBuilder.queryParam(OAuth2Constants.UI_LOCALES_PARAM, uiLocales);
}
scope = TokenUtil.attachOIDCScope(scope);
redirectUriBuilder.queryParam(OAuth2Constants.SCOPE, scope);
@@ -344,6 +350,14 @@ public class OAuthRequestAuthenticator {
tokenString = tokenResponse.getToken();
refreshToken = tokenResponse.getRefreshToken();
idTokenString = tokenResponse.getIdToken();
log.debug("Verifying tokens");
if (log.isTraceEnabled()) {
logToken("\taccess_token", tokenString);
logToken("\tid_token", idTokenString);
logToken("\trefresh_token", refreshToken);
}
try {
token = AdapterRSATokenVerifier.verifyToken(tokenString, deployment);
if (idTokenString != null) {
@@ -376,7 +390,8 @@ public class OAuthRequestAuthenticator {
protected String stripOauthParametersFromRedirect() {
KeycloakUriBuilder builder = KeycloakUriBuilder.fromUri(facade.getRequest().getURI())
.replaceQueryParam(OAuth2Constants.CODE, null)
.replaceQueryParam(OAuth2Constants.STATE, null);
.replaceQueryParam(OAuth2Constants.STATE, null)
.replaceQueryParam(OAuth2Constants.SESSION_STATE, null);
return builder.build().toString();
}
@@ -398,4 +413,13 @@ public class OAuthRequestAuthenticator {
return originalUri;
}
private void logToken(String name, String token) {
try {
JWSInput jwsInput = new JWSInput(token);
String wireString = jwsInput.getWireString();
log.tracef("\t%s: %s", name, wireString.substring(0, wireString.lastIndexOf(".")) + ".signature");
} catch (JWSInputException e) {
log.errorf(e, "Failed to parse %s: %s", name, token);
}
}
}
@@ -32,7 +32,7 @@ import java.util.Map;
*/
public class ClientIdAndSecretCredentialsProvider implements ClientCredentialsProvider {
private static Logger logger = Logger.getLogger(ClientCredentialsProviderUtils.class);
private static Logger logger = Logger.getLogger(ClientIdAndSecretCredentialsProvider.class);
public static final String PROVIDER_ID = CredentialRepresentation.SECRET;
@@ -33,6 +33,7 @@ import org.keycloak.authorization.client.ClientAuthorizationContext;
import org.keycloak.representations.AccessToken;
import org.keycloak.representations.adapters.config.PolicyEnforcerConfig;
import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.EnforcementMode;
import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.MethodConfig;
import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig;
import org.keycloak.representations.idm.authorization.Permission;
@@ -96,9 +97,9 @@ public abstract class AbstractPolicyEnforcer {
return createEmptyAuthorizationContext(true);
}
Set<String> requiredScopes = getRequiredScopes(pathConfig, request);
MethodConfig methodConfig = getRequiredScopes(pathConfig, request);
if (isAuthorized(pathConfig, requiredScopes, accessToken, httpFacade)) {
if (isAuthorized(pathConfig, methodConfig, accessToken, httpFacade)) {
try {
return createAuthorizationContext(accessToken, pathConfig);
} catch (Exception e) {
@@ -108,7 +109,7 @@ public abstract class AbstractPolicyEnforcer {
LOGGER.debugf("Sending challenge to the client. Path [%s]", pathConfig);
if (!challenge(pathConfig, requiredScopes, httpFacade)) {
if (!challenge(pathConfig, methodConfig, httpFacade)) {
LOGGER.debugf("Challenge not sent, sending default forbidden response. Path [%s]", pathConfig);
handleAccessDenied(httpFacade);
}
@@ -118,9 +119,9 @@ public abstract class AbstractPolicyEnforcer {
return createEmptyAuthorizationContext(false);
}
protected abstract boolean challenge(PathConfig pathConfig, Set<String> requiredScopes, OIDCHttpFacade facade);
protected abstract boolean challenge(PathConfig pathConfig, MethodConfig methodConfig, OIDCHttpFacade facade);
protected boolean isAuthorized(PathConfig actualPathConfig, Set<String> requiredScopes, AccessToken accessToken, OIDCHttpFacade httpFacade) {
protected boolean isAuthorized(PathConfig actualPathConfig, MethodConfig methodConfig, AccessToken accessToken, OIDCHttpFacade httpFacade) {
Request request = httpFacade.getRequest();
PolicyEnforcerConfig enforcerConfig = getEnforcerConfig();
@@ -146,7 +147,7 @@ public abstract class AbstractPolicyEnforcer {
continue;
}
if (hasResourceScopePermission(requiredScopes, permission, actualPathConfig)) {
if (hasResourceScopePermission(methodConfig, permission)) {
LOGGER.debugf("Authorization GRANTED for path [%s]. Permissions [%s].", actualPathConfig, permissions);
if (request.getMethod().equalsIgnoreCase("DELETE") && actualPathConfig.isInstance()) {
this.paths.remove(actualPathConfig);
@@ -155,7 +156,7 @@ public abstract class AbstractPolicyEnforcer {
}
}
} else {
if (hasResourceScopePermission(requiredScopes, permission, actualPathConfig)) {
if (hasResourceScopePermission(methodConfig, permission)) {
hasPermission = true;
return true;
}
@@ -166,7 +167,7 @@ public abstract class AbstractPolicyEnforcer {
return true;
}
LOGGER.debugf("Authorization FAILED for path [%s]. No enough permissions [%s].", actualPathConfig, permissions);
LOGGER.debugf("Authorization FAILED for path [%s]. Not enough permissions [%s].", actualPathConfig, permissions);
return false;
}
@@ -186,9 +187,29 @@ public abstract class AbstractPolicyEnforcer {
return false;
}
private boolean hasResourceScopePermission(Set<String> requiredScopes, Permission permission, PathConfig actualPathConfig) {
private boolean hasResourceScopePermission(MethodConfig methodConfig, Permission permission) {
List<String> requiredScopes = methodConfig.getScopes();
Set<String> allowedScopes = permission.getScopes();
return (allowedScopes.containsAll(requiredScopes) || allowedScopes.isEmpty());
if (allowedScopes.isEmpty()) {
return true;
}
PolicyEnforcerConfig.ScopeEnforcementMode enforcementMode = methodConfig.getScopesEnforcementMode();
if (PolicyEnforcerConfig.ScopeEnforcementMode.ALL.equals(enforcementMode)) {
return allowedScopes.containsAll(requiredScopes);
}
if (PolicyEnforcerConfig.ScopeEnforcementMode.ANY.equals(enforcementMode)) {
for (String requiredScope : requiredScopes) {
if (allowedScopes.contains(requiredScope)) {
return true;
}
}
}
return requiredScopes.isEmpty();
}
protected AuthzClient getAuthzClient() {
@@ -236,20 +257,22 @@ public abstract class AbstractPolicyEnforcer {
return request.getRelativePath();
}
private Set<String> getRequiredScopes(PathConfig pathConfig, Request request) {
Set<String> requiredScopes = new HashSet<>();
requiredScopes.addAll(pathConfig.getScopes());
private MethodConfig getRequiredScopes(PathConfig pathConfig, Request request) {
String method = request.getMethod();
for (PolicyEnforcerConfig.MethodConfig methodConfig : pathConfig.getMethods()) {
for (MethodConfig methodConfig : pathConfig.getMethods()) {
if (methodConfig.getMethod().equals(method)) {
requiredScopes.addAll(methodConfig.getScopes());
return methodConfig;
}
}
return requiredScopes;
MethodConfig methodConfig = new MethodConfig();
methodConfig.setMethod(request.getMethod());
methodConfig.setScopes(pathConfig.getScopes());
methodConfig.setScopesEnforcementMode(PolicyEnforcerConfig.ScopeEnforcementMode.ANY);
return methodConfig;
}
private AuthorizationContext createAuthorizationContext(AccessToken accessToken, PathConfig pathConfig) {
@@ -17,7 +17,7 @@
*/
package org.keycloak.adapters.authorization;
import java.util.Set;
import java.util.HashSet;
import org.jboss.logging.Logger;
import org.keycloak.adapters.OIDCHttpFacade;
@@ -26,6 +26,7 @@ import org.keycloak.authorization.client.AuthzClient;
import org.keycloak.authorization.client.representation.PermissionRequest;
import org.keycloak.authorization.client.resource.PermissionResource;
import org.keycloak.authorization.client.resource.ProtectionResource;
import org.keycloak.representations.adapters.config.PolicyEnforcerConfig;
import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig;
/**
@@ -40,9 +41,9 @@ public class BearerTokenPolicyEnforcer extends AbstractPolicyEnforcer {
}
@Override
protected boolean challenge(PathConfig pathConfig, Set<String> requiredScopes, OIDCHttpFacade facade) {
protected boolean challenge(PathConfig pathConfig, PolicyEnforcerConfig.MethodConfig methodConfig, OIDCHttpFacade facade) {
if (getEnforcerConfig().getUserManagedAccess() != null) {
challengeUmaAuthentication(pathConfig, requiredScopes, facade);
challengeUmaAuthentication(pathConfig, methodConfig, facade);
} else {
challengeEntitlementAuthentication(facade);
}
@@ -61,10 +62,10 @@ public class BearerTokenPolicyEnforcer extends AbstractPolicyEnforcer {
}
}
private void challengeUmaAuthentication(PathConfig pathConfig, Set<String> requiredScopes, OIDCHttpFacade facade) {
private void challengeUmaAuthentication(PathConfig pathConfig, PolicyEnforcerConfig.MethodConfig methodConfig, OIDCHttpFacade facade) {
HttpFacade.Response response = facade.getResponse();
AuthzClient authzClient = getAuthzClient();
String ticket = getPermissionTicket(pathConfig, requiredScopes, authzClient);
String ticket = getPermissionTicket(pathConfig, methodConfig, authzClient);
String clientId = authzClient.getConfiguration().getResource();
String authorizationServerUri = authzClient.getServerConfiguration().getIssuer().toString() + "/authz/authorize";
response.setStatus(401);
@@ -74,12 +75,12 @@ public class BearerTokenPolicyEnforcer extends AbstractPolicyEnforcer {
}
}
private String getPermissionTicket(PathConfig pathConfig, Set<String> requiredScopes, AuthzClient authzClient) {
private String getPermissionTicket(PathConfig pathConfig, PolicyEnforcerConfig.MethodConfig methodConfig, AuthzClient authzClient) {
ProtectionResource protection = authzClient.protection();
PermissionResource permission = protection.permission();
PermissionRequest permissionRequest = new PermissionRequest();
permissionRequest.setResourceSetId(pathConfig.getId());
permissionRequest.setScopes(requiredScopes);
permissionRequest.setScopes(new HashSet<>(methodConfig.getScopes()));
return permission.forResource(permissionRequest).getTicket();
}
}
@@ -35,6 +35,7 @@ import org.keycloak.authorization.client.representation.EntitlementResponse;
import org.keycloak.authorization.client.representation.PermissionRequest;
import org.keycloak.authorization.client.representation.PermissionResponse;
import org.keycloak.representations.AccessToken;
import org.keycloak.representations.adapters.config.PolicyEnforcerConfig;
import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig;
import org.keycloak.representations.idm.authorization.Permission;
@@ -50,14 +51,14 @@ public class KeycloakAdapterPolicyEnforcer extends AbstractPolicyEnforcer {
}
@Override
protected boolean isAuthorized(PathConfig pathConfig, Set<String> requiredScopes, AccessToken accessToken, OIDCHttpFacade httpFacade) {
protected boolean isAuthorized(PathConfig pathConfig, PolicyEnforcerConfig.MethodConfig methodConfig, AccessToken accessToken, OIDCHttpFacade httpFacade) {
AccessToken original = accessToken;
if (super.isAuthorized(pathConfig, requiredScopes, accessToken, httpFacade)) {
if (super.isAuthorized(pathConfig, methodConfig, accessToken, httpFacade)) {
return true;
}
accessToken = requestAuthorizationToken(pathConfig, requiredScopes, httpFacade);
accessToken = requestAuthorizationToken(pathConfig, methodConfig, httpFacade);
if (accessToken == null) {
return false;
@@ -78,11 +79,11 @@ public class KeycloakAdapterPolicyEnforcer extends AbstractPolicyEnforcer {
original.setAuthorization(authorization);
return super.isAuthorized(pathConfig, requiredScopes, accessToken, httpFacade);
return super.isAuthorized(pathConfig, methodConfig, accessToken, httpFacade);
}
@Override
protected boolean challenge(PathConfig pathConfig, Set<String> requiredScopes, OIDCHttpFacade facade) {
protected boolean challenge(PathConfig pathConfig, PolicyEnforcerConfig.MethodConfig methodConfig, OIDCHttpFacade facade) {
handleAccessDenied(facade);
return true;
}
@@ -100,7 +101,7 @@ public class KeycloakAdapterPolicyEnforcer extends AbstractPolicyEnforcer {
}
}
private AccessToken requestAuthorizationToken(PathConfig pathConfig, Set<String> requiredScopes, OIDCHttpFacade httpFacade) {
private AccessToken requestAuthorizationToken(PathConfig pathConfig, PolicyEnforcerConfig.MethodConfig methodConfig, OIDCHttpFacade httpFacade) {
try {
String accessToken = httpFacade.getSecurityContext().getTokenString();
AuthzClient authzClient = getAuthzClient();
@@ -111,7 +112,7 @@ public class KeycloakAdapterPolicyEnforcer extends AbstractPolicyEnforcer {
PermissionRequest permissionRequest = new PermissionRequest();
permissionRequest.setResourceSetId(pathConfig.getId());
permissionRequest.setScopes(requiredScopes);
permissionRequest.setScopes(new HashSet<>(methodConfig.getScopes()));
PermissionResponse permissionResponse = authzClient.protection().permission().forResource(permissionRequest);
AuthorizationRequest authzRequest = new AuthorizationRequest(permissionResponse.getTicket());
@@ -81,7 +81,7 @@ public class JWKPublicKeyLocator implements PublicKeyLocator {
private PublicKey lookupCachedKey(int publicKeyCacheTtl, int currentTime, String kid) {
if (lastRequestTime + publicKeyCacheTtl > currentTime) {
if (lastRequestTime + publicKeyCacheTtl > currentTime && kid != null) {
return currentKeys.get(kid);
} else {
return null;
@@ -17,7 +17,9 @@
package org.keycloak.adapters;
import org.junit.Test;
import org.keycloak.representations.adapters.config.AdapterConfig;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -46,4 +48,21 @@ public class KeycloakDeploymentTest {
assertTrue(keycloakDeployment.isOAuthQueryParameterEnabled());
}
@Test
public void stripDefaultPorts() {
KeycloakDeployment keycloakDeployment = new KeycloakDeployment();
keycloakDeployment.setRealm("test");
AdapterConfig config = new AdapterConfig();
config.setAuthServerUrl("http://localhost:80/auth");
keycloakDeployment.setAuthServerBaseUrl(config);
assertEquals("http://localhost/auth", keycloakDeployment.getAuthServerBaseUrl());
config.setAuthServerUrl("https://localhost:443/auth");
keycloakDeployment.setAuthServerBaseUrl(config);
assertEquals("https://localhost/auth", keycloakDeployment.getAuthServerBaseUrl());
}
}
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-as7-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+2 -2
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak Jetty Integration</name>
@@ -33,6 +33,7 @@
<modules>
<module>jetty-core</module>
<module>jetty8.1</module>
<module>jetty9.1</module>
<module>jetty9.2</module>
<module>jetty9.3</module>
</modules>
@@ -46,7 +47,6 @@
</property>
</activation>
<modules>
<module>jetty9.1</module>
<module>jetty9.4</module>
</modules>
</profile>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -159,10 +159,12 @@
var callback = parseCallback(window.location.href);
if (callback) {
setupCheckLoginIframe();
window.history.replaceState({}, null, callback.newUrl);
processCallback(callback, initPromise);
return;
return setupCheckLoginIframe().success(function() {
window.history.replaceState({}, null, callback.newUrl);
processCallback(callback, initPromise);
}).error(function (e) {
initPromise.setError();
});
} else if (initOptions) {
if (initOptions.token && initOptions.refreshToken) {
setToken(initOptions.token, initOptions.refreshToken, initOptions.idToken);
@@ -36,7 +36,7 @@
req.onreadystatechange = function () {
if (req.readyState === 4) {
if (req.status === 204) {
if (req.status === 204 || req.status === 1223) {
init = {
clientId: clientId,
origin: origin
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -4,7 +4,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<artifactId>spring-boot-container-bundle</artifactId>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -132,10 +132,8 @@ public class KeycloakAutoConfiguration {
loginConfig.addFirstAuthMethod("KEYCLOAK");
deploymentInfo.setLoginConfig(loginConfig);
deploymentInfo.addInitParameter("keycloak.config.resolver", KeycloakSpringBootConfigResolver.class.getName());
deploymentInfo.addSecurityConstraints(getSecurityConstraints());
deploymentInfo.addServletExtension(new KeycloakServletExtension());
}
@@ -157,7 +155,6 @@ public class KeycloakAutoConfiguration {
undertowSecurityConstraint.addWebResourceCollections(webResourceCollection);
}
undertowSecurityConstraints.add(undertowSecurityConstraint);
}
return undertowSecurityConstraints;
@@ -280,6 +277,11 @@ public class KeycloakAutoConfiguration {
for (String authRole : constraint.getAuthRoles()) {
tomcatConstraint.addAuthRole(authRole);
if(authRole.equals("*") || authRole.equals("**")) {
// For some reasons embed tomcat don't set the auth constraint on true when wildcard is
// used
tomcatConstraint.setAuthConstraint(true);
}
}
for (KeycloakSpringBootProperties.SecurityCollection collection : constraint.getSecurityCollections()) {
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -45,11 +45,7 @@ public class HttpHeaderInspectingApiRequestMatcher implements RequestMatcher {
*/
@Override
public boolean matches(HttpServletRequest request) {
boolean ajax = X_REQUESTED_WITH_HEADER_AJAX_VALUE.equals(request.getHeader(X_REQUESTED_WITH_HEADER));
boolean html = request.getHeader(HttpHeaders.ACCEPT) != null && request.getHeader(HttpHeaders.ACCEPT).contains(
MediaType.TEXT_HTML_VALUE);
return ajax || !html;
return X_REQUESTED_WITH_HEADER_AJAX_VALUE.equals(request.getHeader(X_REQUESTED_WITH_HEADER));
}
}
@@ -17,7 +17,16 @@
package org.keycloak.adapters.springsecurity.authentication;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.http.HttpHeaders;
import org.keycloak.adapters.AdapterDeploymentContext;
import org.keycloak.adapters.spi.HttpFacade;
import org.keycloak.adapters.springsecurity.facade.SimpleHttpFacade;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
@@ -26,17 +35,6 @@ import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.web.util.matcher.RequestMatcher;
import org.springframework.util.Assert;
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
* {@link RequestMatcher} to determine if the request is an interactive login request or a
@@ -62,15 +60,14 @@ 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(AdapterDeploymentContext adapterDeploymentContext) {
this(DEFAULT_API_REQUEST_MATCHER);
this.adapterDeploymentContext = adapterDeploymentContext;
this(adapterDeploymentContext, DEFAULT_API_REQUEST_MATCHER);
}
/**
@@ -80,14 +77,15 @@ public class KeycloakAuthenticationEntryPoint implements AuthenticationEntryPoin
* @param apiRequestMatcher the <code>RequestMatcher</code> to use to determine
* if the current request is an API request or a browser request (required)
*/
public KeycloakAuthenticationEntryPoint(RequestMatcher apiRequestMatcher) {
public KeycloakAuthenticationEntryPoint(AdapterDeploymentContext adapterDeploymentContext, RequestMatcher apiRequestMatcher) {
Assert.notNull(apiRequestMatcher, "apiRequestMatcher required");
Assert.notNull(adapterDeploymentContext, "adapterDeploymentContext required");
this.adapterDeploymentContext = adapterDeploymentContext;
this.apiRequestMatcher = apiRequestMatcher;
}
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException
{
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
HttpFacade facade = new SimpleHttpFacade(request, response);
if (apiRequestMatcher.matches(request) || adapterDeploymentContext.resolveDeployment(facade).isBearerOnly()) {
commenceUnauthorizedResponse(request, response);
@@ -23,9 +23,11 @@ import org.keycloak.adapters.springsecurity.AdapterDeploymentContextFactoryBean;
import org.keycloak.adapters.springsecurity.authentication.KeycloakAuthenticationEntryPoint;
import org.keycloak.adapters.springsecurity.authentication.KeycloakAuthenticationProvider;
import org.keycloak.adapters.springsecurity.authentication.KeycloakLogoutHandler;
import org.keycloak.adapters.springsecurity.filter.KeycloakAuthenticatedActionsFilter;
import org.keycloak.adapters.springsecurity.filter.KeycloakAuthenticationProcessingFilter;
import org.keycloak.adapters.springsecurity.filter.KeycloakCsrfRequestMatcher;
import org.keycloak.adapters.springsecurity.filter.KeycloakPreAuthActionsFilter;
import org.keycloak.adapters.springsecurity.filter.KeycloakSecurityContextRequestFilter;
import org.keycloak.adapters.springsecurity.management.HttpSessionManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -41,6 +43,7 @@ import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.web.authentication.logout.LogoutFilter;
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy;
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter;
/**
* Provides a convenient base class for creating a {@link WebSecurityConfigurer}
@@ -91,6 +94,11 @@ public abstract class KeycloakWebSecurityConfigurerAdapter extends WebSecurityCo
return new KeycloakPreAuthActionsFilter(httpSessionManager());
}
@Bean
protected KeycloakAuthenticatedActionsFilter keycloakAuthenticatedActionsFilter() {
return new KeycloakAuthenticatedActionsFilter();
}
protected KeycloakCsrfRequestMatcher keycloakCsrfRequestMatcher() {
return new KeycloakCsrfRequestMatcher();
}
@@ -117,6 +125,8 @@ public abstract class KeycloakWebSecurityConfigurerAdapter extends WebSecurityCo
.and()
.addFilterBefore(keycloakPreAuthActionsFilter(), LogoutFilter.class)
.addFilterBefore(keycloakAuthenticationProcessingFilter(), BasicAuthenticationFilter.class)
.addFilterBefore(keycloakAuthenticatedActionsFilter(), BasicAuthenticationFilter.class)
.addFilterAfter(keycloakSecurityContextRequestFilter(), SecurityContextHolderAwareRequestFilter.class)
.exceptionHandling().authenticationEntryPoint(authenticationEntryPoint())
.and()
.logout()
@@ -124,4 +134,9 @@ public abstract class KeycloakWebSecurityConfigurerAdapter extends WebSecurityCo
.logoutUrl("/sso/logout").permitAll()
.logoutSuccessUrl("/");
}
@Bean
protected KeycloakSecurityContextRequestFilter keycloakSecurityContextRequestFilter() {
return new KeycloakSecurityContextRequestFilter();
}
}
@@ -0,0 +1,113 @@
/*
* Copyright 2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.adapters.springsecurity.filter;
import org.keycloak.KeycloakPrincipal;
import org.keycloak.KeycloakSecurityContext;
import org.keycloak.adapters.AdapterDeploymentContext;
import org.keycloak.adapters.KeycloakDeployment;
import org.keycloak.adapters.RefreshableKeycloakSecurityContext;
import org.keycloak.adapters.springsecurity.facade.SimpleHttpFacade;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.filter.GenericFilterBean;
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 java.io.IOException;
/**
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/
public class KeycloakSecurityContextRequestFilter extends GenericFilterBean implements ApplicationContextAware {
private static final String FILTER_APPLIED = KeycloakSecurityContext.class.getPackage().getName() + ".token-refreshed";
private ApplicationContext applicationContext;
private AdapterDeploymentContext deploymentContext;
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
if (request.getAttribute(FILTER_APPLIED) != null) {
filterChain.doFilter(request, response);
return;
}
request.setAttribute(FILTER_APPLIED, Boolean.TRUE);
KeycloakSecurityContext keycloakSecurityContext = getKeycloakPrincipal();
if (keycloakSecurityContext instanceof RefreshableKeycloakSecurityContext) {
RefreshableKeycloakSecurityContext refreshableSecurityContext = (RefreshableKeycloakSecurityContext) keycloakSecurityContext;
if (refreshableSecurityContext.isActive()) {
KeycloakDeployment deployment = resolveDeployment(request, response);
if (deployment.isAlwaysRefreshToken()) {
if (refreshableSecurityContext.refreshExpiredToken(false)) {
request.setAttribute(KeycloakSecurityContext.class.getName(), refreshableSecurityContext);
} else {
clearAuthenticationContext();
}
}
} else {
clearAuthenticationContext();
}
}
filterChain.doFilter(request, response);
}
@Override
protected void initFilterBean() throws ServletException {
deploymentContext = applicationContext.getBean(AdapterDeploymentContext.class);
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
private KeycloakSecurityContext getKeycloakPrincipal() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null) {
Object principal = authentication.getPrincipal();
if (principal instanceof KeycloakPrincipal) {
return KeycloakPrincipal.class.cast(principal).getKeycloakSecurityContext();
}
}
return null;
}
private KeycloakDeployment resolveDeployment(ServletRequest servletRequest, ServletResponse servletResponse) {
return deploymentContext.resolveDeployment(new SimpleHttpFacade(HttpServletRequest.class.cast(servletRequest), HttpServletResponse.class.cast(servletResponse)));
}
private void clearAuthenticationContext() {
SecurityContextHolder.clearContext();
}
}
@@ -39,14 +39,9 @@ public class HttpHeaderInspectingApiRequestMatcherTest {
request = new MockHttpServletRequest();
}
@Test
public void testMatches() throws Exception {
assertTrue(apiRequestMatcher.matches(request));
}
@Test
public void testMatchesBrowserRequest() throws Exception {
request.addHeader(HttpHeaders.ACCEPT, "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
request.addHeader(HttpHeaders.ACCEPT, "application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
assertFalse(apiRequestMatcher.matches(request));
}
@@ -55,7 +50,7 @@ public class HttpHeaderInspectingApiRequestMatcherTest {
request.addHeader(
HttpHeaderInspectingApiRequestMatcher.X_REQUESTED_WITH_HEADER,
HttpHeaderInspectingApiRequestMatcher.X_REQUESTED_WITH_HEADER_AJAX_VALUE);
assertTrue(apiRequestMatcher.matches(request));
}
}
@@ -17,24 +17,27 @@
package org.keycloak.adapters.springsecurity.authentication;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.apache.http.HttpHeaders;
import org.junit.Before;
import org.junit.Test;
import org.springframework.http.HttpStatus;
import org.springframework.mock.web.MockHttpServletRequest;
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;
import org.springframework.http.HttpStatus;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.security.web.util.matcher.RequestMatcher;
/**
* Keycloak authentication entry point tests.
@@ -46,13 +49,16 @@ public class KeycloakAuthenticationEntryPointTest {
private MockHttpServletResponse response;
@Mock
private ApplicationContext applicationContext;
@Mock
private AdapterDeploymentContext adapterDeploymentContext;
@Mock
private KeycloakDeployment keycloakDeployment;
@Mock
private RequestMatcher requestMatcher;
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
@@ -86,8 +92,8 @@ public class KeycloakAuthenticationEntryPointTest {
public void testCommenceWithUnauthorizedWithAccept() throws Exception {
request.addHeader(HttpHeaders.ACCEPT, "application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
authenticationEntryPoint.commence(request, response, null);
assertEquals(HttpStatus.UNAUTHORIZED.value(), response.getStatus());
assertNotNull(response.getHeader(HttpHeaders.WWW_AUTHENTICATE));
assertEquals(HttpStatus.FOUND.value(), response.getStatus());
assertNull(response.getHeader(HttpHeaders.WWW_AUTHENTICATE));
}
@Test
@@ -100,6 +106,14 @@ public class KeycloakAuthenticationEntryPointTest {
assertEquals(logoutUri, response.getHeader("Location"));
}
@Test
public void testCommenceWithCustomRequestMatcher() throws Exception {
new KeycloakAuthenticationEntryPoint(adapterDeploymentContext, requestMatcher)
.commence(request, response, null);
verify(requestMatcher).matches(request);
}
private void configureBrowserRequest() {
request.addHeader(HttpHeaders.ACCEPT, "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
}
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+2 -2
View File
@@ -22,7 +22,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -40,7 +40,7 @@
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<version>1.2.0.Beta1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly.security</groupId>
@@ -50,27 +50,29 @@ public class KeycloakConfigurationServletListener implements ServletContextListe
ServletContext servletContext = sce.getServletContext();
String configResolverClass = servletContext.getInitParameter("keycloak.config.resolver");
KeycloakConfigResolver configResolver;
AdapterDeploymentContext deploymentContext;
AdapterDeploymentContext deploymentContext = (AdapterDeploymentContext) servletContext.getAttribute(AdapterDeploymentContext.class.getName());
if (configResolverClass != null) {
try {
configResolver = (KeycloakConfigResolver) servletContext.getClassLoader().loadClass(configResolverClass).newInstance();
deploymentContext = new AdapterDeploymentContext(configResolver);
} catch (Exception ex) {
deploymentContext = new AdapterDeploymentContext(new KeycloakDeployment());
}
} else {
InputStream is = getConfigInputStream(servletContext);
KeycloakDeployment deployment;
if (is == null) {
deployment = new KeycloakDeployment();
if (deploymentContext == null) {
if (configResolverClass != null) {
try {
configResolver = (KeycloakConfigResolver) servletContext.getClassLoader().loadClass(configResolverClass).newInstance();
deploymentContext = new AdapterDeploymentContext(configResolver);
} catch (Exception ex) {
deploymentContext = new AdapterDeploymentContext(new KeycloakDeployment());
}
} else {
deployment = KeycloakDeploymentBuilder.build(is);
}
InputStream is = getConfigInputStream(servletContext);
deploymentContext = new AdapterDeploymentContext(deployment);
KeycloakDeployment deployment;
if (is == null) {
deployment = new KeycloakDeployment();
} else {
deployment = KeycloakDeploymentBuilder.build(is);
}
deploymentContext = new AdapterDeploymentContext(deployment);
}
}
servletContext.setAttribute(ADAPTER_DEPLOYMENT_CONTEXT_ATTRIBUTE, deploymentContext);
@@ -30,8 +30,10 @@ import org.keycloak.KeycloakPrincipal;
import org.keycloak.adapters.RefreshableKeycloakSecurityContext;
import org.wildfly.security.auth.callback.AuthenticationCompleteCallback;
import org.wildfly.security.auth.callback.EvidenceVerifyCallback;
import org.wildfly.security.auth.callback.IdentityCredentialCallback;
import org.wildfly.security.auth.callback.SecurityIdentityCallback;
import org.wildfly.security.auth.server.SecurityIdentity;
import org.wildfly.security.credential.BearerTokenCredential;
import org.wildfly.security.evidence.Evidence;
import org.wildfly.security.http.HttpAuthenticationException;
@@ -63,8 +65,9 @@ final class SecurityIdentityUtil {
}
SecurityIdentityCallback securityIdentityCallback = new SecurityIdentityCallback();
IdentityCredentialCallback credentialCallback = new IdentityCredentialCallback(new BearerTokenCredential(KeycloakPrincipal.class.cast(principal).getKeycloakSecurityContext().getTokenString()), true);
callbackHandler.handle(new Callback[]{AuthenticationCompleteCallback.SUCCEEDED, securityIdentityCallback});
callbackHandler.handle(new Callback[]{credentialCallback, AuthenticationCompleteCallback.SUCCEEDED, securityIdentityCallback});
SecurityIdentity securityIdentity = securityIdentityCallback.getSecurityIdentity();
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
@@ -71,11 +71,10 @@ public class KeycloakAdapterConfigDeploymentProcessor implements DeploymentUnitP
KeycloakAdapterConfigService service = KeycloakAdapterConfigService.getInstance();
if (service.isSecureDeployment(deploymentUnit) && service.isDeploymentConfigured(deploymentUnit)) {
addKeycloakAuthData(phaseContext, service);
} else if (service.isElytronEnabled(deploymentUnit)) {
WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY);
addConfigurationListener(warMetaData);
}
addConfigurationListener(deploymentUnit);
// FYI, Undertow Extension will find deployments that have auth-method set to KEYCLOAK
// todo notsure if we need this
@@ -104,10 +103,6 @@ public class KeycloakAdapterConfigDeploymentProcessor implements DeploymentUnitP
loginConfig.setAuthMethod("KEYCLOAK");
loginConfig.setRealmName(service.getRealmName(deploymentUnit));
KeycloakLogger.ROOT_LOGGER.deploymentSecured(deploymentUnit.getName());
if (service.isElytronEnabled(deploymentUnit)) {
addConfigurationListener(warMetaData);
}
}
private void addJSONData(String json, WarMetaData warMetaData) {
@@ -130,7 +125,8 @@ public class KeycloakAdapterConfigDeploymentProcessor implements DeploymentUnitP
webMetaData.setContextParams(contextParams);
}
private void addConfigurationListener(WarMetaData warMetaData) {
private void addConfigurationListener(DeploymentUnit deploymentUnit) {
WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY);
if (warMetaData == null) {
return;
}
@@ -276,11 +276,13 @@ public final class KeycloakAdapterConfigService {
}
private void setJSONValues(ModelNode json, ModelNode values) {
for (Property prop : new ArrayList<>(values.asPropertyList())) {
String name = prop.getName();
ModelNode value = prop.getValue();
if (value.isDefined()) {
json.get(name).set(value);
synchronized (values) {
for (Property prop : new ArrayList<>(values.asPropertyList())) {
String name = prop.getName();
ModelNode value = prop.getValue();
if (value.isDefined()) {
json.get(name).set(value);
}
}
}
}
@@ -186,7 +186,12 @@ public class SharedAttributeDefinitons {
.setDefaultValue(new ModelNode(false))
.build();
protected static final SimpleAttributeDefinition CONFIDENTIAL_PORT =
new SimpleAttributeDefinitionBuilder("confidential-port", ModelType.INT, true)
.setXmlName("confidential-port")
.setAllowExpression(true)
.setDefaultValue(new ModelNode(8443))
.build();
protected static final List<SimpleAttributeDefinition> ATTRIBUTES = new ArrayList<SimpleAttributeDefinition>();
@@ -196,6 +201,7 @@ public class SharedAttributeDefinitons {
ATTRIBUTES.add(TRUSTSTORE);
ATTRIBUTES.add(TRUSTSTORE_PASSWORD);
ATTRIBUTES.add(SSL_REQUIRED);
ATTRIBUTES.add(CONFIDENTIAL_PORT);
ATTRIBUTES.add(ALLOW_ANY_HOSTNAME);
ATTRIBUTES.add(DISABLE_TRUST_MANAGER);
ATTRIBUTES.add(CONNECTION_POOL_SIZE);
@@ -30,6 +30,7 @@ keycloak.realm.realm-public-key=Public key of the realm
keycloak.realm.auth-server-url=Base URL of the Realm Auth Server
keycloak.realm.disable-trust-manager=Adapter will not use a trust manager when making adapter HTTPS requests
keycloak.realm.ssl-required=Specify if SSL is required (valid values are all, external and none)
keycloak.realm.confidential-port=Specify the confidential port (SSL/TLS) used by the Realm Auth Server
keycloak.realm.allow-any-hostname=SSL Setting
keycloak.realm.truststore=Truststore used for adapter client HTTPS requests
keycloak.realm.truststore-password=Password of the Truststore
@@ -60,6 +61,7 @@ keycloak.secure-deployment.realm-public-key=Public key of the realm
keycloak.secure-deployment.auth-server-url=Base URL of the Realm Auth Server
keycloak.secure-deployment.disable-trust-manager=Adapter will not use a trust manager when making adapter HTTPS requests
keycloak.secure-deployment.ssl-required=Specify if SSL is required (valid values are all, external and none)
keycloak.secure-deployment.confidential-port=Specify the confidential port (SSL/TLS) used by the Realm Auth Server
keycloak.secure-deployment.allow-any-hostname=SSL Setting
keycloak.secure-deployment.truststore=Truststore used for adapter client HTTPS requests
keycloak.secure-deployment.truststore-password=Password of the Truststore
@@ -100,6 +102,7 @@ keycloak.secure-server.realm-public-key=Public key of the realm
keycloak.secure-server.auth-server-url=Base URL of the Realm Auth Server
keycloak.secure-server.disable-trust-manager=Adapter will not use a trust manager when making adapter HTTPS requests
keycloak.secure-server.ssl-required=Specify if SSL is required (valid values are all, external and none)
keycloak.secure-server.confidential-port=Specify the confidential port (SSL/TLS) used by the Realm Auth Server
keycloak.secure-server.allow-any-hostname=SSL Setting
keycloak.secure-server.truststore=Truststore used for adapter client HTTPS requests
keycloak.secure-server.truststore-password=Password of the Truststore
@@ -58,6 +58,7 @@
<xs:element name="expose-token" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="disable-trust-manager" type="xs:boolean" minOccurs="0" maxOccurs="1" />
<xs:element name="ssl-required" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="confidential-port" type="xs:integer" minOccurs="0" maxOccurs="1" />
<xs:element name="cors-allowed-methods" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="cors-exposed-headers" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="realm-public-key" type="xs:string" minOccurs="1" maxOccurs="1"/>
@@ -100,6 +101,7 @@
<xs:element name="connection-pool-size" type="xs:integer" minOccurs="0" maxOccurs="1"/>
<xs:element name="expose-token" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="ssl-required" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="confidential-port" type="xs:integer" minOccurs="0" maxOccurs="1" />
<xs:element name="realm-public-key" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="credential" type="credential-type" minOccurs="0" maxOccurs="1"/>
<xs:element name="redirect-rewrite-rule" type="redirect-rewrite-rule-type" minOccurs="0" maxOccurs="1"/>
@@ -51,6 +51,7 @@ public class SubsystemParsingTestCase extends AbstractSubsystemBaseTest {
node.get("auth-url").set("http://localhost:8080/auth-server/rest/realms/demo/protocol/openid-connect/login");
node.get("code-url").set("http://localhost:8080/auth-server/rest/realms/demo/protocol/openid-connect/access/codes");
node.get("ssl-required").set("external");
node.get("confidential-port").set(443);
node.get("expose-token").set(true);
ModelNode jwtCredential = new ModelNode();
@@ -22,6 +22,7 @@
<truststore>truststore.jks</truststore>
<truststore-password>secret</truststore-password>
<ssl-required>EXTERNAL</ssl-required>
<confidential-port>443</confidential-port>
<allow-any-hostname>false</allow-any-hostname>
<disable-trust-manager>true</disable-trust-manager>
<connection-pool-size>20</connection-pool-size>
@@ -56,6 +57,7 @@
</realm-public-key>
<auth-server-url>http://localhost:8080/auth</auth-server-url>
<ssl-required>EXTERNAL</ssl-required>
<confidential-port>443</confidential-port>
<credential name="secret">0aa31d98-e0aa-404c-b6e0-e771dba1e798</credential>
<redirect-rewrite-rule name="^/wsmaster/api/(.*)$">api/$1/</redirect-rewrite-rule>
</secure-deployment>
@@ -84,5 +86,7 @@
<realm>jboss-infra</realm>
<resource>wildfly-console</resource>
<public-client>true</public-client>
<ssl-required>EXTERNAL</ssl-required>
<confidential-port>443</confidential-port>
</secure-server>
</subsystem>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<name>Keycloak Adapters</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-eap-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -16,7 +16,6 @@
*/
package org.keycloak.subsystem.saml.as7;
/**
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
*/
@@ -46,6 +45,8 @@ public class Constants {
static final String SIGN_REQUEST = "signRequest";
static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature";
static final String VALIDATE_ASSERTION_SIGNATURE = "validateAssertionSignature";
static final String ASSERTION_CONSUMER_SERVICE_URL = "assertionConsumerServiceUrl";
static final String REQUEST_BINDING = "requestBinding";
static final String BINDING_URL = "bindingUrl";
static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature";
@@ -69,7 +70,6 @@ public class Constants {
static final String SIGNATURES_REQUIRED = "signaturesRequired";
}
static class XML {
static final String SECURE_DEPLOYMENT = "secure-deployment";
static final String SERVICE_PROVIDER = "SP";
@@ -122,5 +122,6 @@ public class Constants {
static final String ALIAS = "alias";
static final String FILE = "file";
static final String SIGNATURES_REQUIRED = "signaturesRequired";
static final String ASSERTION_CONSUMER_SERVICE_URL = "assertionConsumerServiceUrl";
}
}
@@ -56,8 +56,13 @@ abstract class SingleSignOnDefinition {
new SimpleAttributeDefinitionBuilder(Constants.Model.BINDING_URL, ModelType.STRING, true)
.setXmlName(Constants.XML.BINDING_URL)
.build();
static final SimpleAttributeDefinition ASSERTION_CONSUMER_SERVICE_URL =
new SimpleAttributeDefinitionBuilder(Constants.Model.ASSERTION_CONSUMER_SERVICE_URL, ModelType.STRING, true)
.setXmlName(Constants.XML.ASSERTION_CONSUMER_SERVICE_URL)
.build();
static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGN_REQUEST, VALIDATE_RESPONSE_SIGNATURE, VALIDATE_ASSERTION_SIGNATURE, REQUEST_BINDING, RESPONSE_BINDING, BINDING_URL};
static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGN_REQUEST, VALIDATE_RESPONSE_SIGNATURE, VALIDATE_ASSERTION_SIGNATURE, REQUEST_BINDING, RESPONSE_BINDING, BINDING_URL, ASSERTION_CONSUMER_SERVICE_URL};
static final HashMap<String, SimpleAttributeDefinition> ATTRIBUTE_MAP = new HashMap<>();
@@ -71,6 +71,7 @@ keycloak-saml.IDP.SingleSignOnService.validateAssertionSignature=Validate an SSO
keycloak-saml.IDP.SingleSignOnService.requestBinding=HTTP method to use for requests
keycloak-saml.IDP.SingleSignOnService.responseBinding=HTTP method to use for responses
keycloak-saml.IDP.SingleSignOnService.bindingUrl=SSO endpoint URL
keycloak-saml.IDP.SingleSignOnService.assertionConsumerServiceUrl=Endpoint of Assertion Consumer Service at SP
keycloak-saml.IDP.SingleLogoutService=Single logout configuration
keycloak-saml.IDP.SingleLogoutService.validateRequestSignature=Validate a SingleLogoutService request signature
keycloak-saml.IDP.SingleLogoutService.validateResponseSignature=Validate a SingleLogoutService response signature
@@ -152,6 +152,11 @@
<xs:documentation>SSO endpoint URL</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="assertionConsumerServiceUrl" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Endpoint of Assertion Consumer Service at SP</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="single-logout-type">
<xs:attribute name="validateRequestSignature" type="xs:boolean" use="optional">
@@ -44,7 +44,8 @@
validateResponseSignature="true"
validateAssertionSignature="true"
requestBinding="POST"
bindingUrl="http://localhost:8080/auth/realms/saml-demo/protocol/saml"/>
bindingUrl="http://localhost:8080/auth/realms/saml-demo/protocol/saml"
assertionConsumerServiceUrl="acsUrl"/>
<SingleLogoutService
validateRequestSignature="true"
validateResponseSignature="true"
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -56,6 +56,8 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.apache.http.client.params.ClientPNames;
import org.apache.http.client.params.CookiePolicy;
/**
* Abstraction for creating HttpClients. Allows SSL configuration.
@@ -288,6 +290,7 @@ public class HttpClientBuilder {
cm = new SingleClientConnManager(registry);
}
BasicHttpParams params = new BasicHttpParams();
params.setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY);
if (proxyHost != null) {
params.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxyHost);
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak SAML Jetty Integration</name>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<name>Keycloak SAML Client Adapter Modules</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak SAML Tomcat Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -103,9 +103,10 @@ class ElytronHttpFacade implements HttpFacade {
if (anonymousAuthorizationCallback.isAuthorized()) {
callbackHandler.handle(new Callback[]{AuthenticationCompleteCallback.SUCCEEDED, new SecurityIdentityCallback()});
request.authenticationComplete(response -> response.forward(getRequest().getRelativePath()));
} else {
request.noAuthenticationInProgress(response -> response.forward(getRequest().getRelativePath()));
}
request.authenticationComplete(response -> response.forward(getRequest().getRelativePath()));
} catch (Exception e) {
throw new RuntimeException("Unexpected error processing callbacks during logout.", e);
}
@@ -49,46 +49,50 @@ public class KeycloakConfigurationServletListener implements ServletContextListe
protected static Logger log = Logger.getLogger(KeycloakConfigurationServletListener.class);
static final String ADAPTER_DEPLOYMENT_CONTEXT_ATTRIBUTE = AdapterDeploymentContext.class.getName() + ".elytron";
static final String ADAPTER_DEPLOYMENT_CONTEXT_ATTRIBUTE = SamlDeploymentContext.class.getName() + ".elytron";
@Override
public void contextInitialized(ServletContextEvent sce) {
ServletContext servletContext = sce.getServletContext();
String configResolverClass = servletContext.getInitParameter("keycloak.config.resolver");
SamlDeploymentContext deploymentContext = null;
if (configResolverClass != null) {
try {
throw new RuntimeException("Not implemented yet");
//configResolver = (SamlConfigResolver) deploymentInfo.getClassLoader().loadClass(configResolverClass).newInstance();
//deploymentContext = new AdapterDeploymentContext(configResolver);
//log.info("Using " + configResolverClass + " to resolve Keycloak configuration on a per-request basis.");
} catch (Exception ex) {
log.warn("The specified resolver " + configResolverClass + " could NOT be loaded. Keycloak is unconfigured and will deny all requests. Reason: " + ex.getMessage());
//deploymentContext = new AdapterDeploymentContext(new KeycloakDeployment());
}
} else {
InputStream is = getConfigInputStream(servletContext);
final SamlDeployment deployment;
if (is == null) {
log.warn("No adapter configuration. Keycloak is unconfigured and will deny all requests.");
deployment = new DefaultSamlDeployment();
} else {
SamlDeploymentContext deploymentContext = (SamlDeploymentContext) servletContext.getAttribute(SamlDeployment.class.getName());
if (deploymentContext == null) {
if (configResolverClass != null) {
try {
ResourceLoader loader = new ResourceLoader() {
@Override
public InputStream getResourceAsStream(String resource) {
return servletContext.getResourceAsStream(resource);
}
};
deployment = new DeploymentBuilder().build(is, loader);
} catch (ParsingException e) {
throw new RuntimeException(e);
throw new RuntimeException("Not implemented yet");
//configResolver = (SamlConfigResolver) deploymentInfo.getClassLoader().loadClass(configResolverClass).newInstance();
//deploymentContext = new AdapterDeploymentContext(configResolver);
//log.info("Using " + configResolverClass + " to resolve Keycloak configuration on a per-request basis.");
} catch (Exception ex) {
log.warn("The specified resolver " + configResolverClass + " could NOT be loaded. Keycloak is unconfigured and will deny all requests. Reason: " + ex.getMessage());
//deploymentContext = new AdapterDeploymentContext(new KeycloakDeployment());
}
} else {
InputStream is = getConfigInputStream(servletContext);
final SamlDeployment deployment;
if (is == null) {
log.warn("No adapter configuration. Keycloak is unconfigured and will deny all requests.");
deployment = new DefaultSamlDeployment();
} else {
try {
ResourceLoader loader = new ResourceLoader() {
@Override
public InputStream getResourceAsStream(String resource) {
return servletContext.getResourceAsStream(resource);
}
};
deployment = new DeploymentBuilder().build(is, loader);
} catch (ParsingException e) {
throw new RuntimeException(e);
}
}
deploymentContext = new SamlDeploymentContext(deployment);
log.debug("Keycloak is using a per-deployment configuration.");
}
deploymentContext = new SamlDeploymentContext(deployment);
servletContext.setAttribute(ADAPTER_DEPLOYMENT_CONTEXT_ATTRIBUTE, deploymentContext);
log.debug("Keycloak is using a per-deployment configuration.");
}
servletContext.setAttribute(ADAPTER_DEPLOYMENT_CONTEXT_ATTRIBUTE, deploymentContext);
}
@Override
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak SAML Wildfly Integration</name>
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>3.4.0.CR1</version>
<version>3.4.3.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>3.4.0.CR1</version>
<version>3.4.3.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
@@ -101,5 +101,10 @@
<artifactId>keycloak-saml-wildfly-adapter</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-saml-wildfly-elytron-adapter</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
@@ -46,6 +46,9 @@ public class Constants {
static final String SIGN_REQUEST = "signRequest";
static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature";
static final String VALIDATE_ASSERTION_SIGNATURE = "validateAssertionSignature";
static final String ASSERTION_CONSUMER_SERVICE_URL = "assertionConsumerServiceUrl";
static final String REQUEST_BINDING = "requestBinding";
static final String BINDING_URL = "bindingUrl";
static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature";
@@ -122,5 +125,8 @@ public class Constants {
static final String ALIAS = "alias";
static final String FILE = "file";
static final String SIGNATURES_REQUIRED = "signaturesRequired";
static final String ASSERTION_CONSUMER_SERVICE_URL = "assertionConsumerServiceUrl";
}
}
@@ -25,10 +25,12 @@ import org.jboss.as.web.common.WarMetaData;
import org.jboss.dmr.ModelNode;
import org.jboss.metadata.javaee.spec.ParamValueMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ListenerMetaData;
import org.jboss.metadata.web.spec.LoginConfigMetaData;
import org.jboss.staxmapper.FormattingXMLStreamWriter;
import org.jboss.staxmapper.XMLExtendedStreamWriter;
import org.keycloak.adapters.saml.AdapterConstants;
import org.keycloak.adapters.saml.elytron.KeycloakConfigurationServletListener;
import org.keycloak.subsystem.adapter.saml.extension.logging.KeycloakLogger;
import javax.xml.stream.XMLOutputFactory;
@@ -52,6 +54,8 @@ public class KeycloakAdapterConfigDeploymentProcessor implements DeploymentUnitP
if (Configuration.INSTANCE.getSecureDeployment(deploymentUnit) != null) {
addKeycloakSamlAuthData(phaseContext);
}
addConfigurationListener(deploymentUnit);
}
private void addKeycloakSamlAuthData(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
@@ -124,4 +128,30 @@ public class KeycloakAdapterConfigDeploymentProcessor implements DeploymentUnitP
public void undeploy(DeploymentUnit du) {
}
private void addConfigurationListener(DeploymentUnit deploymentUnit) {
WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY);
if (warMetaData == null) {
return;
}
JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData();
if (webMetaData == null) {
webMetaData = new JBossWebMetaData();
warMetaData.setMergedJBossWebMetaData(webMetaData);
}
LoginConfigMetaData loginConfig = webMetaData.getLoginConfig();
if (loginConfig == null) {
return;
}
if (!loginConfig.getAuthMethod().equals("KEYCLOAK-SAML")) {
return;
}
ListenerMetaData listenerMetaData = new ListenerMetaData();
listenerMetaData.setListenerClass(KeycloakConfigurationServletListener.class.getName());
webMetaData.getListeners().add(listenerMetaData);
}
}
Loaded 100 of 1603 files, more files were not shown because too many files have changed in this diff. Show more