SlideShare a Scribd company logo
1 of 5
Download to read offline
Janua – SARL au capital de 30 000 € - 8 Chemin du bas Lauron – 06 650 Le Rouret
Tél. 0 950 260 370 – Fax. 0 955 260 370
Siret : 478 075 369 00015 - http://www.janua.fr
Page 4 / 159
Table of contents
1 Prerequisites.............................................................................................................................................9
1.1 Hardware requirements.......................................................................................................................9
1.2 Software requirements ........................................................................................................................9
1.3 Tools....................................................................................................................................................9
1.4 Keycloak documentation ...................................................................................................................10
1.5 Keycloak code sources .....................................................................................................................11
2 Using Keycloak SPI – add a custom Event Listener module .................................................................12
2.1 Presentation ......................................................................................................................................12
2.2 Prerequisites .....................................................................................................................................12
2.3 Deploy event listener module............................................................................................................12
2.4 Configure Event Listener in Keycloak ...............................................................................................13
2.5 Test....................................................................................................................................................14
2.6 Save events in DB.............................................................................................................................14
2.7 A look at the code..............................................................................................................................16
3 Use Eclipse/IntelliJ to debug Keycloak SPIs..........................................................................................18
3.1 Presentation ......................................................................................................................................18
3.2 Prerequisites .....................................................................................................................................18
3.3 Launch Keycloak server in debug mode...........................................................................................18
3.4 Debug with Eclipse............................................................................................................................18
3.4.1 Import keycloak-quickstarts project in Eclipse..........................................................................18
3.4.2 Attach Eclipse Debugger to Keycloak ......................................................................................20
3.4.3 Set a breakpoint........................................................................................................................21
3.4.4 Trigger breakpoint in EventListener SPI...................................................................................21
3.5 Debug with IntelliJ .............................................................................................................................22
3.5.1 Import keycloak-quickstarts project in IntelliJ ...........................................................................22
3.5.2 Attach IntelliJ Debugger to Keycloak........................................................................................23
3.5.3 Set a breakpoint........................................................................................................................24
3.5.4 Trigger breakpoint in EventListener SPI...................................................................................24
4 Keycloak logger......................................................................................................................................26
4.1 Presentation ......................................................................................................................................26
4.2 Adjust the log dynamically.................................................................................................................26
4.2.1 Read the current root-logger value...........................................................................................26
4.2.2 Update the root-logger value ....................................................................................................26
5 Keycloak Multifactor authentication (MFA) using OTP...........................................................................28
5.1 Presentation ......................................................................................................................................28
5.2 Prerequisites .....................................................................................................................................28
5.3 Create demo_otp realm.....................................................................................................................28
5.4 Modify demo_otp Authentication Workflow.......................................................................................28
5.5 Authentication of a user for the 1
st
time.............................................................................................29
5.6 Authentication of a user (after 1
st
time) .............................................................................................30
5.7 Keycloak OTP ...................................................................................................................................32
6 MFA with Keycloak.................................................................................................................................33
6.1 Presentation ......................................................................................................................................33
6.2 Keycloak OTP MFA versus SMS-OTP..............................................................................................33
6.3 LOA concepts and MFA usage .........................................................................................................33
6.4 Keycloak Authentication flow and MFA.............................................................................................33
6.4.1 Keycloak 3.4.3 ..........................................................................................................................33
6.4.2 Keycloak 4.6 .............................................................................................................................34
Janua – SARL au capital de 30 000 € - 8 Chemin du bas Lauron – 06 650 Le Rouret
Tél. 0 950 260 370 – Fax. 0 955 260 370
Siret : 478 075 369 00015 - http://www.janua.fr
Page 5 / 159
6.4.3 Upcoming releases – Jira tickets..............................................................................................34
6.5 Keycloak MFA synthesis ...................................................................................................................34
7 Multi tenancy with Keycloak ...................................................................................................................36
7.1 Keycloak quickstart multi tenancy example ......................................................................................36
7.1.1 Prerequisites.............................................................................................................................36
7.1.2 Create 2 realms on Keycloak....................................................................................................36
7.1.3 Deploy the multi-tenant app on WildFly....................................................................................37
7.1.4 Test...........................................................................................................................................38
8 Map LDAP Group to Keycloak Roles .....................................................................................................40
8.1 Presentation ......................................................................................................................................40
8.2 LDAP Group to Keycloak roles mapping workflow ...........................................................................40
8.3 Prerequisites .....................................................................................................................................40
8.4 Examine LDAP example using JXplorer ...........................................................................................40
8.5 Configure ldap user federation in Keycloak ......................................................................................42
8.5.1 Define LDAP synchronisation...................................................................................................42
8.6 Add group ldap mapper.....................................................................................................................43
8.6.1 Create ldap group mapping ......................................................................................................43
8.6.2 Synchronize ldap group mapping .............................................................................................44
8.7 Add SSO Role to Keycloak group .....................................................................................................45
8.8 Test....................................................................................................................................................45
8.8.1 Create a new ldap user.............................................................................................................45
8.8.2 Ldap-user part part of ldap-admin group ..................................................................................46
8.8.3 Keycloak ldap synchronization .................................................................................................46
8.8.4 New user with Keycloak role admin rights................................................................................47
8.9 Log to the admin console with a new admin user .............................................................................47
9 Use Client Scope in Keycloak ................................................................................................................49
9.1 Presentation ......................................................................................................................................49
9.2 Scope and claims Openid Core definition.........................................................................................49
9.3 Using Scope and Claims...................................................................................................................50
9.4 Prerequisites .....................................................................................................................................50
9.5 Accessing the access token using direct grant .................................................................................50
9.6 Get access token using ROPC workflow ..........................................................................................51
9.7 Add user federation mapper for mobile number ...............................................................................52
9.8 Create a new scope to expose mobileNumber claim........................................................................54
9.8.1 Create mobileNumber scope within ldap-demo realm..............................................................54
9.8.2 Create a mapper of mobileNumber scope................................................................................55
9.8.3 Add new scope mobileNumber to optional client scopes .........................................................58
9.9 Use the new scope mobileNumber ...................................................................................................58
9.10 Use Keycloak Generator to evaluate scope .................................................................................60
10 Understand client authenticator security ................................................................................................62
10.1 client_id/client_secret security issue ............................................................................................62
10.2 Using other Keycloak client authenticator ....................................................................................62
10.3 Using Signed JWT client authenticator.........................................................................................62
10.4 JWKS_URI....................................................................................................................................63
11 Understanding Token usage ..................................................................................................................64
11.1 Token Lifecycle.............................................................................................................................64
11.2 Understand Keycloak session ......................................................................................................65
11.2.1 Session creation ...................................................................................................................65
11.2.2 Session usage ......................................................................................................................65
11.2.3 Session termination ..............................................................................................................65
11.2.4 Importance of session control – Potential security vulnerability...........................................66
Janua – SARL au capital de 30 000 € - 8 Chemin du bas Lauron – 06 650 Le Rouret
Tél. 0 950 260 370 – Fax. 0 955 260 370
Siret : 478 075 369 00015 - http://www.janua.fr
Page 6 / 159
11.3 Keycloak Access Token................................................................................................................66
11.4 Offline session and offline token...................................................................................................67
11.4.1 Offline token introduction ......................................................................................................67
11.4.2 Offline session main features ...............................................................................................68
11.4.3 Offline token main features...................................................................................................68
11.4.4 Revoke refresh token flag.....................................................................................................69
11.4.5 Offline Session Max Limited .................................................................................................69
11.4.6 Revoke offline token .............................................................................................................69
12 Examples of Offline token usage............................................................................................................71
12.1 Prerequisites.................................................................................................................................71
12.2 Offline Token through direct access grant flow ............................................................................71
12.2.1 Add offline-access role to the user .......................................................................................71
12.2.2 Adjust token lifespan.............................................................................................................71
12.2.3 Set the maximum invokation of refresh token ......................................................................72
12.2.4 Get an offline token...............................................................................................................73
12.3 Revoke the offline token ...............................................................................................................74
12.3.1 Revoke the offline token through the admin UI ....................................................................75
12.3.2 Revoke the offline token through the user self service panel...............................................75
12.4 Impact of offline_access scope.....................................................................................................75
12.4.1 Request without offline_access scope .................................................................................75
12.4.2 Request with offline_access scope.......................................................................................76
12.5 Offline token through authorization code flow ..............................................................................77
12.5.1 Prerequisites.........................................................................................................................77
12.5.2 Build and deploy offline-access-app webapp .......................................................................77
12.6 Offline-access-portal application test............................................................................................79
12.6.1 Use Kcadm to monitor the offline sessions ..........................................................................87
12.7 Synthesis / Best practices with offline tokens...............................................................................88
13 Understanding Keycloak user Federation ..............................................................................................89
13.1 Overview.......................................................................................................................................89
13.2 User Federation storage Provider.................................................................................................89
13.3 Keycloak default local userstorage (SQL database) ....................................................................89
13.3.1 Synchronize LDAP users to keycloak...................................................................................89
13.3.2 Synchronize newly created Keycloak users to LDAP..........................................................90
13.3.3 Deal with Keycloak – LDAP synchronization parameter ......................................................90
13.4 Use Keycloak user Federation SPI...............................................................................................91
13.5 Using Keycloak Provider interfaces..............................................................................................91
13.6 User storage simple providers......................................................................................................91
13.6.1 Prerequisites.........................................................................................................................92
13.6.2 Deploy user-storage-sample providers.................................................................................92
13.6.3 Enable the “readonly-property-file” provider for the Master realm........................................93
13.6.4 Test the “readonly-property-file” provider .............................................................................93
13.6.5 Enable the “writeable-property-file” provider for the Master realm .......................................94
13.6.6 Test the “writeable-property-file” provider.............................................................................95
13.6.7 Display all the users..............................................................................................................95
13.7 User storage JPA provider............................................................................................................96
13.7.1 Presentation..........................................................................................................................96
13.7.2 Prerequisites.........................................................................................................................96
13.7.3 Deploy the datasource..........................................................................................................96
13.7.4 Check XA data source with Keycloak console management ...............................................98
13.7.5 Deploy user-storage-jpa provider .........................................................................................98
13.7.6 Using JPA .............................................................................................................................99
Janua – SARL au capital de 30 000 € - 8 Chemin du bas Lauron – 06 650 Le Rouret
Tél. 0 950 260 370 – Fax. 0 955 260 370
Siret : 478 075 369 00015 - http://www.janua.fr
Page 7 / 159
13.7.7 Enable the “user-storage-jpa” provider for the Master realm ...............................................99
13.7.8 Display all the users............................................................................................................100
13.7.9 Test the “user-storage-jpa” provider ...................................................................................100
14 Understanding Keycloak Authentication ..............................................................................................102
14.1 Presentation................................................................................................................................102
14.2 Authentication Flow ....................................................................................................................103
14.2.1 Built-in browser authentication flow ....................................................................................104
14.2.2 Direct Authentication Grant flow .........................................................................................106
14.2.3 Registration Flow ................................................................................................................106
14.2.4 Reset Credentials ...............................................................................................................106
14.2.5 First Broker Login Flow.......................................................................................................107
14.2.6 Client authentication flow....................................................................................................108
14.3 Required Actions ........................................................................................................................108
14.4 Customize authenticator flow......................................................................................................110
14.4.1 Prerequisites.......................................................................................................................110
14.4.2 Build and deploy the customized authenticator flow ..........................................................110
14.4.3 Configure the custom authentication flow in Keycloak .......................................................112
14.4.4 Test.....................................................................................................................................115
15 Using apache2 mod_auth_openidc module with Keycloak (OpenID Connect) ...................................117
15.1 Presentation................................................................................................................................117
15.2 openID protocol recap ................................................................................................................117
15.3 Putting mod_auth_openidc in place ...........................................................................................118
15.4 Enabling mod_auth_openidc module with apache2...................................................................118
15.4.1 Getting hold of the library....................................................................................................118
15.4.2 Configuring keycloak Server for mod_auth_openidc.........................................................119
15.5 Configuration of mod_auth_openidc module..............................................................................120
15.6 Example......................................................................................................................................121
15.7 Using the hook mod_auth_openidc ............................................................................................122
15.8 Keycloak and NGINX..................................................................................................................122
16 Using UMA and Keycloak..............................................................................................................123
16.1 Presentation – What is UMA ?.............................................................................................123
16.2 Pointers.......................................................................................................................................123
16.3 UMA Key stakeholders.........................................................................................................123
16.4 UMA workflow..........................................................................................................................123
16.5 UMA typical use case.........................................................................................................124
16.6 Illustration of a RPT token (Request Party Token)..........................................126
16.7 Illustration of a resource (Keycloak)....................................................................127
16.8 Using permission .................................................................................................................128
16.9 Request approval or revokation...................................................................................128
16.10 UMA with Keycloak – Improve application productivity...................................129
17 UMA photoz keycloak example...................................................................................................130
17.1 Presentation..........................................................................................................................130
17.2 Deploying uma photoz example .......................................................................................130
17.2.1 Starting keycloak .......................................................................................................130
17.2.2 Starting wildfly .........................................................................................................130
17.2.3 Deploy app-authz-uma-photoz example.......................................................................130
17.2.4 Uploading uma-photoz config file.......................................................................131
17.3 Presentation of uma_photoz application .................................................................131
17.3.1 Uma_photoz architecture ..........................................................................................131
17.3.2 Uma_photoz actions.....................................................................................................132
Janua – SARL au capital de 30 000 € - 8 Chemin du bas Lauron – 06 650 Le Rouret
Tél. 0 950 260 370 – Fax. 0 955 260 370
Siret : 478 075 369 00015 - http://www.janua.fr
Page 8 / 159
17.3.3 Uma_photoz policy .......................................................................................................132
17.4 Photoz-restful-api application...................................................................................132
17.4.1 Photoz-restful-api settings .................................................................................132
17.4.2 Photoz-restful-api Resources ...............................................................................133
17.4.3 Authorization scopes.................................................................................................135
17.4.4 Policies...........................................................................................................................136
17.4.5 Permission ......................................................................................................................138
Scope base permission ................................................................................................................138
17.5 UMA-Photoz Lifecycle.........................................................................................................139
17.5.1 after login ....................................................................................................................139
17.5.2 listing resource created........................................................................................139
17.5.3 Sharing Resource .........................................................................................................140
17.5.4 Listing Resources of Alice....................................................................................140
17.5.5 Logging as Jdoe ...........................................................................................................141
17.6 Request Approbation Lifecycle.....................................................................................142
17.6.1 Pending approval request........................................................................................142
17.6.2 Request revokation...................................................................................................142
18 Accessing UMA through REST API.............................................................................................143
18.1 Presentation..........................................................................................................................143
18.2 Scenarios.................................................................................................................................143
18.3 scripts used..........................................................................................................................144
18.3.1 access_token..................................................................................................................144
18.3.2 UMA ticket request.....................................................................................................144
18.3.3 RPT token request (no persistence permission) ..........................................144
18.3.4 RPT token request (persisting permission)...................................................144
18.3.5 UMA access using RPT.................................................................................................144
18.4 Scenario1.................................................................................................................................145
18.4.1 Reminder of (1) alice has created an album alice3 ...............................145
18.4.2 (6) Jdoe can access to the resourcethe scenario1....................................145
18.4.3 Step 1 – creation of Album alice1 ....................................................................145
18.4.4 Step2 creation of an RPT for Alice ..................................................................145
18.5 Scenario2.................................................................................................................................149
18.5.1 Reminder...........................................................................................................................149
18.5.2.................................................................................................................................................149
18.6 Listing all the resources..............................................................................................154
18.6.1 Resource_set endpoint ..............................................................................................154
18.6.2 PAT token (Protected access token) ..................................................................154
18.6.3 Listing all the resources......................................................................................154
18.6.4 Listing/zooming a particular resource............................................................155
18.6.5 Creation of a new resources .................................................................................155
18.7 Using permissions ...............................................................................................................156
18.7.1 step 1 - Jdoe trying to access A4 (403 - access unauthorized) .......156
18.7.2 A4 - Jdoe pending approval (alice action)...................................................156
18.7.3 Approving a pending request using REST API.................................................157
18.7.4 Revoking access to a resource.............................................................................158
18.7.5 Listing all permissions ..........................................................................................158
18.8 Pointers...................................................................................................................................159

