Compare commits

...
240 Commits
Author SHA1 Message Date
keycloak-bot dd48b01d83 Set version to 2.2.0.Final 2016-09-15 07:02:09 +00:00
Pedro Igor f548c210e3 [KEYCLOAK-3534] - Fixing the logic to display the authz tab. 2016-09-15 08:58:29 +02:00
keycloak-bot 4569fb761d Set version to 2.2.0.Final-SNAPSHOT 2016-09-09 17:18:38 +00:00
keycloak-bot 930da93182 Set version to 2.2.0.CR1 2016-09-09 15:11:52 +00:00
Stian Thorgersen 05ae84d533 Added version for keycloak-fuse-adapter-dist 2016-09-09 17:08:38 +02:00
Stian Thorgersen 59674e44bf Update HackingOnKeycloak.md 2016-09-09 15:11:35 +02:00
Marek Posolda efaa88b4e3 Merge pull request #3222 from mposolda/master
KEYCLOAK-3547 Incorrect jpa-changelog-2.2.0.xml
2016-09-09 13:20:04 +02:00
Marek Posolda f55a526ebb Merge pull request #3223 from stianst/master
KEYCLOAK-3535 Tweak logging for SSSD
2016-09-09 13:19:51 +02:00
Stian Thorgersen ccb9433e5c KEYCLOAK-3535 Tweak logging for SSSD 2016-09-09 11:32:06 +02:00
mposolda 9d79a847c8 KEYCLOAK-3547 Incorrect jpa-changelog-2.2.0.xml 2016-09-09 09:47:32 +02:00
Stian Thorgersen 1630b9a20c Merge pull request #3220 from abstractj/KEYCLOAK-3535
KEYCLOAK-3535 - Check if SSSD is available via DBUS
2016-09-09 08:15:11 +02:00
Stian Thorgersen 65befb16fd Merge pull request #3219 from pedroigor/KEYCLOAK-3534
[KEYCLOAK-3534] - Authorization tab appears too soon in admin console
2016-09-09 08:14:03 +02:00
Stian Thorgersen e8f99a2109 Merge pull request #3221 from patriot1burke/master
KEYCLOAK-3423
2016-09-09 07:45:53 +02:00
Pedro Igor 7af16fc747 [KEYCLOAK-3534] - Authorization tab appears too soon in admin console 2016-09-09 01:03:09 -03:00
Bill Burke 84f5c0926b KEYCLOAK-3423 2016-09-08 16:47:06 -04:00
Bruno Oliveira 11245701d2 Check if SSSD is available via DBUS 2016-09-08 16:01:45 -03:00
Bill Burke 5c45c5e6e4 Merge pull request #3218 from patriot1burke/master
jta=false for demo-dist
2016-09-08 09:42:49 -04:00
Bill Burke 04ee5ca7c1 jta=false for demo-dist 2016-09-08 09:42:05 -04:00
Stian Thorgersen df5d37a8d9 Merge pull request #3215 from stianst/KEYCLOAK-3538
KEYCLOAK-3538 Update examples to refer to standalone.xml for config
2016-09-08 15:27:57 +02:00
Stian Thorgersen 55a86dc0f4 Merge pull request #3217 from vramik/KEYCLOAK-3545
KEYCLOAK-3545 remove jta=false from default datasource definition
2016-09-08 15:26:49 +02:00
Vlasta Ramik fa8f60a5f0 remove jta=false from default datasource definition 2016-09-08 15:25:17 +02:00
Bill Burke 2a5c778af5 Merge pull request #3209 from patriot1burke/master
KEYCLOAK-3440
2016-09-08 09:10:54 -04:00
Stian Thorgersen f24d73e8d6 KEYCLOAK-3538 Update examples to refer to standalone.xml for config 2016-09-08 14:04:12 +02:00
Stian Thorgersen 6d40e0dd07 Merge pull request #3212 from didiez/master
KEYCLOAK-3513 Prevent clearing all registered sessions when invalidating some by sessionId
2016-09-08 13:50:14 +02:00
Marek Posolda 529ef3a425 Merge pull request #3213 from mposolda/master
KEYCLOAK-3542 Not possible to enable bruteForceProtection for realm
2016-09-08 13:41:18 +02:00
Stian Thorgersen 36bb94afb8 Environment dependent provider 2016-09-08 07:40:19 -03:00
mposolda 4fd0238ca9 KEYCLOAK-3542 Not possible to enable bruteForceProtection for realm 2016-09-08 12:30:38 +02:00
Marek Posolda 76e1160b36 Merge pull request #3210 from mposolda/master
KEYCLOAK-3537 Username not shown when validation error on Account pro…
2016-09-08 10:04:38 +02:00
didiez df3079852e Prevent clearing all registered sessions when invalidating some by sessionId 2016-09-08 09:19:30 +02:00
Stian Thorgersen 71b648a9b6 Merge pull request #3183 from mohitsuman/KEYCLOAK-3502
Keycloak 3502 - Implement "Empty State" for Identity Providers in Admin Console
2016-09-08 08:53:06 +02:00
Stian Thorgersen ab7bb21991 Merge pull request #3160 from ramunask/feature-lithuanian-locale
KEYCLOAK-3452 add Lithuanian localization
2016-09-08 08:44:45 +02:00
Stian Thorgersen 348e0b6226 Merge pull request #3200 from mbaluch/master
RHSSO-423 - Added default value for 'log-dir'. Set to ${project.build…
2016-09-08 08:42:54 +02:00
Stian Thorgersen 44b7210af7 Merge pull request #3203 from mhajas/eap6fix
KEYCLOAK-3533 Fix forbidden page on eap6
2016-09-08 08:41:52 +02:00
Stian Thorgersen f726caea9b Merge pull request #3205 from stianst/KEYCLOAK-3342
KEYCLOAK-3342 Add Identity Provider authenticator
2016-09-08 08:40:32 +02:00
mposolda 16282aeb7b KEYCLOAK-3537 Username not shown when validation error on Account profile page 2016-09-08 08:36:39 +02:00
Stian Thorgersen d2c546bdc2 Merge pull request #3201 from pedroigor/KEYCLOAK-3129
[KEYCLOAK-3129] - Add authorization services endpoints to PermissionsTest
2016-09-08 08:03:40 +02:00
Stian Thorgersen 1f27fc9e4b Merge pull request #3153 from cargosoft/KEYCLOAK-3327
KEYCLOAK-3327 Make realm attributes accessible via the RealmModel
2016-09-08 08:00:14 +02:00
Stian Thorgersen 7c292b1213 KEYCLOAK-3342 Add Identity Provider authenticator 2016-09-08 07:20:35 +02:00
Bill Burke 3b9a6b32e1 Revert "Revert "KEYCLOAK-3440""
This reverts commit 01e48dc4b8.
2016-09-07 23:41:32 -04:00
Bill Burke b0bb0d36ab Merge remote-tracking branch 'upstream/master' 2016-09-07 23:19:45 -04:00
Bill Burke cdda19d1f8 pom.xml 2016-09-07 23:19:16 -04:00
Bill Burke 759747ab5c Merge pull request #3208 from keycloak/revert-3207-master
Revert "KEYCLOAK-3440"
2016-09-07 23:17:52 -04:00
Bill Burke 01e48dc4b8 Revert "KEYCLOAK-3440" 2016-09-07 23:17:35 -04:00
Bill Burke 61b93c318f Merge pull request #3207 from patriot1burke/master
KEYCLOAK-3440
2016-09-07 23:15:44 -04:00
Bill Burke 3f35234cf5 Merge remote-tracking branch 'upstream/master' 2016-09-07 23:11:38 -04:00
Bill Burke da135389c7 KEYCLOAK-3440 2016-09-07 23:11:28 -04:00
Marek Posolda b3d7d48ec8 Merge pull request #3206 from mposolda/master
KEYCLOAK-3494 Input elements backed by user attributes fail to update…
2016-09-07 22:02:38 +02:00
mposolda 5a015a6518 KEYCLOAK-3494 Input elements backed by user attributes fail to update in themes 2016-09-07 20:08:09 +02:00
Stian Thorgersen 7912bd4dae Merge pull request #3195 from abstractj/KEYCLOAK-3036
Initial FreeIPA Integration
2016-09-07 12:45:35 +02:00
mhajas c860d03a60 Fix forbidden page on eap6 2016-09-07 09:02:46 +02:00
Bruno Oliveira 1b2a5eda32 Initial FreeIPA Integration
- Provide username/password authentication with PAM
  - Obtain user data from SSSD
  - Feature packs for dbus-java, libpam4j and SSSD API
  - Provisioning script
2016-09-06 18:04:43 -03:00
Pedro Igor 517413d38e [KEYCLOAK-3129] - Add authorization services endpoints to PermissionsTest 2016-09-06 17:32:37 -03:00
Marek Baluch fd25dbcb5c RHSSO-423 - Added default value for 'log-dir'. Set to ${project.build.dir}/surefire-reports 2016-09-06 18:16:15 +02:00
Mohit Suman bdbc4e1f6d add margin and update the description text 2016-09-06 19:34:07 +05:30
Stian Thorgersen eebd496c2f Merge pull request #3199 from stianst/KEYCLOAK-3475
KEYCLOAK-3475 Fixes for on token expired event
2016-09-06 15:36:46 +02:00
Bill Burke 15d31a202f Merge remote-tracking branch 'upstream/master' 2016-09-06 08:56:17 -04:00
Bill Burke 6714c1a136 cred refactor 2016-09-06 08:55:47 -04:00
Ramūnas Kraujutis ca6d1f3c48 LT locale improvements 2016-09-06 14:58:09 +03:00
Ramūnas Kraujutis c5a149a892 Merge remote-tracking branch 'upstream/master' into feature-lithuanian-locale 2016-09-06 14:50:07 +03:00
Stian Thorgersen b33648cc29 Merge pull request #3191 from greg0ire/patch-1
Remove duplicate untranslated word
2016-09-06 13:42:32 +02:00
Stian Thorgersen 4a583712b8 Merge pull request #3182 from mohitsuman/KEYCLOAK-2706
Fixed dropdown menu in navigation bar in small screens
2016-09-06 13:16:38 +02:00
Stian Thorgersen 5d20651c66 KEYCLOAK-3475 Fixes for on token expired event 2016-09-06 13:00:37 +02:00
Stian Thorgersen a49a288bbe Merge pull request #3197 from stianst/KEYCLOAK-3475
KEYCLOAK-3475 Call event handlers when initialized with tokens
2016-09-06 11:32:03 +02:00
Marek Posolda fbace351b3 Merge pull request #3198 from mposolda/master
Fuse adapter ZIP download
2016-09-06 10:47:48 +02:00
mposolda fbb2dfcf59 Fuse adapter ZIP download 2016-09-06 10:46:36 +02:00
Ramūnas Kraujutis 05813832fc add newly added translations to Lithuanian locale files 2016-09-06 10:53:23 +03:00
Ramūnas Kraujutis e67f8c7a61 Merge branch 'master-upstream' into feature-lithuanian-locale
# Conflicts:
#	themes/src/main/resources/theme/base/account/messages/messages_en.properties
#	themes/src/main/resources/theme/base/account/theme.properties
#	themes/src/main/resources/theme/base/admin/theme.properties
#	themes/src/main/resources/theme/base/email/theme.properties
#	themes/src/main/resources/theme/base/login/theme.properties
2016-09-06 10:51:01 +03:00
Stian Thorgersen 7a66b055be KEYCLOAK-3475 Call event handlers when initialized with tokens 2016-09-06 09:00:29 +02:00
Marek Posolda e3ddc5a639 Merge pull request #3194 from mposolda/master
KEYCLOAK-3525 Validation callback when creating/updating protocolMapper
2016-09-06 08:24:26 +02:00
mposolda 8c5b1e4892 KEYCLOAK-3525 Validation callback when creating/updating protocolMapper 2016-09-06 07:15:27 +02:00
Marek Posolda ad1d3adb9e Merge pull request #3196 from mposolda/fuse-zip
KEYCLOAK-3526 Fuse adapter ZIP fix
2016-09-06 07:14:51 +02:00
mposolda e18f3edbcd KEYCLOAK-3526 Fuse adapter ZIP fix 2016-09-06 07:14:01 +02:00
Marek Posolda 6ede760725 Merge pull request #3083 from martin-kanis/master
Package Fuse adapter as overlay zip
2016-09-06 05:44:27 +02:00
Marek Posolda db0f05fb86 Merge pull request #3192 from mposolda/master
KEYCLOAK-2957 IdpEmailVerificationAuthenticator should setEmailVerifi…
2016-09-05 23:03:03 +02:00
mposolda 03c05bd72b KEYCLOAK-2957 IdpEmailVerificationAuthenticator should setEmailVerified to true after successfuly link user by email verification 2016-09-05 18:04:24 +02:00
Grégoire Paris c867fcf9e7 Remove duplicate untranslated word 2016-09-05 17:12:21 +02:00
Stian Thorgersen 22e85b11eb Merge pull request #3190 from vramik/KEYCLOAK-3489
KEYCLOAK-3489 Database migration testing
2016-09-05 15:19:24 +02:00
Vlasta Ramik 39fe439573 Database migration testing 2016-09-05 13:39:21 +02:00
Stian Thorgersen fc6b7ea8ee Enabled Norwegian translation 2016-09-05 09:45:44 +02:00
Stian Thorgersen 0e1edb3d7a Merge pull request #3170 from TeliaSoneraNorge/issue/KEYCLOAK-3487-add-norwegian-localization
Add Norwegian localization
2016-09-05 09:42:44 +02:00
Stian Thorgersen 7a77055e58 Merge pull request #3180 from mbaluch/master
A class to generate a single jUnit XML file. This file will be co…
2016-09-05 09:37:33 +02:00
Stian Thorgersen d9e95455a2 Merge pull request #3172 from mwcz/js-updateToken-withCredentials
send cookies along with keycloak.updateToken()
2016-09-05 09:37:00 +02:00
Stian Thorgersen f5b4efc080 Merge pull request #3131 from abstractj/removal-changeset
Removal of never used classes from the changeset package
2016-09-05 09:35:08 +02:00
Stian Thorgersen b1a233e41f Merge branch 'feature-fix-time-selector' of https://github.com/ramunask/keycloak into ramunask-feature-fix-time-selector 2016-09-05 09:32:11 +02:00
Stian Thorgersen 4d6e656b02 Merge pull request #3150 from stoffus/bug-fix-in-reset-password-tpl
KEYCLOAK-3441 Respect registrationEmailAsUsername in reset-password template
2016-09-05 09:10:49 +02:00
Stian Thorgersen 3354e7c98e Merge pull request #3148 from wadahiro/KEYCLOAK-3435
KEYCLOAK-3435 Fix some minor issues in the Admin Console UI
2016-09-05 09:09:30 +02:00
Ramunas Kraujutis 05fe17be4f merge latest English messages 2016-09-04 22:20:30 +03:00
Ramunas Kraujutis 2e9f14dfd8 Merge branch 'master-upstream' into feature-lithuanian-locale
# Conflicts:
#	themes/src/main/resources/theme/base/account/messages/messages_en.properties
#	themes/src/main/resources/theme/base/account/theme.properties
#	themes/src/main/resources/theme/base/admin/theme.properties
#	themes/src/main/resources/theme/base/email/theme.properties
#	themes/src/main/resources/theme/base/login/theme.properties
2016-09-04 22:20:03 +03:00
Marek Posolda 404aa69adb Merge pull request #3187 from mposolda/master
KEYCLOAK-3349 Support for 'request' and 'request_uri' parameters
2016-09-02 21:58:25 +02:00
mposolda a24a43c4be KEYCLOAK-3349 Support for 'request' and 'request_uri' parameters 2016-09-02 20:20:38 +02:00
mposolda 892d5fd1b7 TestingExportImport in separate resource 2016-09-02 20:20:38 +02:00
Stian Thorgersen 258f7c8d60 Merge pull request #3176 from stianst/KEYCLOAK-3501
KEYCLOAK-3501 Fix NPE in migration of OTP action
2016-09-02 10:11:33 +02:00
Mohit Suman b17bd9e660 Fixed dropdown menu in navigation bar in small screens 2016-09-02 01:37:10 +05:30
Pedro Igor 43d23835d0 Merge pull request #3179 from pedroigor/KEYCLOAK-3472
[KEYCLOAK-3472] - Multiple paths with the same name and tests
2016-09-01 10:00:33 -03:00
Mohit Suman d11efa363c Dropdown alignment with the empty state 2016-09-01 16:02:34 +05:30
Mohit Suman 8f0afb2551 Add empty state for Identitiy Provider in admin console 2016-09-01 15:36:17 +05:30
Marek Baluch c874f96228 A class which generates a single junit xml file. This file will be consumed by Polarion 2016-09-01 10:18:06 +02:00
Pedro Igor ce78cc1d1c [KEYCLOAK-3472] - Multiple paths with the same name and tests 2016-08-31 21:04:36 -03:00
Marek Posolda 599c69a2a3 Merge pull request #3177 from vmuzikar/KEYCLOAK-3421
KEYCLOAK-3421 Validation for URI fragments in redirect_uri
2016-08-31 19:39:28 +02:00
Pedro Igor 9daced953e Merge pull request #3157 from ramunask/feature-fix-en-translation
KEYCLOAK-3463 fixed translation for authz-policy-decision-strategy.tooltip
2016-08-31 09:18:31 -03:00
Vaclav Muzikar 1b085d3e13 KEYCLOAK-3421 Validation for URI fragments in redirect_uri 2016-08-31 13:07:33 +02:00
Stian Thorgersen 1bea93b1e1 KEYCLOAK-3501 Fix NPE in migration of OTP action 2016-08-31 12:05:49 +02:00
Pedro Igor 16bd2fb8f8 Merge pull request #3175 from pedroigor/KEYCLOAK-3337
[KEYCLOAK-3337] - Support more specific date/time periods with the Time policy provider
2016-08-30 18:16:09 -03:00
Marek Posolda e8efe10fc8 Merge pull request #3174 from mposolda/master
KEYCLOAK-3416 Add support for signed Userinfo requests
2016-08-30 22:18:09 +02:00
Pedro Igor 73bcfba5f3 [KEYCLOAK-3337] - Support more specific date/time periods with the Time policy provider 2016-08-30 16:32:00 -03:00
mposolda 02f28a7e8e KEYCLOAK-3416 Add support for signed Userinfo requests 2016-08-30 20:21:04 +02:00
Stian Thorgersen 5a4bb5f3f0 Merge pull request #3168 from stianst/master
KEYCLOAK-3462 Fix exception not displayed in init from KeycloakServer
2016-08-30 09:47:31 +02:00
Marek Posolda 235623301e Merge pull request #3171 from mposolda/master
KEYCLOAK-3424
2016-08-29 16:24:54 +02:00
mposolda f4aee129e4 KEYCLOAK-3424 Issuer or token-endpoint as audience in signed JWT 2016-08-29 14:43:35 +02:00
mposolda a7f9a6e095 KEYCLOAK-3424 Support for import from public key 2016-08-29 14:43:29 +02:00
Caroline Olsen 539d9863aa Add Norwegian localization
KEYCLOAK-3487
2016-08-29 11:01:50 +02:00
Stian Thorgersen 4f51b7b34c KEYCLOAK-3462 Fix exception not displayed in init from KeycloakServer 2016-08-29 09:21:22 +02:00
Stian Thorgersen 0e5af3710e Merge pull request #3166 from ssilvert/dmr-config-dev-doc
KEYCLOAK-3196: Update dev doc for keycloak subsystem configuration.
2016-08-29 08:12:28 +02:00
Stan Silvert a462dd78bb Update dev doc for keycloak subsystem configuration. 2016-08-26 16:40:34 -04:00
mwcz ec5289b5c8 send cookies along with keycloak.updateToken() 2016-08-26 11:23:44 -04:00
Stian Thorgersen 2a29f2a9c6 Merge pull request #3151 from ssilvert/dmr-server-config
KEYCLOAK-3196: Use WildFly management model for server configuration.
2016-08-26 13:44:45 +02:00
Stian Thorgersen 9ffd6548ce Merge pull request #3146 from mhajas/KEYCLOAK-3161
KEYCLOAK-3161 Migrate SAML adapter tests
2016-08-26 13:40:58 +02:00
Stian Thorgersen cfd41fbc8b Merge pull request #3165 from StephenOTT/patch-1
typo fixes in Readme files
2016-08-26 13:40:12 +02:00
Stian Thorgersen 4c2cca4672 Merge pull request #3118 from wadahiro/issue/KEYCLOAK-3397-add-japanese-localization
KEYCLOAK-3397 Add Japanese localization
2016-08-26 11:38:03 +02:00
Hiroyuki Wada 53557d9cfd KEYCLOAK-3397 Fix Japanese translation 2016-08-26 10:46:45 +09:00
Stan Silvert a0054bd77f Merge pull request #1 from vramik/KEYCLOAK-3459
KEYCLOAK-3459 Adapt testsuite according to server configuration insid…
2016-08-25 07:21:34 -04:00
Vlasta Ramik 099de9e6e3 KEYCLOAK-3459 Adapt testsuite according to server configuration inside standalone.xml instead of keycloak-server.json 2016-08-25 12:36:39 +02:00
Stephen Russett cfd61dc359 typo fix in google example readme 2016-08-24 23:45:52 -04:00
Stephen Russett 99f453b25c typo fix 2016-08-24 23:40:21 -04:00
Marek Posolda d138b19adb Merge pull request #3142 from vmuzikar/KEYCLOAK-3429
KEYCLOAK-3429 Fix behaviour of redirect_uri parameter with query components
2016-08-24 09:53:29 +02:00
Stan Silvert 345163994a KEYCLOAK-3196: Allow expressions in SPI properties. 2016-08-23 13:02:11 -04:00
Stan Silvert 09090cec24 KEYCLOAK-3196: Resolve conflicts. Port keycloak-server.json changes to xml
and cli
2016-08-23 11:56:21 -04:00
Stan Silvert 3abcf713e5 KEYCLOAK-3196: Test need ability to load keycloak-server.json from
/META-INF
2016-08-23 11:27:06 -04:00
Stan Silvert e4d97485ec KEYCLOAK-3196: Create master cli script for server-subsystem. 2016-08-23 11:27:04 -04:00
Stan Silvert 1489bd734a KEYCLOAK-3196: Add CLI help text. 2016-08-23 11:27:01 -04:00
Stan Silvert ef442cae92 KEYCLOAK-3196: Create single place to declare default keycloak subsystem
config.
2016-08-23 11:26:58 -04:00
Stan Silvert 3493aa4ab7 KEYCLOAK-3196: Use WildFly management model for server configuration. 2016-08-23 11:26:56 -04:00
Marek Posolda 3be47dee37 Merge pull request #3162 from mposolda/master
KEYCLOAK-3460 Support for ClientUpdatedEvent
2016-08-23 16:35:14 +02:00
mposolda 494d9973a6 KEYCLOAK-3460 Support for ClientUpdatedEvent 2016-08-23 14:57:31 +02:00
Stian Thorgersen e28a3750cd Merge pull request #3149 from vmuzikar/KEYCLOAK-3437
KEYCLOAK-3437 Add User Federation Console UI test
2016-08-23 12:57:02 +02:00
Stian Thorgersen 014c8e068f Merge pull request #3156 from vmuzikar/KEYCLOAK-3448
KEYCLOAK-3448 Stabilize Internationalization UI Test
2016-08-23 12:55:53 +02:00
Stian Thorgersen 3890867383 Merge pull request #3133 from fkiss/master-email-ibmjdk
KEYCLOAK-3351 TrustStoreEmailTest fix for ibmjdk
2016-08-23 12:54:12 +02:00
Stian Thorgersen d499b8a489 Merge pull request #3159 from stianst/master
KEYCLOAK-3447 Manual upgrade of database schema
2016-08-23 12:38:28 +02:00
Ramunas Kraujutis 352602da39 change lt locale position to be ordered alphabetically 2016-08-22 19:12:03 +03:00
Ramunas Kraujutis c333d1eaa9 change lt locale position to be ordered alphabetically 2016-08-22 19:10:20 +03:00
Stian Thorgersen c522a20ab9 KEYCLOAK-3447 Manual upgrade of database schema 2016-08-22 10:22:08 +02:00
Ramunas Kraujutis ee66cb51da adding Lithuanian translation 2016-08-21 16:14:22 +03:00
Ramunas Kraujutis 93d65fa895 fix select options and add values to fix issues when non-English locale is used with translated values 2016-08-21 16:09:18 +03:00
Ramunas Kraujutis 6aafde7819 fixed translation for authz-policy-decision-strategy.tooltip changing "policy" to "permission" 2016-08-21 16:04:51 +03:00
Vaclav Muzikar 365a1b66c8 KEYCLOAK-3448 Stabilize Internationalization UI Test 2016-08-19 11:40:01 +02:00
Pedro Igor fa1fb3a3a9 Merge pull request #3152 from pedroigor/KEYCLOAK-3377
[KEYCLOAK-3377] - Add pagination to authorization UI
2016-08-18 19:43:34 -03:00
Dimitri Teleguin b109ce14b0 KEYCLOAK-3327 Make realm attributes accessible via the RealmModel 2016-08-18 23:28:32 +03:00
Bill Burke 561661d726 Merge remote-tracking branch 'upstream/master' 2016-08-18 13:13:28 -04:00
Bill Burke 6592014707 Update users.js 2016-08-18 13:13:08 -04:00
Pedro Igor 4cd0a8e894 [KEYCLOAK-3377] - Add pagination to authorization UI 2016-08-18 13:29:54 -03:00
Bill Burke 6c44e9befa Merge remote-tracking branch 'upstream/master' 2016-08-18 11:57:25 -04:00
Bill Burke 8e9cfc4a28 creds 2016-08-18 11:52:00 -04:00
Christopher Svensson d20d5ce2d7 Bug fix: Respect registrationEmailAsUsername in reset-password template. 2016-08-18 10:24:37 +02:00
Christopher Svensson 243c8cc2cd Merge remote-tracking branch 'keycloak/master' 2016-08-18 10:19:27 +02:00
Stian Thorgersen 7d444c8b13 Merge pull request #3147 from stianst/master
Tweak Travis
2016-08-17 08:08:13 +02:00
Vaclav Muzikar be83e2fb6b KEYCLOAK-3437 Add User Federation Console UI test 2016-08-16 15:47:02 +02:00
Hiroyuki Wada b34acd4cc2 KEYCLOAK-3397 Add Japanese localization 2016-08-16 20:44:47 +09:00
Hiroyuki Wada 85ac784fd0 KEYCLOAK-3435 Fix some minor issues in the Admin Console UI 2016-08-16 20:34:48 +09:00
Stian Thorgersen ab2368be34 Tweak Travis 2016-08-16 07:49:17 +02:00
Pedro Igor ba076ad159 Merge pull request #3144 from pedroigor/KEYCLOAK-3144
[KEYCLOAK-3144] - Add authorization settings when exporting/importing a realm
2016-08-15 11:49:49 -03:00
Pedro Igor a8d2b810cf [KEYCLOAK-3144] - Add authorization settings when exporting/importing a realm. 2016-08-15 10:35:28 -03:00
mhajas 285a99d903 Migrate SAML adapter tests 2016-08-13 11:09:48 +02:00
Pedro Igor fd983690e2 Merge pull request #3140 from pedroigor/KEYCLOAK-3390
[KEYCLOAK-3390] - Updating authorization objects doesn't invalidate cache in cluster
2016-08-12 12:45:20 -03:00
Marek Posolda 006a0f856e Merge pull request #3143 from mposolda/oidc-dynamic2
KEYCLOAK-3424 Support for save JWKS in OIDC ClientRegistration endpoint
2016-08-12 17:33:07 +02:00
Pedro Igor bfe10e34e7 [KEYCLOAK-3390] - Updating authorization objects doesn't invalidate cache in cluster 2016-08-12 11:15:13 -03:00
mposolda 2cba13db9c KEYCLOAK-3424 Possibility to import JWK key through admin console 2016-08-12 15:51:14 +02:00
mposolda 3eb9134e02 KEYCLOAK-3424 Support for save JWKS in OIDC ClientRegistration endpoint 2016-08-12 15:51:14 +02:00
Vaclav Muzikar b7f2e0b5ff KEYCLOAK-3429 Fix behaviour of redirect_uri parameter with query components 2016-08-12 14:02:17 +02:00
Pedro Igor 27187c11f1 Merge pull request #3138 from pedroigor/KEYCLOAK-3428
[KEYCLOAK-3428] - Removing scope policies in case the resource does not match
2016-08-11 14:59:20 -03:00
Pedro Igor 0030df060b [KEYCLOAK-3428] - Removing scope policies in case the resource does not match 2016-08-11 14:58:14 -03:00
Marek Posolda f6f587e472 Merge pull request #3137 from thomasdarimont/issue/KEYCLOAK-3412-remove-unused-adminEventBuilder-error-method
KEYCLOAK-3412 - Remove erroneous AdminEventBuilder.error method
2016-08-11 17:41:04 +02:00
Marek Posolda 841c6b619a Merge pull request #3136 from mposolda/oidc-dynamic2
OIDC dynamic client registrations from conformance testsuite
2016-08-11 17:16:11 +02:00
Thomas Darimont e0d70a35d6 KEYCLOAK-3412 - Remove erroneous AdminEventBuilder.error method
Wasn't used within the Keycloak codebase and wouldn't have worked either
since the OperationType lookup would always fail since there are no
"_ERROR" operation types.

Signed-off-by: Thomas Darimont <thomas.darimont@gmail.com>
2016-08-11 16:10:49 +02:00
mposolda 0520d465c1 KEYCLOAK-3414 Support for client registration from trusted hosts 2016-08-11 15:55:32 +02:00
mposolda a8fb988e31 KEYCLOAK-3406 OIDC dynamic client registrations specs fixes 2016-08-11 15:54:51 +02:00
Marek Posolda c34d175572 Merge pull request #3135 from mposolda/master
Fix ExportImportTest
2016-08-11 15:53:16 +02:00
mposolda 9c7442c75b Fix ExportImportTest 2016-08-11 15:51:56 +02:00
fkiss de888fc8a1 KEYCLOAK-3351 TrustStoreEmailTest fix for ibmjdk 2016-08-11 10:52:29 +02:00
Bruno Oliveira 4d8e19eb7c Removal of never used classes from the changeset package 2016-08-10 17:28:38 -03:00
Marek Posolda 2df7d6252e Merge pull request #3128 from mposolda/master
Set version to 2.2.0-SNAPSHOT
2016-08-10 09:02:13 +02:00
mposolda d52e043322 Set version to 2.2.0-SNAPSHOT 2016-08-10 08:57:18 +02:00
Marek Posolda 6c8d55d534 Merge pull request #3125 from thomasdarimont/issue/KEYCLOAK-3391-hide-service-account-roles-if-service-accounts-disabled
KEYCLOAK-3391 Better control over service account roles tab visibility
2016-08-10 08:16:27 +02:00
Marek Posolda 26bc07b2c4 Merge pull request #3126 from pedroigor/KEYCLOAK-3398
[KEYCLOAK-3398] - Review input fields on AuthZ UI to fetch data on demand
2016-08-10 06:50:51 +02:00
Bill Burke 7f6fc170dc Merge pull request #3119 from fkiss/master-exportimport
KEYCLOAK-3211 - ExportImportTest fix for Wildfly
2016-08-09 20:59:04 -04:00
Bill Burke 741bbf471f Merge pull request #3123 from patriot1burke/master
components import/export
2016-08-09 20:58:20 -04:00
Pedro Igor 70eb27ec83 [KEYCLOAK-3398] - Review input fields on AuthZ UI to fetch data on demand 2016-08-09 21:56:29 -03:00
Thomas Darimont 96b729886f KEYCLOAK-3391 Better control of service account roles tab visibility
Previously the service account roles remain visible when changing
the client type from confidential to public or bearer only.

We now only show the service account roles tab iif:
- service accounts are enabled
- client access type is set to confidential
2016-08-10 00:44:14 +02:00
Bill Burke 530870f05e realm components import/export 2016-08-09 15:06:29 -04:00
Bill Burke 1633f062d5 Merge remote-tracking branch 'upstream/master' 2016-08-09 12:25:13 -04:00
Bill Burke ff703f935f component export/import 2016-08-09 12:25:04 -04:00
fkiss 4974079794 KEYCLOAK-3211 - ExportImportTest fix for Wildfly 2016-08-09 15:20:40 +02:00
Bill Burke d94515cdae Merge pull request #3117 from patriot1burke/master
deployer, jta lookup, merge user fed/storage
2016-08-08 17:46:35 -04:00
Bill Burke f838c697d1 Merge remote-tracking branch 'upstream/master' 2016-08-08 16:04:16 -04:00
Bill Burke d14de43ac7 merge User Federation/Storage menu 2016-08-08 16:02:06 -04:00
Marek Posolda e198e7e0b9 Merge pull request #3116 from mposolda/master
KEYCLOAK-3400 OIDC request with missing response_type should respond …
2016-08-08 21:50:08 +02:00
Bill Burke 83306963e8 jta transaction abstraction 2016-08-08 12:32:36 -04:00
mposolda 65e2f127c9 KEYCLOAK-3400 OIDC request with missing response_type should respond with error 2016-08-08 16:11:50 +02:00
Marek Posolda 64c2077c0b Merge pull request #3115 from mposolda/master
KEYCLOAK-2169 KEYCLOAK-3286 Support for at_hash and c_hash
2016-08-08 12:36:33 +02:00
mposolda 9be6777685 KEYCLOAK-2169 KEYCLOAK-3286 Support for at_hash and c_hash 2016-08-08 10:57:44 +02:00
Bill Burke f14f303dfe Merge remote-tracking branch 'upstream/master' 2016-08-07 11:50:44 -04:00
Bill Burke 33d7d89ad9 provider hot deployment 2016-08-07 11:41:52 -04:00
Marek Posolda 65c49c39f4 Merge pull request #3114 from mposolda/master
KEYCLOAK-3321 OIDC requests without 'nonce' claim should be rejected …
2016-08-05 16:45:56 +02:00
Marek Posolda 6c0f685c39 Merge pull request #2948 from thomasdarimont/issue/KEYCLOAK-3142-Add-ResourceType-to-AdminEvents
KEYCLOAK-3142 - Capture ResourceType that triggers an AdminEvent
2016-08-05 15:07:56 +02:00
mposolda e0a59baaf2 KEYCLOAK-3321 OIDC requests without 'nonce' claim should be rejected unless using the code flow. Started responseType tests 2016-08-05 15:05:26 +02:00
Marek Posolda 6a797a61a9 Merge pull request #3113 from vmuzikar/KEYCLOAK-3367
KEYCLOAK-3367 Improve stability of Adapters Tests
2016-08-05 09:44:52 +02:00
Thomas Darimont e49afb2d83 KEYCLOAK-3142 - Revised according to codereview
Liquibase Moved schema evolution configuration from jpa-changelog-2.1.0
to jpa-changelog-2.2.0.
Corrected wrong ResourceType references in tests.
Adapted AdminEvents copy-routines to be aware of resourceType attribute.
Added ResourceType enum to exposed ENUMS of ServerInfoAdminResource.

Signed-off-by: Thomas Darimont <thomas.darimont@gmail.com>
2016-08-05 00:01:03 +02:00
Vaclav Muzikar 0d225f44de KEYCLOAK-3367 Improve stability of Adapters Tests 2016-08-04 14:43:49 +02:00
Thomas Darimont 586f6eeece KEYCLOAK-3142 - Capture ResourceType that triggers an AdminEvent
Introduced new ResourceType enum for AdminEvents which lists
the current supported ResourceTypes for which AdminEvents
can be fired.

Previously it was difficult for custom EventListeners to figure
out which ResourceType triggered an AdminEvent in order
to handle it appropriately, effectively forcing users to parse
the representation.
Having dedicated resource types as a marker on an AdminEvent helps
to ease custom EventListener code.

We now also allow filtering of admin events by ResourceType in the
admin-console.

Signed-off-by: Thomas Darimont <thomas.darimont@gmail.com>
2016-08-04 11:30:02 +02:00
Bill Burke f91907c8f9 Merge pull request #3107 from thomasdarimont/issue/KEYCLOAK-3392-honor-web-context-for-odic-endpoint-link
KEYCLOAK-3392 Use authUrl prefix for OIDC Configuration link
2016-08-03 21:34:00 -04:00
Bill Burke 9e0667bc11 Merge pull request #3080 from trajakovic/issue/editAccountHtmlTtile
Fixing typo in account resource(s) bundle
2016-08-03 21:31:44 -04:00
Bill Burke a3ffb32532 Merge pull request #3060 from fkiss/master-ldaps
KEYCLOAK-2281 added ldap tests over ssl
2016-08-03 21:31:12 -04:00
Bill Burke 1e7cf9fb3f Merge pull request #3088 from thomasdarimont/issue/KEYCLOAK-3380-allow-ignore-pattern-in-filter
KEYCLOAK-3380 Allow to configure paths to skip in KeycloakOIDCFilter
2016-08-03 21:30:20 -04:00
Bill Burke f75c0d3e61 Merge pull request #3111 from patriot1burke/master
user storage provider jpa example
2016-08-03 21:27:30 -04:00
Bill Burke 534ee2e50c Merge remote-tracking branch 'upstream/master' 2016-08-03 19:16:45 -04:00
Bill Burke 70722d0d3d user storage provider jpa example 2016-08-03 19:16:11 -04:00
Marek Posolda 0292acd5e2 Merge pull request #3110 from mposolda/master
Master: Oracle & EAP7 overlay
2016-08-03 14:24:50 +02:00
mposolda bf3541414c KEYCLOAK-3393 Fix Keycloak on EAP7 overlay 2016-08-03 13:01:44 +02:00
mposolda 9242e972c0 Fix Oracle DB 2016-08-03 13:01:30 +02:00
Thomas Darimont 57a96fa6aa KEYCLOAK-3392 Use authUrl prefix for OIDC Configuration link
We now use the {{authUrl}} prefix for the OIDC configuration link
in the admin-console to honor different web-context paths.

Previously when a different web-context than /auth was configured
the generated link pointed to the wrong location.

Signed-off-by: Thomas Darimont <thomas.darimont@gmail.com>
2016-08-02 15:52:22 +02:00
Bill Burke 7f08717dfb Merge pull request #3105 from patriot1burke/master
component model
2016-08-02 09:28:55 -04:00
Bill Burke 9365a40426 Merge pull request #3104 from zschwarz/exclude-test
KEYCLOAK-3389 Added general exclude for tests
2016-08-02 07:19:42 -04:00
Bill Burke ae58d64741 Merge pull request #3092 from vmuzikar/KEYCLOAK-3381
KEYCLOAK-3381 Fix and stabilize some Console UI tests
2016-08-02 07:19:28 -04:00
Bill Burke 4a8b4bcdec Merge pull request #3087 from zschwarz/password-policy
KEYCLOAK-3379 Password policy tests refactoring
2016-08-02 07:15:58 -04:00
Bill Burke e3aec098a2 Merge pull request #3064 from cainj13/oneSamlAttributeStatement
SamlProtocol should only drop attributes into a single attributeStatement
2016-08-02 07:14:08 -04:00
Bill Burke 3b9b673e5e turn off menu item 2016-08-02 06:57:48 -04:00
Bill Burke 17e75950fe more fixes 2016-08-02 06:56:22 -04:00
Bill Burke 1c75b03e59 props 2016-08-02 06:50:13 -04:00
Bill Burke d64e7394a7 fix 2016-08-01 14:55:06 -04:00
Bill Burke a8a77add39 fix 2016-08-01 12:07:02 -04:00
Bill Burke 5facec73e4 Merge remote-tracking branch 'upstream/master' 2016-08-01 11:19:09 -04:00
Bill Burke 91a267a0d8 component model 2016-08-01 11:18:58 -04:00
Vaclav Muzikar 0147fbe489 KEYCLOAK-3381 Fix and stabilize some Console UI tests 2016-08-01 15:10:18 +02:00
zschwarz e04ad9d7b6 Added general exclude for tests 2016-08-01 13:17:24 +02:00
Thomas Darimont 79c7203fe8 KEYCLOAK-3380 Allow to configure paths to skip in KeycloakOIDCFilter
We now allow configuration of path patterns which should not
be handled by the `KeycloakOIDCFilter` than can be specified via
the new init-parameter `keycloak.config.skipPattern` of
the `KeycloakOIDCFilter`.
Patterns are matched against the requestURI without the context-path.
A request for `/myapp/index.html` would be matched with `/index.html`
against the skip pattern.
This allows for for more flexible path handling when using the
`KeycloakOIDCFilter` in combination with existing applications.

Signed-off-by: Thomas Darimont <thomas.darimont@gmail.com>
2016-08-01 11:43:49 +02:00
Martin Kanis 8ad3c3fb03 Package Fuse adapter as overlay zip 2016-07-29 11:16:05 +02:00
zschwarz 5011960cac Password policy tests refactoring 2016-07-29 10:24:13 +02:00
Tomislav Rajaković 2b3859f462 Fixing typo in account resource bundle: editAccountHtmlTtile -> editAccountHtmlTitle 2016-07-28 16:34:52 +02:00
Josh Cain 535a0763fc put imports back, new IDE snuck a * in there. 2016-07-22 14:57:07 -05:00
Josh Cain 283581f920 SamlProtocol should only drop attributes into a single attributeStatement element 2016-07-22 14:49:48 -05:00
fkiss e2ad7608c8 KEYCLOAK-2281 added ldap tests over ssl 2016-07-22 16:29:58 +02:00
1062 changed files with 44175 additions and 8103 deletions

No files matched your search

+8 -1
View File
@@ -1,5 +1,12 @@
language: java
cache:
directories:
- $HOME/.m2
before_cache:
- rm -rf $HOME/.m2/repository/org/keycloak
env:
global:
- MAVEN_SKIP_RC=true
@@ -12,7 +19,7 @@ before_script:
- export MAVEN_SKIP_RC=true
install:
- ( mvn install -Pdistribution -DskipTests=true -B -V -q ) & ( MYPID=$!; while [ $(ps -ef | grep $MYPID | grep -v grep | wc -l) -gt 0 ]; do sleep 10; date; done; )
- travis_wait 30 mvn install -Pdistribution -DskipTests=true -B -V -q
script:
- mvn test -B
+1
View File
@@ -65,6 +65,7 @@ Contributing
* [Testsuite](misc/Testsuite.md) - Details about testsuite, but also how to quickly run Keycloak during development and a few test tools (OTP generation, LDAP server, Mail server)
* [Database Testing](misc/DatabaseTesting.md) - How to do testing of Keycloak on different databases
* [Updating Database](misc/UpdatingDatabaseSchema.md) - How to change the Keycloak database
* [Changing the Default keycloak-subsystem Configuration](misc/UpdatingServerConfig.md) - How to update the default keycloak-subsystem config
* [Developer Mailing List](https://lists.jboss.org/mailman/listinfo/keycloak-dev) - Mailing list to discuss development of Keycloak
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -32,6 +32,7 @@ import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathCon
import org.keycloak.representations.idm.authorization.Permission;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -55,7 +56,7 @@ public abstract class AbstractPolicyEnforcer {
this.enforcerConfig = policyEnforcer.getEnforcerConfig();
this.authzClient = policyEnforcer.getClient();
this.pathMatcher = new PathMatcher();
this.paths = policyEnforcer.getPaths();
this.paths = new ArrayList<>(policyEnforcer.getPaths());
}
public AuthorizationContext authorize(OIDCHttpFacade httpFacade) {
@@ -33,8 +33,12 @@ import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathCon
import org.keycloak.representations.idm.authorization.Permission;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
@@ -95,8 +99,8 @@ public class PolicyEnforcer {
return authzClient;
}
List<PathConfig> getPaths() {
return paths;
public List<PathConfig> getPaths() {
return Collections.unmodifiableList(paths);
}
KeycloakDeployment getDeployment() {
@@ -154,13 +158,27 @@ public class PolicyEnforcer {
pathConfig.setId(registrationResponse.getId());
} else {
throw new RuntimeException("Could not find matching resource on server with uri [" + path + "] or name [" + resourceName + ". Make sure you have created a resource on the server that matches with the path configuration.");
throw new RuntimeException("Could not find matching resource on server with uri [" + path + "] or name [" + resourceName + "]. Make sure you have created a resource on the server that matches with the path configuration.");
}
} else {
pathConfig.setId(search.iterator().next());
}
paths.add(pathConfig);
PathConfig existingPath = null;
for (PathConfig current : paths) {
if (current.getId().equals(pathConfig.getId()) && current.getPath().equals(pathConfig.getPath())) {
existingPath = current;
break;
}
}
if (existingPath == null) {
paths.add(pathConfig);
} else {
existingPath.getMethods().addAll(pathConfig.getMethods());
existingPath.getScopes().addAll(pathConfig.getScopes());
}
}
return paths;
@@ -43,6 +43,7 @@ import org.keycloak.common.VerificationException;
import org.keycloak.adapters.authentication.ClientCredentialsProviderUtils;
import org.keycloak.constants.ServiceUrlConstants;
import org.keycloak.representations.AccessTokenResponse;
import org.keycloak.representations.idm.OAuth2ErrorRepresentation;
import org.keycloak.util.JsonSerialization;
import org.keycloak.common.util.KeycloakUriBuilder;
@@ -102,9 +103,9 @@ public class DirectAccessGrantsLoginModule extends AbstractKeycloakLoginModule {
StringBuilder errorBuilder = new StringBuilder("Login failed. Invalid status: " + status);
if (entity != null) {
InputStream is = entity.getContent();
Map<String, String> errors = (Map<String, String>) JsonSerialization.readValue(is, Map.class);
errorBuilder.append(", OAuth2 error. Error: " + errors.get(OAuth2Constants.ERROR))
.append(", Error description: " + errors.get(OAuth2Constants.ERROR_DESCRIPTION));
OAuth2ErrorRepresentation errorRep = JsonSerialization.readValue(is, OAuth2ErrorRepresentation.class);
errorBuilder.append(", OAuth2 error. Error: " + errorRep.getError())
.append(", Error description: " + errorRep.getErrorDescription());
}
String error = errorBuilder.toString();
log.warn(error);
@@ -161,9 +162,9 @@ public class DirectAccessGrantsLoginModule extends AbstractKeycloakLoginModule {
if (entity != null) {
InputStream is = entity.getContent();
if (status == 400) {
Map<String, String> errors = (Map<String, String>) JsonSerialization.readValue(is, Map.class);
errorBuilder.append(", OAuth2 error. Error: " + errors.get(OAuth2Constants.ERROR))
.append(", Error description: " + errors.get(OAuth2Constants.ERROR_DESCRIPTION));
OAuth2ErrorRepresentation errorRep = JsonSerialization.readValue(is, OAuth2ErrorRepresentation.class);
errorBuilder.append(", OAuth2 error. Error: " + errorRep.getError())
.append(", Error description: " + errorRep.getErrorDescription());
} else {
if (is != null) is.close();
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-as7-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-as7-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-as7-integration-pom</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak AS7 / JBoss EAP 6 Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak Jetty Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+26 -12
View File
@@ -154,21 +154,31 @@
return;
} else if (initOptions) {
if (initOptions.token || initOptions.refreshToken) {
setToken(initOptions.token, initOptions.refreshToken, initOptions.idToken, false);
setToken(initOptions.token, initOptions.refreshToken, initOptions.idToken);
kc.timeSkew = initOptions.timeSkew || 0;
if (loginIframe.enable) {
setupCheckLoginIframe().success(function() {
checkLoginIframe().success(function () {
kc.onAuthSuccess && kc.onAuthSuccess();
initPromise.setSuccess();
}).error(function () {
kc.onAuthError && kc.onAuthError();
if (initOptions.onLoad) {
onLoad();
}
});
});
} else {
initPromise.setSuccess();
kc.updateToken(-1).success(function() {
kc.onAuthSuccess && kc.onAuthSuccess();
initPromise.setSuccess();
}).error(function() {
kc.onAuthError && kc.onAuthError();
if (initOptions.onLoad) {
onLoad();
}
});
}
} else if (initOptions.onLoad) {
onLoad();
@@ -368,7 +378,7 @@
minValidity = minValidity || 5;
var exec = function() {
if (!kc.isTokenExpired(minValidity)) {
if (minValidity >= 0 && !kc.isTokenExpired(minValidity)) {
promise.setSuccess(false);
} else {
var params = 'grant_type=refresh_token&' + 'refresh_token=' + kc.refreshToken;
@@ -380,6 +390,7 @@
var req = new XMLHttpRequest();
req.open('POST', url, true);
req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
req.withCredentials = true;
if (kc.clientId && kc.clientSecret) {
req.setRequestHeader('Authorization', 'Basic ' + btoa(kc.clientId + ':' + kc.clientSecret));
@@ -395,10 +406,10 @@
timeLocal = (timeLocal + new Date().getTime()) / 2;
var tokenResponse = JSON.parse(req.responseText);
setToken(tokenResponse['access_token'], tokenResponse['refresh_token'], tokenResponse['id_token'], true);
kc.timeSkew = Math.floor(timeLocal / 1000) - kc.tokenParsed.iat;
setToken(tokenResponse['access_token'], tokenResponse['refresh_token'], tokenResponse['id_token']);
kc.onAuthRefreshSuccess && kc.onAuthRefreshSuccess();
for (var p = refreshQueue.pop(); p != null; p = refreshQueue.pop()) {
p.setSuccess(true);
@@ -433,7 +444,7 @@
kc.clearToken = function() {
if (kc.token) {
setToken(null, null, null, true);
setToken(null, null, null);
kc.onAuthLogout && kc.onAuthLogout();
if (kc.loginRequired) {
kc.login();
@@ -514,7 +525,7 @@
function authSuccess(accessToken, refreshToken, idToken, fulfillPromise) {
timeLocal = (timeLocal + new Date().getTime()) / 2;
setToken(accessToken, refreshToken, idToken, true);
setToken(accessToken, refreshToken, idToken);
if ((kc.tokenParsed && kc.tokenParsed.nonce != oauth.storedNonce) ||
(kc.refreshTokenParsed && kc.refreshTokenParsed.nonce != oauth.storedNonce) ||
@@ -598,7 +609,7 @@
return promise.promise;
}
function setToken(token, refreshToken, idToken, useTokenTime) {
function setToken(token, refreshToken, idToken) {
if (kc.tokenTimeoutHandle) {
clearTimeout(kc.tokenTimeoutHandle);
kc.tokenTimeoutHandle = null;
@@ -618,9 +629,12 @@
kc.resourceAccess = kc.tokenParsed.resource_access;
if (kc.onTokenExpired) {
var start = useTokenTime ? kc.tokenParsed.iat : (new Date().getTime() / 1000);
var expiresIn = kc.tokenParsed.exp - start;
kc.tokenTimeoutHandle = setTimeout(kc.onTokenExpired, expiresIn * 1000);
var expiresIn = (kc.tokenParsed['exp'] - (new Date().getTime() / 1000) + kc.timeSkew) * 1000;
if (expiresIn <= 0) {
kc.onTokenExpired();
} else {
kc.tokenTimeoutHandle = setTimeout(kc.onTokenExpired, expiresIn);
}
}
} else {
@@ -1055,7 +1069,7 @@
if (!(this instanceof CookieStorage)) {
return new CookieStorage();
}
var cs = this;
cs.get = function(state) {
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<name>Keycloak OIDC Client Adapter Modules</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -47,6 +47,7 @@ import java.io.InputStream;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -56,10 +57,18 @@ public class KeycloakOIDCFilter implements Filter {
protected AdapterDeploymentContext deploymentContext;
protected SessionIdMapper idMapper = new InMemorySessionIdMapper();
protected NodesRegistrationManagement nodesRegistrationManagement;
protected Pattern skipPattern;
private final static Logger log = Logger.getLogger(""+KeycloakOIDCFilter.class);
@Override
public void init(final FilterConfig filterConfig) throws ServletException {
String skipPatternDefinition = filterConfig.getInitParameter("keycloak.config.skipPattern");
if (skipPatternDefinition != null) {
skipPattern = Pattern.compile(skipPatternDefinition, Pattern.DOTALL);
}
String configResolverClass = filterConfig.getInitParameter("keycloak.config.resolver");
if (configResolverClass != null) {
try {
@@ -85,13 +94,7 @@ public class KeycloakOIDCFilter implements Filter {
if (pathParam != null) path = pathParam;
is = filterConfig.getServletContext().getResourceAsStream(path);
}
KeycloakDeployment kd;
if (is == null) {
log.fine("No adapter configuration. Keycloak is unconfigured and will deny all requests.");
kd = new KeycloakDeployment();
} else {
kd = KeycloakDeploymentBuilder.build(is);
}
KeycloakDeployment kd = createKeycloakDeploymentFrom(is);
deploymentContext = new AdapterDeploymentContext(kd);
log.fine("Keycloak is using a per-deployment configuration.");
}
@@ -99,13 +102,30 @@ public class KeycloakOIDCFilter implements Filter {
nodesRegistrationManagement = new NodesRegistrationManagement();
}
private KeycloakDeployment createKeycloakDeploymentFrom(InputStream is) {
if (is == null) {
log.fine("No adapter configuration. Keycloak is unconfigured and will deny all requests.");
return new KeycloakDeployment();
}
return KeycloakDeploymentBuilder.build(is);
}
@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
log.fine("Keycloak OIDC Filter");
//System.err.println("Keycloak OIDC Filter: " + ((HttpServletRequest)req).getRequestURL().toString());
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
if (shouldSkip(request)) {
chain.doFilter(req, res);
return;
}
OIDCServletHttpFacade facade = new OIDCServletHttpFacade(request, response);
KeycloakDeployment deployment = deploymentContext.resolveDeployment(facade);
if (deployment == null || !deployment.isConfigured()) {
@@ -171,6 +191,26 @@ public class KeycloakOIDCFilter implements Filter {
}
/**
* Decides whether this {@link Filter} should skip the given {@link HttpServletRequest} based on the configured {@link KeycloakOIDCFilter#skipPattern}.
* Patterns are matched against the {@link HttpServletRequest#getRequestURI() requestURI} of a request without the context-path.
* A request for {@code /myapp/index.html} would be tested with {@code /index.html} against the skip pattern.
* Skipped requests will not be processed further by {@link KeycloakOIDCFilter} and immediately delegated to the {@link FilterChain}.
*
* @param request the request to check
* @return {@code true} if the request should not be handled,
* {@code false} otherwise.
*/
private boolean shouldSkip(HttpServletRequest request) {
if (skipPattern == null) {
return false;
}
String requestPath = request.getRequestURI().substring(request.getContextPath().length());
return skipPattern.matcher(requestPath).matches();
}
@Override
public void destroy() {
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -69,6 +69,5 @@ public class HttpSessionManager implements HttpSessionListener, UserSessionManag
session.invalidate();
}
}
sessions.clear();
}
}
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak Tomcat Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak WildFly Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -21,7 +21,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<name>Keycloak Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-eap-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak SAML EAP Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-saml-eap-integration-pom</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak SAML Jetty Integration</name>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<name>Keycloak SAML Client Adapter Modules</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<name>Keycloak SAML Tomcat Integration</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-saml-tomcat-integration-pom</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.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>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -21,7 +21,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -20,7 +20,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<name>Keycloak Client Adapter SPI Modules</name>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-authz-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -25,7 +25,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-authz-provider-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -37,12 +37,10 @@ public class TimePolicyAdminResource implements PolicyProviderAdminService {
String nbf = policy.getConfig().get("nbf");
String noa = policy.getConfig().get("noa");
if (nbf == null && noa == null) {
throw new RuntimeException("You must provide NotBefore, NotOnOrAfter or both.");
if (nbf != null && noa != null) {
validateFormat(nbf);
validateFormat(noa);
}
validateFormat(nbf);
validateFormat(noa);
}
@Override
@@ -22,8 +22,11 @@ import org.keycloak.authorization.policy.evaluation.Evaluation;
import org.keycloak.authorization.policy.provider.PolicyProvider;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import static com.sun.corba.se.spi.activation.IIOP_CLEAR_TEXT.value;
/**
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/
@@ -45,9 +48,7 @@ public class TimePolicyProvider implements PolicyProvider {
public void evaluate(Evaluation evaluation) {
try {
String notBefore = this.policy.getConfig().get("nbf");
if (notBefore != null) {
if (this.currentDate.before(this.dateFormat.parse(format(notBefore)))) {
evaluation.deny();
return;
@@ -55,7 +56,6 @@ public class TimePolicyProvider implements PolicyProvider {
}
String notOnOrAfter = this.policy.getConfig().get("noa");
if (notOnOrAfter != null) {
if (this.currentDate.after(this.dateFormat.parse(format(notOnOrAfter)))) {
evaluation.deny();
@@ -63,12 +63,48 @@ public class TimePolicyProvider implements PolicyProvider {
}
}
if (isInvalid(Calendar.DAY_OF_MONTH, "dayMonth")
|| isInvalid(Calendar.MONTH, "month")
|| isInvalid(Calendar.YEAR, "year")
|| isInvalid(Calendar.HOUR_OF_DAY, "hour")
|| isInvalid(Calendar.MINUTE, "minute")) {
evaluation.deny();
return;
}
evaluation.grant();
} catch (Exception e) {
throw new RuntimeException("Could not evaluate time-based policy [" + this.policy.getName() + "].", e);
}
}
private boolean isInvalid(int timeConstant, String configName) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(this.currentDate);
int dateField = calendar.get(timeConstant);
if (Calendar.MONTH == timeConstant) {
dateField++;
}
String start = this.policy.getConfig().get(configName);
if (start != null) {
String end = this.policy.getConfig().get(configName + "End");
if (end != null) {
if (dateField < Integer.parseInt(start) || dateField > Integer.parseInt(end)) {
return true;
}
} else {
if (dateField != Integer.parseInt(start)) {
return true;
}
}
}
return false;
}
static String format(String notBefore) {
String trimmed = notBefore.trim();
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-authz-provider-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-authz-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -0,0 +1,102 @@
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.common.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
@SuppressWarnings("serial")
public class ConcurrentMultivaluedHashMap<K, V> extends ConcurrentHashMap<K, List<V>>
{
public void putSingle(K key, V value)
{
List<V> list = new CopyOnWriteArrayList<>();
list.add(value);
put(key, list);
}
public void addAll(K key, V... newValues)
{
for (V value : newValues)
{
add(key, value);
}
}
public void addAll(K key, List<V> valueList)
{
for (V value : valueList)
{
add(key, value);
}
}
public void addFirst(K key, V value)
{
List<V> list = get(key);
if (list == null)
{
add(key, value);
}
else
{
list.add(0, value);
}
}
public final void add(K key, V value)
{
getList(key).add(value);
}
public final void addMultiple(K key, Collection<V> values)
{
getList(key).addAll(values);
}
public V getFirst(K key)
{
List<V> list = get(key);
return list == null ? null : list.get(0);
}
public final List<V> getList(K key)
{
List<V> list = get(key);
if (list == null)
put(key, list = new CopyOnWriteArrayList<V>());
return list;
}
public void addAll(ConcurrentMultivaluedHashMap<K, V> other)
{
for (Entry<K, List<V>> entry : other.entrySet())
{
getList(entry.getKey()).addAll(entry.getValue());
}
}
}
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -42,6 +42,10 @@ public interface OAuth2Constants {
String RESPONSE_TYPE = "response_type";
String ACCESS_TOKEN = "access_token";
String ID_TOKEN = "id_token";
String REFRESH_TOKEN = "refresh_token";
String AUTHORIZATION_CODE = "authorization_code";
@@ -37,12 +37,18 @@ public class OAuthErrorException extends Exception {
public static final String REQUEST_NOT_SUPPORTED = "request_not_supported";
public static final String REQUEST_URI_NOT_SUPPORTED = "request_uri_not_supported";
// OAuth2 Bearer Token Usage
public static final String INVALID_TOKEN = "invalid_token";
public static final String INSUFFICIENT_SCOPE = "insufficient_scope";
// OIDC Dynamic Client Registration
public static final String INVALID_REDIRECT_URI = "invalid_redirect_uri";
public static final String INVALID_CLIENT_METADATA = "invalid_client_metadata";
// Others
public static final String INVALID_CLIENT = "invalid_client";
public static final String INVALID_GRANT = "invalid_grant";
public static final String UNSUPPORTED_GRANT_TYPE = "unsupported_grant_type";
public static final String INVALID_TOKEN = "invalid_token";
public static final String INSUFFICIENT_SCOPE = "insufficient_scope";
public OAuthErrorException(String error, String description, String message, Throwable cause) {
super(message, cause);
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.keycloak.protocol.oidc.representations;
package org.keycloak.jose.jwk;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.keycloak.jose.jwk.JWK;
@@ -37,8 +37,20 @@ public class JWK {
public static final String PUBLIC_KEY_USE = "use";
public static final String SIG_USE = "sig";
public static final String ENCRYPTION_USE = "enc";
public enum Use {
SIG("sig"),
ENCRYPTION("enc");
private String str;
Use(String str) {
this.str = str;
}
public String asString() {
return str;
}
}
@JsonProperty(KEY_ID)
private String keyId;
@@ -67,7 +67,7 @@ public class JWKParser {
public PublicKey toPublicKey() {
String algorithm = jwk.getKeyType();
if (RSAPublicJWK.RSA.equals(algorithm)) {
if (isAlgorithmSupported(algorithm)) {
BigInteger modulus = new BigInteger(1, Base64Url.decode(jwk.getOtherClaims().get(RSAPublicJWK.MODULUS).toString()));
BigInteger publicExponent = new BigInteger(1, Base64Url.decode(jwk.getOtherClaims().get(RSAPublicJWK.PUBLIC_EXPONENT).toString()));
@@ -81,4 +81,8 @@ public class JWKParser {
}
}
public boolean isAlgorithmSupported(String algorithm) {
return RSAPublicJWK.RSA.equals(algorithm);
}
}
@@ -108,43 +108,29 @@ public class JWSBuilder {
return encodeAll(buffer, null);
}
public String rsa256(PrivateKey privateKey) {
public String sign(Algorithm algorithm, PrivateKey privateKey) {
StringBuffer buffer = new StringBuffer();
byte[] data = marshalContent();
encode(Algorithm.RS256, data, buffer);
encode(algorithm, data, buffer);
byte[] signature = null;
try {
signature = RSAProvider.sign(buffer.toString().getBytes("UTF-8"), Algorithm.RS256, privateKey);
signature = RSAProvider.sign(buffer.toString().getBytes("UTF-8"), algorithm, privateKey);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
return encodeAll(buffer, signature);
}
public String rsa256(PrivateKey privateKey) {
return sign(Algorithm.RS256, privateKey);
}
public String rsa384(PrivateKey privateKey) {
StringBuffer buffer = new StringBuffer();
byte[] data = marshalContent();
encode(Algorithm.RS384, data, buffer);
byte[] signature = null;
try {
signature = RSAProvider.sign(buffer.toString().getBytes("UTF-8"), Algorithm.RS384, privateKey);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
return encodeAll(buffer, signature);
return sign(Algorithm.RS384, privateKey);
}
public String rsa512(PrivateKey privateKey) {
StringBuffer buffer = new StringBuffer();
byte[] data = marshalContent();
encode(Algorithm.RS512, data, buffer);
byte[] signature = null;
try {
signature = RSAProvider.sign(buffer.toString().getBytes("UTF-8"), Algorithm.RS512, privateKey);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
return encodeAll(buffer, signature);
return sign(Algorithm.RS512, privateKey);
}
@@ -0,0 +1,66 @@
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.jose.jws.crypto;
import java.security.MessageDigest;
import java.util.Arrays;
import org.keycloak.common.util.Base64Url;
import org.keycloak.jose.jws.Algorithm;
/**
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
*/
public class HashProvider {
// See "at_hash" and "c_hash" in OIDC specification
public static String oidcHash(Algorithm jwtAlgorithm, String input) {
byte[] digest = digest(jwtAlgorithm, input);
int hashLength = digest.length / 2;
byte[] hashInput = Arrays.copyOf(digest, hashLength);
return Base64Url.encode(hashInput);
}
private static byte[] digest(Algorithm algorithm, String input) {
String digestAlg = getJavaDigestAlgorithm(algorithm);
try {
MessageDigest md = MessageDigest.getInstance(digestAlg);
md.update(input.getBytes("UTF-8"));
return md.digest();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private static String getJavaDigestAlgorithm(Algorithm alg) {
switch (alg) {
case RS256:
return "SHA-256";
case RS384:
return "SHA-384";
case RS512:
return "SHA-512";
default:
throw new IllegalArgumentException("Not an RSA Algorithm");
}
}
}
@@ -27,6 +27,8 @@ public class IDToken extends JsonWebToken {
public static final String NONCE = "nonce";
public static final String AUTH_TIME = "auth_time";
public static final String SESSION_STATE = "session_state";
public static final String AT_HASH = "at_hash";
public static final String C_HASH = "c_hash";
public static final String NAME = "name";
public static final String GIVEN_NAME = "given_name";
public static final String FAMILY_NAME = "family_name";
@@ -60,6 +62,12 @@ public class IDToken extends JsonWebToken {
@JsonProperty(SESSION_STATE)
protected String sessionState;
@JsonProperty(AT_HASH)
protected String accessTokenHash;
@JsonProperty(C_HASH)
protected String codeHash;
@JsonProperty(NAME)
protected String name;
@@ -147,6 +155,22 @@ public class IDToken extends JsonWebToken {
this.sessionState = sessionState;
}
public String getAccessTokenHash() {
return accessTokenHash;
}
public void setAccessTokenHash(String accessTokenHash) {
this.accessTokenHash = accessTokenHash;
}
public String getCodeHash() {
return codeHash;
}
public void setCodeHash(String codeHash) {
this.codeHash = codeHash;
}
public String getName() {
return this.name;
}
@@ -16,12 +16,31 @@
*/
package org.keycloak.representations;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.keycloak.json.StringOrArrayDeserializer;
import org.keycloak.json.StringOrArraySerializer;
/**
* @author pedroigor
*/
public class UserInfo {
// Should be in signed UserInfo response
@JsonProperty("iss")
protected String issuer;
@JsonProperty("aud")
@JsonSerialize(using = StringOrArraySerializer.class)
@JsonDeserialize(using = StringOrArrayDeserializer.class)
protected String[] audience;
@JsonProperty("sub")
protected String sub;
@@ -85,6 +104,34 @@ public class UserInfo {
@JsonProperty("claims_locales")
protected String claimsLocales;
protected Map<String, Object> otherClaims = new HashMap<>();
public String getIssuer() {
return issuer;
}
public void setIssuer(String issuer) {
this.issuer = issuer;
}
@JsonIgnore
public String[] getAudience() {
return audience;
}
public boolean hasAudience(String audience) {
for (String a : this.audience) {
if (a.equals(audience)) {
return true;
}
}
return false;
}
public void setAudience(String... audience) {
this.audience = audience;
}
public String getSubject() {
return this.sub;
}
@@ -260,4 +307,19 @@ public class UserInfo {
public void setClaimsLocales(String claimsLocales) {
this.claimsLocales = claimsLocales;
}
/**
* This is a map of any other claims and data that might be in the UserInfo. Could be custom claims set up by the auth server
*
* @return
*/
@JsonAnyGetter
public Map<String, Object> getOtherClaims() {
return otherClaims;
}
@JsonAnySetter
public void setOtherClaims(String name, Object value) {
otherClaims.put(name, value);
}
}
@@ -18,7 +18,6 @@
package org.keycloak.representations.idm;
/**
*
* @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc.
*/
public class AdminEventRepresentation {
@@ -27,6 +26,7 @@ public class AdminEventRepresentation {
private String realmId;
private AuthDetailsRepresentation authDetails;
private String operationType;
private String resourceType;
private String resourcePath;
private String representation;
private String error;
@@ -63,6 +63,14 @@ public class AdminEventRepresentation {
this.operationType = operationType;
}
public String getResourceType() {
return resourceType;
}
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
public String getResourcePath() {
return resourcePath;
}
@@ -86,5 +94,4 @@ public class AdminEventRepresentation {
public void setError(String error) {
this.error = error;
}
}
@@ -25,6 +25,7 @@ package org.keycloak.representations.idm;
public class CertificateRepresentation {
protected String privateKey;
protected String publicKey;
protected String certificate;
public String getPrivateKey() {
@@ -35,6 +36,14 @@ public class CertificateRepresentation {
this.privateKey = privateKey;
}
public String getPublicKey() {
return publicKey;
}
public void setPublicKey(String publicKey) {
this.publicKey = publicKey;
}
public String getCertificate() {
return certificate;
}
@@ -0,0 +1,60 @@
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.representations.idm;
/**
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
*/
public class ClientRegistrationTrustedHostRepresentation {
String hostName;
Integer count;
Integer remainingCount;
public static ClientRegistrationTrustedHostRepresentation create(String hostName, int count, int remainingCount) {
ClientRegistrationTrustedHostRepresentation rep = new ClientRegistrationTrustedHostRepresentation();
rep.setHostName(hostName);
rep.setCount(count);
rep.setRemainingCount(remainingCount);
return rep;
}
public String getHostName() {
return hostName;
}
public void setHostName(String hostName) {
this.hostName = hostName;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public Integer getRemainingCount() {
return remainingCount;
}
public void setRemainingCount(Integer remainingCount) {
this.remainingCount = remainingCount;
}
}
@@ -17,6 +17,8 @@
package org.keycloak.representations.idm;
import org.keycloak.representations.idm.authorization.ResourceServerRepresentation;
import java.util.List;
import java.util.Map;
@@ -62,6 +64,7 @@ public class ClientRepresentation {
private Boolean useTemplateConfig;
private Boolean useTemplateScope;
private Boolean useTemplateMappers;
private ResourceServerRepresentation authorizationSettings;
public String getId() {
@@ -241,6 +244,9 @@ public class ClientRepresentation {
}
public Boolean getAuthorizationServicesEnabled() {
if (authorizationSettings != null) {
return true;
}
return authorizationServicesEnabled;
}
@@ -353,4 +359,11 @@ public class ClientRepresentation {
this.useTemplateMappers = useTemplateMappers;
}
public ResourceServerRepresentation getAuthorizationSettings() {
return authorizationSettings;
}
public void setAuthorizationSettings(ResourceServerRepresentation authorizationSettings) {
this.authorizationSettings = authorizationSettings;
}
}
@@ -0,0 +1,72 @@
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.representations.idm;
import org.keycloak.common.util.MultivaluedHashMap;
/**
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
*/
public class ComponentExportRepresentation {
private String id;
private String name;
private String providerId;
private MultivaluedHashMap<String, ComponentExportRepresentation> subComponents = new MultivaluedHashMap<>();
private MultivaluedHashMap<String, String> config = new MultivaluedHashMap<>();
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getProviderId() {
return providerId;
}
public void setProviderId(String providerId) {
this.providerId = providerId;
}
public MultivaluedHashMap<String, String> getConfig() {
return config;
}
public void setConfig(MultivaluedHashMap<String, String> config) {
this.config = config;
}
public MultivaluedHashMap<String, ComponentExportRepresentation> getSubComponents() {
return subComponents;
}
public void setSubComponents(MultivaluedHashMap<String, ComponentExportRepresentation> subComponents) {
this.subComponents = subComponents;
}
}
@@ -123,10 +123,15 @@ public class IdentityProviderRepresentation {
this.updateProfileFirstLoginMode = updateProfileFirstLoginMode;
}
/**
* @deprecated Replaced by configuration option in identity provider authenticator
*/
@Deprecated
public boolean isAuthenticateByDefault() {
return authenticateByDefault;
}
@Deprecated
public void setAuthenticateByDefault(boolean authenticateByDefault) {
this.authenticateByDefault = authenticateByDefault;
}
@@ -0,0 +1,56 @@
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.representations.idm;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.keycloak.OAuth2Constants;
/**
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
*/
public class OAuth2ErrorRepresentation {
private String error;
private String errorDescription;
public OAuth2ErrorRepresentation() {
}
public OAuth2ErrorRepresentation(String error, String errorDescription) {
this.error = error;
this.errorDescription = errorDescription;
}
@JsonProperty(OAuth2Constants.ERROR)
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
@JsonProperty(OAuth2Constants.ERROR_DESCRIPTION)
public String getErrorDescription() {
return errorDescription;
}
public void setErrorDescription(String errorDescription) {
this.errorDescription = errorDescription;
}
}
@@ -18,6 +18,7 @@
package org.keycloak.representations.idm;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.keycloak.common.util.MultivaluedHashMap;
import java.util.*;
@@ -109,6 +110,7 @@ public class RealmRepresentation {
private List<IdentityProviderRepresentation> identityProviders;
private List<IdentityProviderMapperRepresentation> identityProviderMappers;
private List<ProtocolMapperRepresentation> protocolMappers;
private MultivaluedHashMap<String, ComponentExportRepresentation> components;
protected Boolean internationalizationEnabled;
protected Set<String> supportedLocales;
protected String defaultLocale;
@@ -121,6 +123,8 @@ public class RealmRepresentation {
protected String resetCredentialsFlow;
protected String clientAuthenticationFlow;
protected Map<String, String> attributes;
protected String keycloakVersion;
@Deprecated
@@ -849,9 +853,25 @@ public class RealmRepresentation {
this.clientTemplates = clientTemplates;
}
public MultivaluedHashMap<String, ComponentExportRepresentation> getComponents() {
return components;
}
public void setComponents(MultivaluedHashMap<String, ComponentExportRepresentation> components) {
this.components = components;
}
@JsonIgnore
public boolean isIdentityFederationEnabled() {
return identityProviders != null && !identityProviders.isEmpty();
}
public void setAttributes(Map<String, String> attributes) {
this.attributes = attributes;
}
public Map<String, String> getAttributes() {
return attributes;
}
}
@@ -18,6 +18,7 @@
package org.keycloak.representations.oidc;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import org.keycloak.jose.jwk.JSONWebKeySet;
import java.util.List;
@@ -27,14 +28,20 @@ import java.util.List;
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
public class OIDCClientRepresentation {
// OIDC Dynamic client registration properties
private List<String> redirect_uris;
private String token_endpoint_auth_method;
private String token_endpoint_auth_signing_alg;
private List<String> grant_types;
private List<String> response_types;
private String application_type;
private String client_id;
private String client_secret;
@@ -47,7 +54,7 @@ public class OIDCClientRepresentation {
private String scope;
private String contacts;
private List<String> contacts;
private String tos_uri;
@@ -55,12 +62,49 @@ public class OIDCClientRepresentation {
private String jwks_uri;
private String jwks;
private JSONWebKeySet jwks;
private String sector_identifier_uri;
private String subject_type;
private String id_token_signed_response_alg;
private String id_token_encrypted_response_alg;
private String id_token_encrypted_response_enc;
private String userinfo_signed_response_alg;
private String userinfo_encrypted_response_alg;
private String userinfo_encrypted_response_enc;
private String request_object_signing_alg;
private String request_object_encryption_alg;
private String request_object_encryption_enc;
private Integer default_max_age;
private Boolean require_auth_time;
private List<String> default_acr_values;
private String initiate_login_uri;
private List<String> request_uris;
// OIDC Session Management
private List<String> post_logout_redirect_uris;
// Not sure from which specs this comes
private String software_id;
private String software_version;
// OIDC Dynamic Client Registration Response
private Integer client_id_issued_at;
private Integer client_secret_expires_at;
@@ -85,6 +129,14 @@ public class OIDCClientRepresentation {
this.token_endpoint_auth_method = token_endpoint_auth_method;
}
public String getTokenEndpointAuthSigningAlg() {
return token_endpoint_auth_signing_alg;
}
public void setTokenEndpointAuthSigningAlg(String token_endpoint_auth_signing_alg) {
this.token_endpoint_auth_signing_alg = token_endpoint_auth_signing_alg;
}
public List<String> getGrantTypes() {
return grant_types;
}
@@ -101,6 +153,14 @@ public class OIDCClientRepresentation {
this.response_types = responseTypes;
}
public String getApplicationType() {
return application_type;
}
public void setApplicationType(String applicationType) {
this.application_type = applicationType;
}
public String getClientId() {
return client_id;
}
@@ -149,11 +209,11 @@ public class OIDCClientRepresentation {
this.scope = scope;
}
public String getContacts() {
public List<String> getContacts() {
return contacts;
}
public void setContacts(String contacts) {
public void setContacts(List<String> contacts) {
this.contacts = contacts;
}
@@ -181,14 +241,150 @@ public class OIDCClientRepresentation {
this.jwks_uri = jwks_uri;
}
public String getJwks() {
public JSONWebKeySet getJwks() {
return jwks;
}
public void setJwks(String jwks) {
public void setJwks(JSONWebKeySet jwks) {
this.jwks = jwks;
}
public String getSectorIdentifierUri() {
return sector_identifier_uri;
}
public void setSectorIdentifierUri(String sectorIdentifierUri) {
this.sector_identifier_uri = sectorIdentifierUri;
}
public String getSubjectType() {
return subject_type;
}
public void setSubjectType(String subjectType) {
this.subject_type = subjectType;
}
public String getIdTokenSignedResponseAlg() {
return id_token_signed_response_alg;
}
public void setIdTokenSignedResponseAlg(String idTokenSignedResponseAlg) {
this.id_token_signed_response_alg = idTokenSignedResponseAlg;
}
public String getIdTokenEncryptedResponseAlg() {
return id_token_encrypted_response_alg;
}
public void setIdTokenEncryptedResponseAlg(String idTokenEncryptedResponseAlg) {
this.id_token_encrypted_response_alg = idTokenEncryptedResponseAlg;
}
public String getIdTokenEncryptedResponseEnc() {
return id_token_encrypted_response_enc;
}
public void setIdTokenEncryptedResponseEnc(String idTokenEncryptedResponseEnc) {
this.id_token_encrypted_response_enc = idTokenEncryptedResponseEnc;
}
public String getUserinfoSignedResponseAlg() {
return userinfo_signed_response_alg;
}
public void setUserinfoSignedResponseAlg(String userinfo_signed_response_alg) {
this.userinfo_signed_response_alg = userinfo_signed_response_alg;
}
public String getUserinfoEncryptedResponseAlg() {
return userinfo_encrypted_response_alg;
}
public void setUserinfoEncryptedResponseAlg(String userinfo_encrypted_response_alg) {
this.userinfo_encrypted_response_alg = userinfo_encrypted_response_alg;
}
public String getUserinfoEncryptedResponseEnc() {
return userinfo_encrypted_response_enc;
}
public void setUserinfoEncryptedResponseEnc(String userinfo_encrypted_response_enc) {
this.userinfo_encrypted_response_enc = userinfo_encrypted_response_enc;
}
public String getRequestObjectSigningAlg() {
return request_object_signing_alg;
}
public void setRequestObjectSigningAlg(String request_object_signing_alg) {
this.request_object_signing_alg = request_object_signing_alg;
}
public String getRequestObjectEncryptionAlg() {
return request_object_encryption_alg;
}
public void setRequestObjectEncryptionAlg(String request_object_encryption_alg) {
this.request_object_encryption_alg = request_object_encryption_alg;
}
public String getRequestObjectEncryptionEnc() {
return request_object_encryption_enc;
}
public void setRequestObjectEncryptionEnc(String request_object_encryption_enc) {
this.request_object_encryption_enc = request_object_encryption_enc;
}
public Integer getDefaultMaxAge() {
return default_max_age;
}
public void setDefaultMaxAge(Integer default_max_age) {
this.default_max_age = default_max_age;
}
public Boolean getRequireAuthTime() {
return require_auth_time;
}
public void setRequireAuthTime(Boolean require_auth_time) {
this.require_auth_time = require_auth_time;
}
public List<String> getDefaultAcrValues() {
return default_acr_values;
}
public void setDefaultAcrValues(List<String> default_acr_values) {
this.default_acr_values = default_acr_values;
}
public String getInitiateLoginUri() {
return initiate_login_uri;
}
public void setInitiateLoginUri(String initiate_login_uri) {
this.initiate_login_uri = initiate_login_uri;
}
public List<String> getRequestUris() {
return request_uris;
}
public void setRequestUris(List<String> requestUris) {
this.request_uris = requestUris;
}
public List<String> getPostLogoutRedirectUris() {
return post_logout_redirect_uris;
}
public void setPostLogoutRedirectUris(List<String> post_logout_redirect_uris) {
this.post_logout_redirect_uris = post_logout_redirect_uris;
}
public String getSoftwareId() {
return software_id;
}
@@ -0,0 +1,49 @@
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak;
import java.security.Security;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.junit.Assert;
import org.junit.Test;
import org.keycloak.jose.jws.Algorithm;
import org.keycloak.jose.jws.crypto.HashProvider;
/**
* See "at_hash" in OIDC specification
*
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
*/
public class AtHashTest {
static {
if (Security.getProvider("BC") == null) Security.addProvider(new BouncyCastleProvider());
}
@Test
public void testAtHash() throws Exception {
verifyHash("jHkWEdUXMU1BwAsC4vtUsZwnNvTIxEl0z9K3vx5KF0Y", "77QmUPtjPfzWtF2AnpK9RQ");
verifyHash("ya29.eQETFbFOkAs8nWHcmYXKwEi0Zz46NfsrUU_KuQLOLTwWS40y6Fb99aVzEXC0U14m61lcPMIr1hEIBA", "aUAkJG-u6x4RTWuILWy-CA");
}
private void verifyHash(String accessToken, String expectedAtHash) {
String atHash = HashProvider.oidcHash(Algorithm.RS256, accessToken);
Assert.assertEquals(expectedAtHash, atHash);
}
}
@@ -33,6 +33,7 @@ import org.junit.Test;
import org.keycloak.representations.IDToken;
import org.keycloak.representations.JsonWebToken;
import org.keycloak.representations.adapters.config.AdapterConfig;
import org.keycloak.representations.oidc.OIDCClientRepresentation;
import org.keycloak.util.JsonSerialization;
/**
@@ -125,4 +126,23 @@ public class JsonParserTest {
System.out.println(sb.toString());
}
@Test
public void testReadOIDCClientRep() throws IOException {
String stringRep = "{\"subject_type\": \"public\", \"jwks_uri\": \"https://op.certification.openid.net:60720/export/jwk_60720.json\", \"contacts\": [\"roland.hedberg@umu.se\"], \"application_type\": \"web\", \"grant_types\": [\"authorization_code\"], \"post_logout_redirect_uris\": [\"https://op.certification.openid.net:60720/logout\"], \"redirect_uris\": [\"https://op.certification.openid.net:60720/authz_cb\"], \"response_types\": [\"code\"], \"require_auth_time\": true, \"default_max_age\": 3600}";
OIDCClientRepresentation clientRep = JsonSerialization.readValue(stringRep, OIDCClientRepresentation.class);
Assert.assertEquals("public", clientRep.getSubjectType());
Assert.assertTrue(clientRep.getRequireAuthTime());
Assert.assertEquals(3600, clientRep.getDefaultMaxAge().intValue());
Assert.assertEquals(1, clientRep.getRedirectUris().size());
Assert.assertEquals("https://op.certification.openid.net:60720/authz_cb", clientRep.getRedirectUris().get(0));
Assert.assertNull(clientRep.getJwks());
}
@Test
public void testReadOIDCClientRepWithJWKS() throws IOException {
String stringRep = "{\"token_endpoint_auth_method\": \"private_key_jwt\", \"subject_type\": \"public\", \"jwks_uri\": null, \"jwks\": {\"keys\": [{\"use\": \"enc\", \"e\": \"AQAB\", \"d\": \"lZQv0_81euRLeUYU84Aodh0ar7ymDlzWP5NMra4Jklkb-lTBWkI-u4RMsPqGYyW3KHRoL_pgzZXSzQx8RLQfER6timRWb--NxMMKllZubByU3RqH2ooNuocJurspYiXkznPW1Mg9DaNXL0C2hwWPQHTeUVISpjgi5TCOV1ccWVyksFruya_VNL1CIByB-L0GL1rqbKv32cDwi2A3_jJa61cpzfLSIBe-lvCO6tuiDsR4qgJnUwnndQFwEI_4mLmD3iNWXrc8N-poleV8mBfMqBB5fWwy_ZTFCpmQ5AywGmctaik_wNhMoWuA4tUfY6_1LdKld-5Cjq55eLtuJjtvuQ\", \"n\": \"tx3Hjdbc19lkTiohbJrNj4jf2_90MEE122CRrwtFu6saDywKcG7Bi7w2FMAK2oTkuWfqhWRb5BEGmnSXdiCEPO5d-ytqP3nwlZXHaCDYscpP8bB4YLhvCn7R8Efw6gwQle24QPRP3lYoFeuUbDUq7GKA5SfaZUvWoeWjqyLIaBspKQsC26_Umx1E4IXLrMSL6nkRnrYcVZBAXrYCeTP1XtsV38_lZVJfHSaJaUy4PKaj3yvgm93EV2CXybPti7CCMXZ34VqqWiF64pQjZsPu3ZTr7ha_TTQq499-zYRQNDvIVsBDLQQIgrbctuGqj6lrXb31Jj3JIEYqH_4h5X9d0Q\", \"q\": \"1q-r-bmMFbIzrLK2U3elksZq8CqUqZxlSfkGMZuVkxgYMS-e4FPzEp2iirG-eO11aa0cpMMoBdTnVdGJ_ZUR93w0lGf9XnQAJqxP7eOsrUoiW4VWlWH4WfOiLgpO-pFtyTz_JksYYaotc_Z3Zy-Szw6a39IDbuYGy1qL-15oQuc\", \"p\": \"2lrYPppRbcQWu4LtWN6tOVUrtCOPv1eLTKTc7q8vCMcem1Ox5QFB7KnUtNZ5Ni7wnZUeVDfimNebtjNsGvDSrpgIlo9dEnFBQsQIkzZ2SkoYfgmF8hNdi6P-BfRjdgYouy4c6xAnGDgSMTip1YnPRyvbMaoYT9E_tEcBW5wOeoc\", \"kid\": \"a0\", \"kty\": \"RSA\"}, {\"use\": \"sig\", \"e\": \"AQAB\", \"d\": \"DodXDEtkovWWGsMEXYy_nEEMCWyROMOebCnCv0ey3i4M4bh2dmwqgz0e-IKQAFlGiMkidGL1lNbq0uFS04FbuRAR06dYw1cbrNbDdhrWFxKTd1L5D9p-x-gW-YDWhpI8rUGRa76JXkOSxZUbg09_QyUd99CXAHh-FXi_ZkIKD8hK6FrAs68qhLf8MNkUv63DTduw7QgeFfQivdopePxyGuMk5n8veqwsUZsklQkhNlTYQqeM1xb2698ZQcNYkl0OssEsSJKRjXt-LRPowKrdvTuTo2p--HMI0pIEeFs7H_u5OW3jihjvoFClGPynHQhgWmQzlQRvWRXh6FhDVqFeGQ\", \"n\": \"zfZzttF7HmnTYwSMPdxKs5AoczbNS2mOPz-tN1g4ljqI_F1DG8cgQDcN_VDufxoFGRERo2FK6WEN41LhbGEyP6uL6wW6Cy29qE9QZcvY5mXrncndRSOkNcMizvuEJes_fMYrmP_lPiC6kWiqItTk9QBWqJfiYKhCx9cSDXsBmJXn3KWQCVHvj1ANFWW0CWLMKlWN-_NMNLIWJN_pEAocTZMzxSFBK1b5_5J8ZS7hfWRF6MQmjsJcz2jzA21SQZNpre3kwnTGRSwo05sAS-TyeadDqQPWgbqX69UzcGq5irhzN8cpZ_JaTk3Y_uV6owanTZLVvCgdjaAnMYeZhb0KFw\", \"q\": \"5E5XKK5njT-zzRqqTeY2tgP9PJBACeaH_xQRHZ_1ydE7tVd7HdgdaEHfQ1jvKIHFkknWWOBAY1mlBc4YDirLShB_voShD8C-Hx3nF5sne5fleVfU-sZy6Za4B2U75PcE62oZgCPauOTAEm9Xuvrt5aMMovyzR8ecJZhm9bw7naU\", \"p\": \"5vJHCSM3H3q4RltYzENC9RyZZV8EUmpkv9moyguT5t-BUGA-T4W_FGIxzOPXRWOckIplKkoDKhavUeNmTZMCUcue0nkICSJpvNE4Nb2p5PZk_QqSdQNvCasQtdojEG0AmfVD85SU551CYxJdLdDFOqyK2entpMr8lhokem189As\", \"kid\": \"a1\", \"kty\": \"RSA\"}, {\"d\": \"S4_OufhLBgXFMgIDMI1zlVe2uCExpcEAQ80J_lXfS8I\", \"use\": \"sig\", \"crv\": \"P-256\", \"kty\": \"EC\", \"y\": \"DBdNyq30mXmUs_BIvKMqaTTNO7HDhCi0YiC8GciwNYk\", \"x\": \"cYwzBoyjRjxj334bRTqanONf7DUYK-6TgiuN0DixJAk\", \"kid\": \"a2\"}, {\"d\": \"33TnYgdJtWAiVosKqUnz0zSmvWTbsx5-6pceynW6Xck\", \"use\": \"enc\", \"crv\": \"P-256\", \"kty\": \"EC\", \"y\": \"Cula95Eix1Ia77St3OULe6-UKWs5I06nmdfUzhXUQTs\", \"x\": \"wk8HBVxNNzj1gJBxPmmx9XYW1L61ObBGzxpRa6_OqWU\", \"kid\": \"a3\"}]}, \"application_type\": \"web\", \"contacts\": [\"roland.hedberg@umu.se\"], \"post_logout_redirect_uris\": [\"https://op.certification.openid.net:60784/logout\"], \"redirect_uris\": [\"https://op.certification.openid.net:60784/authz_cb\"], \"response_types\": [\"code\"], \"require_auth_time\": true, \"grant_types\": [\"authorization_code\"], \"default_max_age\": 3600}";
OIDCClientRepresentation clientRep = JsonSerialization.readValue(stringRep, OIDCClientRepresentation.class);
Assert.assertNotNull(clientRep.getJwks());
}
}
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
+7 -2
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>keycloak-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>2.1.0-SNAPSHOT</version>
<version>2.2.0.Final</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -83,7 +83,6 @@
<groupId>org.keycloak</groupId>
<artifactId>keycloak-kerberos-federation</artifactId>
</dependency>
<!-- saml -->
<dependency>
<groupId>org.keycloak</groupId>
@@ -110,6 +109,12 @@
</exclusions>
</dependency>
<!-- Dependencies for RHEL IdM -->
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-sssd-federation</artifactId>
</dependency>
<!-- Built-in Authorization Policy Providers -->
<dependency>
<groupId>org.keycloak</groupId>
Loaded 100 of 1062 files, more files were not shown because too many files have changed in this diff. Show more