More Related Content

What's hot

Rit 8.5.0 integration testing training student's guide
Rit 8.5.0 integration testing training student's guideRit 8.5.0 integration testing training student's guide
Rit 8.5.0 integration testing training student's guideDarrel Rader
 
Rit 8.5.0 virtualization training student's guide
Rit 8.5.0 virtualization training student's guideRit 8.5.0 virtualization training student's guide
Rit 8.5.0 virtualization training student's guideDarrel Rader
 
Batch script for nslookup range of ip address
Batch script for nslookup range of ip addressBatch script for nslookup range of ip address
Batch script for nslookup range of ip addressVCP Muthukrishna
 
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...Jitendra Bafna
 
Deploying Kafka Streams Applications with Docker and Kubernetes
Deploying Kafka Streams Applications with Docker and KubernetesDeploying Kafka Streams Applications with Docker and Kubernetes
Deploying Kafka Streams Applications with Docker and Kubernetesconfluent
 
Manual Balay - frigorifico americano 3 fa7787a
Manual Balay - frigorifico americano 3 fa7787aManual Balay - frigorifico americano 3 fa7787a
Manual Balay - frigorifico americano 3 fa7787aAlsako Electrodomésticos
 
Dell VMware Virtual SAN Ready Nodes
Dell VMware Virtual SAN Ready NodesDell VMware Virtual SAN Ready Nodes
Dell VMware Virtual SAN Ready NodesAndrew McDaniel
 
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...Tin Linn Soe
 
Rit 8.5.0 platform training student's guide
Rit 8.5.0 platform training student's guideRit 8.5.0 platform training student's guide
Rit 8.5.0 platform training student's guideDarrel Rader
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)HungWei Chiu
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation Linaro
 
Manual Balay - frigorifico amerciano 3 fal4656
Manual Balay - frigorifico amerciano 3 fal4656Manual Balay - frigorifico amerciano 3 fal4656
Manual Balay - frigorifico amerciano 3 fal4656Alsako Electrodomésticos
 
Kafka Security 101 and Real-World Tips
Kafka Security 101 and Real-World Tips Kafka Security 101 and Real-World Tips
Kafka Security 101 and Real-World Tips confluent
 
Builders guide ied_670_products
Builders guide ied_670_productsBuilders guide ied_670_products
Builders guide ied_670_productssunny2512
 
pfSense presentation
pfSense presentationpfSense presentation
pfSense presentationSimon Vass
 

What's hot (20)

Rit 8.5.0 integration testing training student's guide
Rit 8.5.0 integration testing training student's guideRit 8.5.0 integration testing training student's guide
Rit 8.5.0 integration testing training student's guide
 
Rit 8.5.0 virtualization training student's guide
Rit 8.5.0 virtualization training student's guideRit 8.5.0 virtualization training student's guide
Rit 8.5.0 virtualization training student's guide
 
Istio on Kubernetes
Istio on KubernetesIstio on Kubernetes
Istio on Kubernetes
 
Batch script for nslookup range of ip address
Batch script for nslookup range of ip addressBatch script for nslookup range of ip address
Batch script for nslookup range of ip address
 
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
 
Deploying Kafka Streams Applications with Docker and Kubernetes
Deploying Kafka Streams Applications with Docker and KubernetesDeploying Kafka Streams Applications with Docker and Kubernetes
Deploying Kafka Streams Applications with Docker and Kubernetes
 
Hi horse
Hi horseHi horse
Hi horse
 
Manual Balay - frigorifico americano 3 fa7787a
Manual Balay - frigorifico americano 3 fa7787aManual Balay - frigorifico americano 3 fa7787a
Manual Balay - frigorifico americano 3 fa7787a
 
Dell VMware Virtual SAN Ready Nodes
Dell VMware Virtual SAN Ready NodesDell VMware Virtual SAN Ready Nodes
Dell VMware Virtual SAN Ready Nodes
 
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
 
Ca 7 primer
Ca 7 primerCa 7 primer
Ca 7 primer
 
Rit 8.5.0 platform training student's guide
Rit 8.5.0 platform training student's guideRit 8.5.0 platform training student's guide
Rit 8.5.0 platform training student's guide
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
 
Manual Balay - frigorifico amerciano 3 fal4656
Manual Balay - frigorifico amerciano 3 fal4656Manual Balay - frigorifico amerciano 3 fal4656
Manual Balay - frigorifico amerciano 3 fal4656
 
Kafka Security 101 and Real-World Tips
Kafka Security 101 and Real-World Tips Kafka Security 101 and Real-World Tips
Kafka Security 101 and Real-World Tips
 
Builders guide ied_670_products
Builders guide ied_670_productsBuilders guide ied_670_products
Builders guide ied_670_products
 
Fmu90 ti
Fmu90 tiFmu90 ti
Fmu90 ti
 
SAP SCOT kurulum adımları
SAP SCOT kurulum adımlarıSAP SCOT kurulum adımları
SAP SCOT kurulum adımları
 
pfSense presentation
pfSense presentationpfSense presentation
pfSense presentation
 

Similar to TOC training Keycloak RedhatSSO advanced

Administrator guide
Administrator guideAdministrator guide
Administrator guiderturkman
 
Plesk 8.1 for Linux/UNIX
Plesk 8.1 for Linux/UNIXPlesk 8.1 for Linux/UNIX
Plesk 8.1 for Linux/UNIXwebhostingguy
 
06.Manual Eclipse Plus Lt
06.Manual Eclipse Plus Lt06.Manual Eclipse Plus Lt
06.Manual Eclipse Plus Ltenunpimpam.com
 
Parallels Business Automation - Standard Provider Guide
Parallels Business Automation - Standard Provider GuideParallels Business Automation - Standard Provider Guide
Parallels Business Automation - Standard Provider Guidewebhostingguy
 
Plesk 8.0 for Linux/UNIX
Plesk 8.0 for Linux/UNIXPlesk 8.0 for Linux/UNIX
Plesk 8.0 for Linux/UNIXwebhostingguy
 
Plesk 8.0 for Linux/UNIX
Plesk 8.0 for Linux/UNIXPlesk 8.0 for Linux/UNIX
Plesk 8.0 for Linux/UNIXwebhostingguy
 
Tally.erp 9 release notes
Tally.erp 9 release notesTally.erp 9 release notes
Tally.erp 9 release notesTdasolanki
 
At640 user manual_r_v1.0_d110728_en
 At640 user manual_r_v1.0_d110728_en At640 user manual_r_v1.0_d110728_en
At640 user manual_r_v1.0_d110728_enTran Thanh
 
Acrobat document
Acrobat documentAcrobat document
Acrobat documentesregroup
 
software-eng.pdf
software-eng.pdfsoftware-eng.pdf
software-eng.pdffellahi1
 
Youwe sap-ecc-r3-hana-e commerce-with-magento-mb2b-100717-1601-206
Youwe sap-ecc-r3-hana-e commerce-with-magento-mb2b-100717-1601-206Youwe sap-ecc-r3-hana-e commerce-with-magento-mb2b-100717-1601-206
Youwe sap-ecc-r3-hana-e commerce-with-magento-mb2b-100717-1601-206Dennis Reurings
 
Plesk 8.1 for Windows
Plesk 8.1 for WindowsPlesk 8.1 for Windows
Plesk 8.1 for Windowswebhostingguy
 
Plesk 8.1 for Linux/UNIX
Plesk 8.1 for Linux/UNIXPlesk 8.1 for Linux/UNIX
Plesk 8.1 for Linux/UNIXwebhostingguy
 
Plesk 8.1 for Linux/UNIX
Plesk 8.1 for Linux/UNIXPlesk 8.1 for Linux/UNIX
Plesk 8.1 for Linux/UNIXwebhostingguy
 

Similar to TOC training Keycloak RedhatSSO advanced (20)

Administrator guide
Administrator guideAdministrator guide
Administrator guide
 
Plesk 8.1 for Linux/UNIX
Plesk 8.1 for Linux/UNIXPlesk 8.1 for Linux/UNIX
Plesk 8.1 for Linux/UNIX
 
06.Manual Eclipse Plus Lt
06.Manual Eclipse Plus Lt06.Manual Eclipse Plus Lt
06.Manual Eclipse Plus Lt
 
Parallels Business Automation - Standard Provider Guide
Parallels Business Automation - Standard Provider GuideParallels Business Automation - Standard Provider Guide
Parallels Business Automation - Standard Provider Guide
 
2226 v3 rev_a
2226 v3 rev_a2226 v3 rev_a
2226 v3 rev_a
 
Reseller's Guide
Reseller's GuideReseller's Guide
Reseller's Guide
 
Plesk 8.0 for Linux/UNIX
Plesk 8.0 for Linux/UNIXPlesk 8.0 for Linux/UNIX
Plesk 8.0 for Linux/UNIX
 
Plesk 8.0 for Linux/UNIX
Plesk 8.0 for Linux/UNIXPlesk 8.0 for Linux/UNIX
Plesk 8.0 for Linux/UNIX
 
Tally.erp 9 release notes
Tally.erp 9 release notesTally.erp 9 release notes
Tally.erp 9 release notes
 
At640 user manual_r_v1.0_d110728_en
 At640 user manual_r_v1.0_d110728_en At640 user manual_r_v1.0_d110728_en
At640 user manual_r_v1.0_d110728_en
 
Acrobat document
Acrobat documentAcrobat document
Acrobat document
 
software-eng.pdf
software-eng.pdfsoftware-eng.pdf
software-eng.pdf
 
2 x applicationserver
2 x applicationserver2 x applicationserver
2 x applicationserver
 
Youwe sap-ecc-r3-hana-e commerce-with-magento-mb2b-100717-1601-206
Youwe sap-ecc-r3-hana-e commerce-with-magento-mb2b-100717-1601-206Youwe sap-ecc-r3-hana-e commerce-with-magento-mb2b-100717-1601-206
Youwe sap-ecc-r3-hana-e commerce-with-magento-mb2b-100717-1601-206
 
Business objects51en
Business objects51enBusiness objects51en
Business objects51en
 
Plesk 8.1 for Windows
Plesk 8.1 for WindowsPlesk 8.1 for Windows
Plesk 8.1 for Windows
 
Plesk 8.1 for Linux/UNIX
Plesk 8.1 for Linux/UNIXPlesk 8.1 for Linux/UNIX
Plesk 8.1 for Linux/UNIX
 
Plesk 8.1 for Linux/UNIX
Plesk 8.1 for Linux/UNIXPlesk 8.1 for Linux/UNIX
Plesk 8.1 for Linux/UNIX
 
UsersGuide
UsersGuideUsersGuide
UsersGuide
 
UsersGuide
UsersGuideUsersGuide
UsersGuide
 

More from Pascal Flamand

Start14 french tech startuffe nation
Start14 french tech startuffe nationStart14 french tech startuffe nation
Start14 french tech startuffe nationPascal Flamand
 
Article "Un an de télétravail et de COVID" dans le magazine Start
Article "Un an de télétravail et de COVID" dans le magazine StartArticle "Un an de télétravail et de COVID" dans le magazine Start
Article "Un an de télétravail et de COVID" dans le magazine StartPascal Flamand
 
Article "La tyrannie du risque zéro" dans le magazine Start
Article "La tyrannie du risque zéro" dans le magazine StartArticle "La tyrannie du risque zéro" dans le magazine Start
Article "La tyrannie du risque zéro" dans le magazine StartPascal Flamand
 
Article "quand les licornes voleront..." dans le magazine Start
Article "quand les licornes voleront..." dans le magazine StartArticle "quand les licornes voleront..." dans le magazine Start
Article "quand les licornes voleront..." dans le magazine StartPascal Flamand
 
Article sur "Le temps des c(e)rises" dans le magazine Start
Article sur "Le temps des c(e)rises" dans le magazine StartArticle sur "Le temps des c(e)rises" dans le magazine Start
Article sur "Le temps des c(e)rises" dans le magazine StartPascal Flamand
 
Article sur l'Agilité dans le magazine Start
Article sur l'Agilité dans le magazine StartArticle sur l'Agilité dans le magazine Start
Article sur l'Agilité dans le magazine StartPascal Flamand
 
Article sur l'IA dans le magazine Start
Article sur l'IA dans le magazine StartArticle sur l'IA dans le magazine Start
Article sur l'IA dans le magazine StartPascal Flamand
 
Article sur la Smart City dans le magazine Start
Article sur la Smart City dans le magazine StartArticle sur la Smart City dans le magazine Start
Article sur la Smart City dans le magazine StartPascal Flamand
 
Article sur les Startup dans le magazine Start
Article sur les Startup dans le magazine StartArticle sur les Startup dans le magazine Start
Article sur les Startup dans le magazine StartPascal Flamand
 
TOC training Keycloak RedhatSSO advanced
TOC training Keycloak RedhatSSO advancedTOC training Keycloak RedhatSSO advanced
TOC training Keycloak RedhatSSO advancedPascal Flamand
 
TOC training KeyCloak Redhat SSO core
TOC training KeyCloak Redhat SSO coreTOC training KeyCloak Redhat SSO core
TOC training KeyCloak Redhat SSO corePascal Flamand
 
Article sur les Pitchs dans le magazine Start
Article sur les Pitchs dans le magazine StartArticle sur les Pitchs dans le magazine Start
Article sur les Pitchs dans le magazine StartPascal Flamand
 
Article sur la Transformation Digitale dans le Magazine Start
Article sur la Transformation Digitale dans le Magazine StartArticle sur la Transformation Digitale dans le Magazine Start
Article sur la Transformation Digitale dans le Magazine StartPascal Flamand
 
Article sur l'IA dans le magazine Start
Article sur l'IA dans le magazine StartArticle sur l'IA dans le magazine Start
Article sur l'IA dans le magazine StartPascal Flamand
 
Tribune paca jaguards 12.12.18
Tribune paca jaguards 12.12.18Tribune paca jaguards 12.12.18
Tribune paca jaguards 12.12.18Pascal Flamand
 
Partenariat Jaguards - Busit
Partenariat Jaguards - BusitPartenariat Jaguards - Busit
Partenariat Jaguards - BusitPascal Flamand
 
La tribune ce que booster apporte à semantic experts
La tribune   ce que booster apporte à semantic expertsLa tribune   ce que booster apporte à semantic experts
La tribune ce que booster apporte à semantic expertsPascal Flamand
 
OPENAM 13.5 - Core Token Service
OPENAM 13.5 - Core Token ServiceOPENAM 13.5 - Core Token Service
OPENAM 13.5 - Core Token ServicePascal Flamand
 
La tribune Jaguards juillet 2017
La tribune Jaguards juillet 2017La tribune Jaguards juillet 2017
La tribune Jaguards juillet 2017Pascal Flamand
 

More from Pascal Flamand (20)

Start14 french tech startuffe nation
Start14 french tech startuffe nationStart14 french tech startuffe nation
Start14 french tech startuffe nation
 
Article "Un an de télétravail et de COVID" dans le magazine Start
Article "Un an de télétravail et de COVID" dans le magazine StartArticle "Un an de télétravail et de COVID" dans le magazine Start
Article "Un an de télétravail et de COVID" dans le magazine Start
 
Article "La tyrannie du risque zéro" dans le magazine Start
Article "La tyrannie du risque zéro" dans le magazine StartArticle "La tyrannie du risque zéro" dans le magazine Start
Article "La tyrannie du risque zéro" dans le magazine Start
 
Article "quand les licornes voleront..." dans le magazine Start
Article "quand les licornes voleront..." dans le magazine StartArticle "quand les licornes voleront..." dans le magazine Start
Article "quand les licornes voleront..." dans le magazine Start
 
Article sur "Le temps des c(e)rises" dans le magazine Start
Article sur "Le temps des c(e)rises" dans le magazine StartArticle sur "Le temps des c(e)rises" dans le magazine Start
Article sur "Le temps des c(e)rises" dans le magazine Start
 
Article sur l'Agilité dans le magazine Start
Article sur l'Agilité dans le magazine StartArticle sur l'Agilité dans le magazine Start
Article sur l'Agilité dans le magazine Start
 
Article sur l'IA dans le magazine Start
Article sur l'IA dans le magazine StartArticle sur l'IA dans le magazine Start
Article sur l'IA dans le magazine Start
 
Article sur la Smart City dans le magazine Start
Article sur la Smart City dans le magazine StartArticle sur la Smart City dans le magazine Start
Article sur la Smart City dans le magazine Start
 
Article sur les Startup dans le magazine Start
Article sur les Startup dans le magazine StartArticle sur les Startup dans le magazine Start
Article sur les Startup dans le magazine Start
 
TOC training Keycloak RedhatSSO advanced
TOC training Keycloak RedhatSSO advancedTOC training Keycloak RedhatSSO advanced
TOC training Keycloak RedhatSSO advanced
 
TOC training KeyCloak Redhat SSO core
TOC training KeyCloak Redhat SSO coreTOC training KeyCloak Redhat SSO core
TOC training KeyCloak Redhat SSO core
 
TOC training OpenIDM
TOC training OpenIDMTOC training OpenIDM
TOC training OpenIDM
 
Article sur les Pitchs dans le magazine Start
Article sur les Pitchs dans le magazine StartArticle sur les Pitchs dans le magazine Start
Article sur les Pitchs dans le magazine Start
 
Article sur la Transformation Digitale dans le Magazine Start
Article sur la Transformation Digitale dans le Magazine StartArticle sur la Transformation Digitale dans le Magazine Start
Article sur la Transformation Digitale dans le Magazine Start
 
Article sur l'IA dans le magazine Start
Article sur l'IA dans le magazine StartArticle sur l'IA dans le magazine Start
Article sur l'IA dans le magazine Start
 
Tribune paca jaguards 12.12.18
Tribune paca jaguards 12.12.18Tribune paca jaguards 12.12.18
Tribune paca jaguards 12.12.18
 
Partenariat Jaguards - Busit
Partenariat Jaguards - BusitPartenariat Jaguards - Busit
Partenariat Jaguards - Busit
 
La tribune ce que booster apporte à semantic experts
La tribune   ce que booster apporte à semantic expertsLa tribune   ce que booster apporte à semantic experts
La tribune ce que booster apporte à semantic experts
 
OPENAM 13.5 - Core Token Service
OPENAM 13.5 - Core Token ServiceOPENAM 13.5 - Core Token Service
OPENAM 13.5 - Core Token Service
 
La tribune Jaguards juillet 2017
La tribune Jaguards juillet 2017La tribune Jaguards juillet 2017
La tribune Jaguards juillet 2017
 

Recently uploaded

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Recently uploaded (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 

TOC training Keycloak RedhatSSO advanced

  • 1. Janua – SARL au capital de 30 000 € - 8 Chemin du bas Lauron – 06 650 Le Rouret Tél. 0 950 260 370 – Fax. 0 955 260 370 Siret : 478 075 369 00015 - http://www.janua.fr Page 4 / 159 Table of contents 1 Prerequisites.............................................................................................................................................9 1.1 Hardware requirements.......................................................................................................................9 1.2 Software requirements ........................................................................................................................9 1.3 Tools....................................................................................................................................................9 1.4 Keycloak documentation ...................................................................................................................10 1.5 Keycloak code sources .....................................................................................................................11 2 Using Keycloak SPI – add a custom Event Listener module .................................................................12 2.1 Presentation ......................................................................................................................................12 2.2 Prerequisites .....................................................................................................................................12 2.3 Deploy event listener module............................................................................................................12 2.4 Configure Event Listener in Keycloak ...............................................................................................13 2.5 Test....................................................................................................................................................14 2.6 Save events in DB.............................................................................................................................14 2.7 A look at the code..............................................................................................................................16 3 Use Eclipse/IntelliJ to debug Keycloak SPIs..........................................................................................18 3.1 Presentation ......................................................................................................................................18 3.2 Prerequisites .....................................................................................................................................18 3.3 Launch Keycloak server in debug mode...........................................................................................18 3.4 Debug with Eclipse............................................................................................................................18 3.4.1 Import keycloak-quickstarts project in Eclipse..........................................................................18 3.4.2 Attach Eclipse Debugger to Keycloak ......................................................................................20 3.4.3 Set a breakpoint........................................................................................................................21 3.4.4 Trigger breakpoint in EventListener SPI...................................................................................21 3.5 Debug with IntelliJ .............................................................................................................................22 3.5.1 Import keycloak-quickstarts project in IntelliJ ...........................................................................22 3.5.2 Attach IntelliJ Debugger to Keycloak........................................................................................23 3.5.3 Set a breakpoint........................................................................................................................24 3.5.4 Trigger breakpoint in EventListener SPI...................................................................................24 4 Keycloak logger......................................................................................................................................26 4.1 Presentation ......................................................................................................................................26 4.2 Adjust the log dynamically.................................................................................................................26 4.2.1 Read the current root-logger value...........................................................................................26 4.2.2 Update the root-logger value ....................................................................................................26 5 Keycloak Multifactor authentication (MFA) using OTP...........................................................................28 5.1 Presentation ......................................................................................................................................28 5.2 Prerequisites .....................................................................................................................................28 5.3 Create demo_otp realm.....................................................................................................................28 5.4 Modify demo_otp Authentication Workflow.......................................................................................28 5.5 Authentication of a user for the 1 st time.............................................................................................29 5.6 Authentication of a user (after 1 st time) .............................................................................................30 5.7 Keycloak OTP ...................................................................................................................................32 6 MFA with Keycloak.................................................................................................................................33 6.1 Presentation ......................................................................................................................................33 6.2 Keycloak OTP MFA versus SMS-OTP..............................................................................................33 6.3 LOA concepts and MFA usage .........................................................................................................33 6.4 Keycloak Authentication flow and MFA.............................................................................................33 6.4.1 Keycloak 3.4.3 ..........................................................................................................................33 6.4.2 Keycloak 4.6 .............................................................................................................................34
  • 2. Janua – SARL au capital de 30 000 € - 8 Chemin du bas Lauron – 06 650 Le Rouret Tél. 0 950 260 370 – Fax. 0 955 260 370 Siret : 478 075 369 00015 - http://www.janua.fr Page 5 / 159 6.4.3 Upcoming releases – Jira tickets..............................................................................................34 6.5 Keycloak MFA synthesis ...................................................................................................................34 7 Multi tenancy with Keycloak ...................................................................................................................36 7.1 Keycloak quickstart multi tenancy example ......................................................................................36 7.1.1 Prerequisites.............................................................................................................................36 7.1.2 Create 2 realms on Keycloak....................................................................................................36 7.1.3 Deploy the multi-tenant app on WildFly....................................................................................37 7.1.4 Test...........................................................................................................................................38 8 Map LDAP Group to Keycloak Roles .....................................................................................................40 8.1 Presentation ......................................................................................................................................40 8.2 LDAP Group to Keycloak roles mapping workflow ...........................................................................40 8.3 Prerequisites .....................................................................................................................................40 8.4 Examine LDAP example using JXplorer ...........................................................................................40 8.5 Configure ldap user federation in Keycloak ......................................................................................42 8.5.1 Define LDAP synchronisation...................................................................................................42 8.6 Add group ldap mapper.....................................................................................................................43 8.6.1 Create ldap group mapping ......................................................................................................43 8.6.2 Synchronize ldap group mapping .............................................................................................44 8.7 Add SSO Role to Keycloak group .....................................................................................................45 8.8 Test....................................................................................................................................................45 8.8.1 Create a new ldap user.............................................................................................................45 8.8.2 Ldap-user part part of ldap-admin group ..................................................................................46 8.8.3 Keycloak ldap synchronization .................................................................................................46 8.8.4 New user with Keycloak role admin rights................................................................................47 8.9 Log to the admin console with a new admin user .............................................................................47 9 Use Client Scope in Keycloak ................................................................................................................49 9.1 Presentation ......................................................................................................................................49 9.2 Scope and claims Openid Core definition.........................................................................................49 9.3 Using Scope and Claims...................................................................................................................50 9.4 Prerequisites .....................................................................................................................................50 9.5 Accessing the access token using direct grant .................................................................................50 9.6 Get access token using ROPC workflow ..........................................................................................51 9.7 Add user federation mapper for mobile number ...............................................................................52 9.8 Create a new scope to expose mobileNumber claim........................................................................54 9.8.1 Create mobileNumber scope within ldap-demo realm..............................................................54 9.8.2 Create a mapper of mobileNumber scope................................................................................55 9.8.3 Add new scope mobileNumber to optional client scopes .........................................................58 9.9 Use the new scope mobileNumber ...................................................................................................58 9.10 Use Keycloak Generator to evaluate scope .................................................................................60 10 Understand client authenticator security ................................................................................................62 10.1 client_id/client_secret security issue ............................................................................................62 10.2 Using other Keycloak client authenticator ....................................................................................62 10.3 Using Signed JWT client authenticator.........................................................................................62 10.4 JWKS_URI....................................................................................................................................63 11 Understanding Token usage ..................................................................................................................64 11.1 Token Lifecycle.............................................................................................................................64 11.2 Understand Keycloak session ......................................................................................................65 11.2.1 Session creation ...................................................................................................................65 11.2.2 Session usage ......................................................................................................................65 11.2.3 Session termination ..............................................................................................................65 11.2.4 Importance of session control – Potential security vulnerability...........................................66
  • 3. Janua – SARL au capital de 30 000 € - 8 Chemin du bas Lauron – 06 650 Le Rouret Tél. 0 950 260 370 – Fax. 0 955 260 370 Siret : 478 075 369 00015 - http://www.janua.fr Page 6 / 159 11.3 Keycloak Access Token................................................................................................................66 11.4 Offline session and offline token...................................................................................................67 11.4.1 Offline token introduction ......................................................................................................67 11.4.2 Offline session main features ...............................................................................................68 11.4.3 Offline token main features...................................................................................................68 11.4.4 Revoke refresh token flag.....................................................................................................69 11.4.5 Offline Session Max Limited .................................................................................................69 11.4.6 Revoke offline token .............................................................................................................69 12 Examples of Offline token usage............................................................................................................71 12.1 Prerequisites.................................................................................................................................71 12.2 Offline Token through direct access grant flow ............................................................................71 12.2.1 Add offline-access role to the user .......................................................................................71 12.2.2 Adjust token lifespan.............................................................................................................71 12.2.3 Set the maximum invokation of refresh token ......................................................................72 12.2.4 Get an offline token...............................................................................................................73 12.3 Revoke the offline token ...............................................................................................................74 12.3.1 Revoke the offline token through the admin UI ....................................................................75 12.3.2 Revoke the offline token through the user self service panel...............................................75 12.4 Impact of offline_access scope.....................................................................................................75 12.4.1 Request without offline_access scope .................................................................................75 12.4.2 Request with offline_access scope.......................................................................................76 12.5 Offline token through authorization code flow ..............................................................................77 12.5.1 Prerequisites.........................................................................................................................77 12.5.2 Build and deploy offline-access-app webapp .......................................................................77 12.6 Offline-access-portal application test............................................................................................79 12.6.1 Use Kcadm to monitor the offline sessions ..........................................................................87 12.7 Synthesis / Best practices with offline tokens...............................................................................88 13 Understanding Keycloak user Federation ..............................................................................................89 13.1 Overview.......................................................................................................................................89 13.2 User Federation storage Provider.................................................................................................89 13.3 Keycloak default local userstorage (SQL database) ....................................................................89 13.3.1 Synchronize LDAP users to keycloak...................................................................................89 13.3.2 Synchronize newly created Keycloak users to LDAP..........................................................90 13.3.3 Deal with Keycloak – LDAP synchronization parameter ......................................................90 13.4 Use Keycloak user Federation SPI...............................................................................................91 13.5 Using Keycloak Provider interfaces..............................................................................................91 13.6 User storage simple providers......................................................................................................91 13.6.1 Prerequisites.........................................................................................................................92 13.6.2 Deploy user-storage-sample providers.................................................................................92 13.6.3 Enable the “readonly-property-file” provider for the Master realm........................................93 13.6.4 Test the “readonly-property-file” provider .............................................................................93 13.6.5 Enable the “writeable-property-file” provider for the Master realm .......................................94 13.6.6 Test the “writeable-property-file” provider.............................................................................95 13.6.7 Display all the users..............................................................................................................95 13.7 User storage JPA provider............................................................................................................96 13.7.1 Presentation..........................................................................................................................96 13.7.2 Prerequisites.........................................................................................................................96 13.7.3 Deploy the datasource..........................................................................................................96 13.7.4 Check XA data source with Keycloak console management ...............................................98 13.7.5 Deploy user-storage-jpa provider .........................................................................................98 13.7.6 Using JPA .............................................................................................................................99
  • 4. Janua – SARL au capital de 30 000 € - 8 Chemin du bas Lauron – 06 650 Le Rouret Tél. 0 950 260 370 – Fax. 0 955 260 370 Siret : 478 075 369 00015 - http://www.janua.fr Page 7 / 159 13.7.7 Enable the “user-storage-jpa” provider for the Master realm ...............................................99 13.7.8 Display all the users............................................................................................................100 13.7.9 Test the “user-storage-jpa” provider ...................................................................................100 14 Understanding Keycloak Authentication ..............................................................................................102 14.1 Presentation................................................................................................................................102 14.2 Authentication Flow ....................................................................................................................103 14.2.1 Built-in browser authentication flow ....................................................................................104 14.2.2 Direct Authentication Grant flow .........................................................................................106 14.2.3 Registration Flow ................................................................................................................106 14.2.4 Reset Credentials ...............................................................................................................106 14.2.5 First Broker Login Flow.......................................................................................................107 14.2.6 Client authentication flow....................................................................................................108 14.3 Required Actions ........................................................................................................................108 14.4 Customize authenticator flow......................................................................................................110 14.4.1 Prerequisites.......................................................................................................................110 14.4.2 Build and deploy the customized authenticator flow ..........................................................110 14.4.3 Configure the custom authentication flow in Keycloak .......................................................112 14.4.4 Test.....................................................................................................................................115 15 Using apache2 mod_auth_openidc module with Keycloak (OpenID Connect) ...................................117 15.1 Presentation................................................................................................................................117 15.2 openID protocol recap ................................................................................................................117 15.3 Putting mod_auth_openidc in place ...........................................................................................118 15.4 Enabling mod_auth_openidc module with apache2...................................................................118 15.4.1 Getting hold of the library....................................................................................................118 15.4.2 Configuring keycloak Server for mod_auth_openidc.........................................................119 15.5 Configuration of mod_auth_openidc module..............................................................................120 15.6 Example......................................................................................................................................121 15.7 Using the hook mod_auth_openidc ............................................................................................122 15.8 Keycloak and NGINX..................................................................................................................122 16 Using UMA and Keycloak..............................................................................................................123 16.1 Presentation – What is UMA ?.............................................................................................123 16.2 Pointers.......................................................................................................................................123 16.3 UMA Key stakeholders.........................................................................................................123 16.4 UMA workflow..........................................................................................................................123 16.5 UMA typical use case.........................................................................................................124 16.6 Illustration of a RPT token (Request Party Token)..........................................126 16.7 Illustration of a resource (Keycloak)....................................................................127 16.8 Using permission .................................................................................................................128 16.9 Request approval or revokation...................................................................................128 16.10 UMA with Keycloak – Improve application productivity...................................129 17 UMA photoz keycloak example...................................................................................................130 17.1 Presentation..........................................................................................................................130 17.2 Deploying uma photoz example .......................................................................................130 17.2.1 Starting keycloak .......................................................................................................130 17.2.2 Starting wildfly .........................................................................................................130 17.2.3 Deploy app-authz-uma-photoz example.......................................................................130 17.2.4 Uploading uma-photoz config file.......................................................................131 17.3 Presentation of uma_photoz application .................................................................131 17.3.1 Uma_photoz architecture ..........................................................................................131 17.3.2 Uma_photoz actions.....................................................................................................132
  • 5. Janua – SARL au capital de 30 000 € - 8 Chemin du bas Lauron – 06 650 Le Rouret Tél. 0 950 260 370 – Fax. 0 955 260 370 Siret : 478 075 369 00015 - http://www.janua.fr Page 8 / 159 17.3.3 Uma_photoz policy .......................................................................................................132 17.4 Photoz-restful-api application...................................................................................132 17.4.1 Photoz-restful-api settings .................................................................................132 17.4.2 Photoz-restful-api Resources ...............................................................................133 17.4.3 Authorization scopes.................................................................................................135 17.4.4 Policies...........................................................................................................................136 17.4.5 Permission ......................................................................................................................138 Scope base permission ................................................................................................................138 17.5 UMA-Photoz Lifecycle.........................................................................................................139 17.5.1 after login ....................................................................................................................139 17.5.2 listing resource created........................................................................................139 17.5.3 Sharing Resource .........................................................................................................140 17.5.4 Listing Resources of Alice....................................................................................140 17.5.5 Logging as Jdoe ...........................................................................................................141 17.6 Request Approbation Lifecycle.....................................................................................142 17.6.1 Pending approval request........................................................................................142 17.6.2 Request revokation...................................................................................................142 18 Accessing UMA through REST API.............................................................................................143 18.1 Presentation..........................................................................................................................143 18.2 Scenarios.................................................................................................................................143 18.3 scripts used..........................................................................................................................144 18.3.1 access_token..................................................................................................................144 18.3.2 UMA ticket request.....................................................................................................144 18.3.3 RPT token request (no persistence permission) ..........................................144 18.3.4 RPT token request (persisting permission)...................................................144 18.3.5 UMA access using RPT.................................................................................................144 18.4 Scenario1.................................................................................................................................145 18.4.1 Reminder of (1) alice has created an album alice3 ...............................145 18.4.2 (6) Jdoe can access to the resourcethe scenario1....................................145 18.4.3 Step 1 – creation of Album alice1 ....................................................................145 18.4.4 Step2 creation of an RPT for Alice ..................................................................145 18.5 Scenario2.................................................................................................................................149 18.5.1 Reminder...........................................................................................................................149 18.5.2.................................................................................................................................................149 18.6 Listing all the resources..............................................................................................154 18.6.1 Resource_set endpoint ..............................................................................................154 18.6.2 PAT token (Protected access token) ..................................................................154 18.6.3 Listing all the resources......................................................................................154 18.6.4 Listing/zooming a particular resource............................................................155 18.6.5 Creation of a new resources .................................................................................155 18.7 Using permissions ...............................................................................................................156 18.7.1 step 1 - Jdoe trying to access A4 (403 - access unauthorized) .......156 18.7.2 A4 - Jdoe pending approval (alice action)...................................................156 18.7.3 Approving a pending request using REST API.................................................157 18.7.4 Revoking access to a resource.............................................................................158 18.7.5 Listing all permissions ..........................................................................................158 18.8 Pointers...................................................................................................................................159