<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Henning Hollermann &#8211; privacyID3A</title>
	<atom:link href="https://www.privacyidea.org/author/henning/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.privacyidea.org</link>
	<description>flexible, Open Source Multi Factor Authentication (2FA)</description>
	<lastBuildDate>Thu, 14 Nov 2024 11:40:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.privacyidea.org/wp-content/uploads/2016/06/cropped-only-logo-white-background-32x32.png</url>
	<title>Henning Hollermann &#8211; privacyID3A</title>
	<link>https://www.privacyidea.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>privacyIDEA 3.4 Released</title>
		<link>https://www.privacyidea.org/privacyidea-3-4-released/</link>
		
		<dc:creator><![CDATA[Henning Hollermann]]></dc:creator>
		<pubDate>Mon, 07 Sep 2020 22:27:38 +0000</pubDate>
				<category><![CDATA[release]]></category>
		<category><![CDATA[Dashboard]]></category>
		<category><![CDATA[Multi-Challenge]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=2090</guid>

					<description><![CDATA[multi challenges, admin dashboard and custom token types Today we release privacyIDEA 3.4. It comes with a bunch of new features which on the one hand enhance the usability and on the other increase the flexibility of the system even more. This version includes a first dashboard to welcome the admin user providing status information [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><strong>multi challenges, admin dashboard and custom token types</strong></p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="677" src="https://www.privacyidea.org/wp-content/uploads/2020/09/duplo-1981724_1920_privacyidea.org_-1024x677.jpg" alt="" class="wp-image-2148" srcset="https://www.privacyidea.org/wp-content/uploads/2020/09/duplo-1981724_1920_privacyidea.org_-1024x677.jpg 1024w, https://www.privacyidea.org/wp-content/uploads/2020/09/duplo-1981724_1920_privacyidea.org_-300x198.jpg 300w, https://www.privacyidea.org/wp-content/uploads/2020/09/duplo-1981724_1920_privacyidea.org_-768x508.jpg 768w, https://www.privacyidea.org/wp-content/uploads/2020/09/duplo-1981724_1920_privacyidea.org_-1536x1015.jpg 1536w, https://www.privacyidea.org/wp-content/uploads/2020/09/duplo-1981724_1920_privacyidea.org_.jpg 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><em>Today we release privacyIDEA 3.4. It comes with a bunch of new features which on the one hand enhance the usability and on the other increase the flexibility of the system even more. This version includes a first dashboard to welcome the admin user providing status information and shortcut links. The Multi-Challenge feature enables PIN resets via challenge-response and it is now easy to enhance privacyIDEA with new 3rd party token types without the need to change the core code.</em></p>



<h3 class="wp-block-heading">Challenge after Challenge &#8211; The Multiple Challenges with privacyIDEA</h3>



<p>privacyIDEA 3.4 can now send a new challenge in reply to a solved challenge. What does this mean? Well, think about using SMS tokens which are secured with an additional PIN. The users log in remotely at the VPN Gateway with privacyIDEA in the back-end. The company also decided to have the users change their pin every six months by using the enrollment policy <code>change_pin_every</code>. The <a rel="noreferrer noopener" href="https://privacyidea.readthedocs.io/en/latest/policies/authentication.html#change-pin-via-validate" target="_blank">new policy <code>change_pin_via_validate</code></a> allows the PIN change directly at the gateway via challenge-response. The developers at NetKnights work on a number of additional use cases for the Multi-Challenges. So far the PIN change and the indexed secret token support multiple challenges, but also the <a href="https://github.com/privacyidea/privacyidea/issues/2317" target="_blank" rel="noreferrer noopener">4eyes token will get this new feature soon</a>. Stay tuned!</p>



<figure class="wp-block-gallery columns-3 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_01.png"><img decoding="async" width="840" height="400" src="https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_01.png" alt="" data-id="2147" data-full-url="https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_01.png" data-link="https://www.privacyidea.org/?attachment_id=2147" class="wp-image-2147" srcset="https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_01.png 840w, https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_01-300x143.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_01-768x366.png 768w" sizes="(max-width: 840px) 100vw, 840px" /></a><figcaption class="blocks-gallery-item__caption">User logon</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_02.png"><img decoding="async" width="640" height="400" src="https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_02.png" alt="" data-id="2146" data-full-url="https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_02.png" data-link="https://www.privacyidea.org/?attachment_id=2146" class="wp-image-2146" srcset="https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_02.png 640w, https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_02-300x188.png 300w" sizes="(max-width: 640px) 100vw, 640px" /></a><figcaption class="blocks-gallery-item__caption">privacyIDEA requests a PIN change</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_03.png"><img loading="lazy" decoding="async" width="640" height="400" src="https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_03.png" alt="" data-id="2145" data-full-url="https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_03.png" data-link="https://www.privacyidea.org/?attachment_id=2145" class="wp-image-2145" srcset="https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_03.png 640w, https://www.privacyidea.org/wp-content/uploads/2020/09/Citrix_Gateway_03-300x188.png 300w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></figure></li></ul><figcaption class="blocks-gallery-caption">Allow changing the token PIN while authenticating at Netscaler.</figcaption></figure>



<h3 class="wp-block-heading">privacyIDEA Dashboard</h3>



<p>Why should every admin user look at the token list after login? privacyIDEA 3.4 changes this behavior by introducing a first dashboard feature. It can be enabled via policy and brings the attention to some more useful information. The dashboard displays the numbers of assigned tokens and unassigned hardware tokens. Especially the number of available hardware tokens is an important information, so that the administrator knows, when he should order new authentication devices.</p>



<p>Further information is the number of authentications within the last 24 hours, recent administrative changes, subscription info and quick links to policies and event handlers. </p>



<p>Since this is the first version of a dashboard for privacyIDEA, feedback is very welcome to identify the needs of the users.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://www.privacyidea.org/wp-content/uploads/2020/08/dashboard.png"><img loading="lazy" decoding="async" width="1024" height="451" src="https://www.privacyidea.org/wp-content/uploads/2020/08/dashboard-1024x451.png" alt="" class="wp-image-2141" srcset="https://www.privacyidea.org/wp-content/uploads/2020/08/dashboard-1024x451.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/08/dashboard-300x132.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/08/dashboard-768x338.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/08/dashboard-1536x676.png 1536w, https://www.privacyidea.org/wp-content/uploads/2020/08/dashboard.png 1911w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption>The administrator can see important information in a quick glance on the dashboard.</figcaption></figure></div>



<h3 class="wp-block-heading">SMS Flexibility &#8211; The Script SMS Provider</h3>



<p>With the Script SMS Provider, privacyIDEA is now able to use custom scripts to send messages. Although it was designed to reach out to internet-based SMS services (see this <a rel="noreferrer noopener" href="https://github.com/privacyidea/scripts/blob/master/toolbox/boomalert.py" target="_blank">script</a>), this feature opens the door to send OTP values to any arbitrary gateway like your own Jabber-Server or use any remote service of your liking. Also the popular HTTP SMS Provider was extended to support custom header fields.</p>



<h3 class="wp-block-heading">Which type should it be, please?</h3>



<p>During a validate/check request, privacyIDEA always checked all tokens of the given user to match the given PIN and OTP. Specifically in enterprise portal applications, where privacyIDEA is the back-end authentication solution, sometimes only a specific token type should be checked. For these cases, the software now contains a <a href="https://privacyidea.readthedocs.io/en/latest/policies/authorization.html#tokentype" target="_blank" rel="noreferrer noopener">policy to allow the <code>type</code></a> parameter in the validate/check request.</p>



<h3 class="wp-block-heading">Custom token types for faster development</h3>



<p>privacyIDEA 3.4 facilitates the implementation of third-party token types. This basically enables the development of tailored features without the need to touch the core code of privacyIDEA. For customers, this means that the solutions to their specific use cases do not have to wait for the standard release-cycle.</p>



<p>There are a lot more minor features and fixes. The complete <a href="https://github.com/privacyidea/privacyidea/blob/master/Changelog" target="_blank" rel="noreferrer noopener">changelog</a> can be found at Github.</p>



<h3 class="wp-block-heading">Enterprise-grade 2FA with privacyIDEA</h3>



<p>privacyIDEA is an enterprise-grade open-source multi-factor-authentication solution. The development on Github is driven by the company NetKnights GmbH but contributions from the community are very welcome. For privacyIDEA open source means that you will be able to run it forever, <em>without</em> the fear of an <a rel="noreferrer noopener" href="https://netknights.it/en/consolidation-of-the-market-and-migrations/" target="_blank">end-of-life scenario</a>. If you want to participate in privacyIDEA, read <a rel="noreferrer noopener" href="https://github.com/privacyidea/privacyidea/blob/master/CONTRIBUTING.md" target="_blank">our contributing guide at Github</a>. You can discuss about privacyIDEA and share your use case in the privacyIDEA <a rel="noreferrer noopener" href="https://community.privacyidea.org/" target="_blank">community</a>. Open source also means that the code comes without any warranty. NetKnights provides <a href="https://netknights.it/en/produkte/privacyidea/" target="_blank" rel="noreferrer noopener">professional support for enterprise customers in three different levels</a>.</p>



<p>privacyIDEA 3.4 can be installed from the <a href="https://github.com/privacyidea/" target="_blank" rel="noreferrer noopener">Github sources</a>, from the Python Package index at <a href="https://pypi.org/project/privacyIDEA/" target="_blank" rel="noreferrer noopener">pypi.org</a> or with the <a href="https://privacyidea.readthedocs.io/en/latest/installation/ubuntu.html" target="_blank" rel="noreferrer noopener">community packages</a> for Ubuntu 16.04 LTS and 18.04 LTS. NetKnights will also offer <a href="https://netknights.it/en/additional-service-privacyidea-support-customers-centos-7-repository/" target="_blank" rel="noreferrer noopener">packages for CentOS/RHEL</a> in the <a href="https://netknights.it/en/produkte/privacyidea/" target="_blank" rel="noreferrer noopener">privacyIDEA Enterprise Edition</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>privacyIDEA 3.3 Released</title>
		<link>https://www.privacyidea.org/privacyidea-3-3-with-webauthn/</link>
					<comments>https://www.privacyidea.org/privacyidea-3-3-with-webauthn/#comments</comments>
		
		<dc:creator><![CDATA[Henning Hollermann]]></dc:creator>
		<pubDate>Mon, 06 Apr 2020 05:29:49 +0000</pubDate>
				<category><![CDATA[release]]></category>
		<category><![CDATA[Indexed Secret]]></category>
		<category><![CDATA[Release]]></category>
		<category><![CDATA[WebAuthn]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=1896</guid>

					<description><![CDATA[WebAuthn token support, event-based logging and more privacyIDEA 3.3 is out. The new version introduces a new Event Handler Module to enable custom event-driven logging. Also new in 3.3 is the support of WebAuthn tokens which come to privacyIDEA initially as a second-factor for WebUI login. WebAuthn Everybody speaks about WebAuthn becoming the global standard [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>WebAuthn token support, event-based logging and more</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="910" height="500" src="https://www.privacyidea.org/wp-content/uploads/2020/04/privacy3.3_webauthn2-1.png" alt="" class="wp-image-2005" srcset="https://www.privacyidea.org/wp-content/uploads/2020/04/privacy3.3_webauthn2-1.png 910w, https://www.privacyidea.org/wp-content/uploads/2020/04/privacy3.3_webauthn2-1-300x165.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/04/privacy3.3_webauthn2-1-768x422.png 768w" sizes="auto, (max-width: 910px) 100vw, 910px" /></figure>



<p><em>privacyIDEA 3.3 is out. The new version introduces a new Event Handler Module to enable custom event-driven logging. Also new in 3.3 is the support of WebAuthn tokens which come to privacyIDEA initially as a second-factor for WebUI login.</em></p>



<h3 class="wp-block-heading">WebAuthn</h3>



<p>Everybody speaks about WebAuthn becoming the global standard for web-based authentication to overcome phishing and man-in-the-middle attack scenarios. Indeed, <a href="https://www.w3.org/TR/webauthn/">WebAuthn, as specified by the W3C</a>, is a very flexible JavaScript-based API for user authentication. It is the successor of the U2F standard of the FIDO alliance and is, like its predecessor, phishing-resistant by using public-private key encryption in a TLS-secured challenge-response communication. However, WebAuthn has a far more general scope, as it is designed to work not only with U2F tokens but also with any other hardware which supports the API interface. WebAuthn will greatly extend the set of usable token devices e.g. to hardware crypto-chips which can be unlocked by a fingerprint-scanner. For the end user, this example case will result in a unique authentication experience with the fingerprint as apparent key-device. During the authentication process, the browser acts as relay between the WebAuthn security device (<em>authenticator)</em> and the service (<em>relying party)</em>.</p>



<h3 class="wp-block-heading">WebAuthn comes to privacyIDEA</h3>



<p>privacyIDEA initially implements WebAuthn to support WebAuthn/FIDO2 Hardware Token as second factors. You can configure privacyIDEA as your relying party, enroll WebAuthn Tokens with privacyIDEA and use them as a second factor to login to the WebUI. The following gallery shows the enrollment process.</p>



<figure class="wp-block-gallery columns-6 is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_00_Config-1024x554.png"><img loading="lazy" decoding="async" width="1024" height="554" src="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_00_Config-1024x554.png" alt="" data-id="1987" data-link="https://www.privacyidea.org/?attachment_id=1987" class="wp-image-1987" srcset="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_00_Config-1024x554.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_00_Config-300x162.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_00_Config-768x416.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_00_Config.png 1140w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_01_EnrollmentPolicy-1024x503.png"><img loading="lazy" decoding="async" width="1024" height="503" src="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_01_EnrollmentPolicy-1024x503.png" alt="" data-id="1988" data-link="https://www.privacyidea.org/?attachment_id=1988" class="wp-image-1988" srcset="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_01_EnrollmentPolicy-1024x503.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_01_EnrollmentPolicy-300x147.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_01_EnrollmentPolicy-768x378.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_01_EnrollmentPolicy-1536x755.png 1536w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_01_EnrollmentPolicy.png 1851w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_02_Enroll-Token-1024x519.png"><img loading="lazy" decoding="async" width="1024" height="519" src="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_02_Enroll-Token-1024x519.png" alt="" data-id="1989" data-link="https://www.privacyidea.org/?attachment_id=1989" class="wp-image-1989" srcset="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_02_Enroll-Token-1024x519.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_02_Enroll-Token-300x152.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_02_Enroll-Token-768x389.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_02_Enroll-Token-1536x778.png 1536w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_02_Enroll-Token.png 1854w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_03_Enroll-Token-1-1024x350.png"><img loading="lazy" decoding="async" width="1024" height="350" src="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_03_Enroll-Token-1-1024x350.png" alt="" data-id="1996" data-link="https://www.privacyidea.org/?attachment_id=1996" class="wp-image-1996" srcset="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_03_Enroll-Token-1-1024x350.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_03_Enroll-Token-1-300x102.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_03_Enroll-Token-1-768x262.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_03_Enroll-Token-1.png 1259w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_04_Enroll-Token-1.png"><img loading="lazy" decoding="async" width="1024" height="353" src="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_04_Enroll-Token-1-1024x353.png" alt="" data-id="1997" data-full-url="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_04_Enroll-Token-1.png" data-link="https://www.privacyidea.org/?attachment_id=1997" class="wp-image-1997" srcset="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_04_Enroll-Token-1-1024x353.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_04_Enroll-Token-1-300x103.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_04_Enroll-Token-1-768x265.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_04_Enroll-Token-1.png 1245w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_05_Enroll-Token-1024x411.png"><img loading="lazy" decoding="async" width="1024" height="411" src="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_05_Enroll-Token-1024x411.png" alt="" data-id="1992" data-link="https://www.privacyidea.org/?attachment_id=1992" class="wp-image-1992" srcset="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_05_Enroll-Token-1024x411.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_05_Enroll-Token-300x120.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_05_Enroll-Token-768x308.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_05_Enroll-Token.png 1035w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_06_Auth.png"><img loading="lazy" decoding="async" width="819" height="454" src="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_06_Auth.png" alt="" data-id="1993" data-link="https://www.privacyidea.org/?attachment_id=1993" class="wp-image-1993" srcset="https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_06_Auth.png 819w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_06_Auth-300x166.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/04/WebAuthn_06_Auth-768x426.png 768w" sizes="auto, (max-width: 819px) 100vw, 819px" /></a></figure></li></ul></figure>



<p>However, this is pretty much it for the moment since WebAuthn requires both service and client to support it properly. As the privacyIDEA server integrates with other services like simpleSAMLphp, Keycloak, Owncloud and others via plugins, those represent the client side. The following steps will therefore be to update the plugins accordingly. With the well-documented WebAuthn API flavored with coding examples, this is a fairly straightforward task (it still requires time). Everyone is invited to speed-up the process by contributing on Github. NetKnights, the company driving the development of privacyIDEA on Github, plans on developing an SDK to help plugin developers to integrate privacyIDEA with their favorite applications.</p>



<h3 class="wp-block-heading">Log Freely</h3>



<p>Already since privacyIDEA version 2.12, the event handler supports user notifications sent by email or SMS, triggered by custom events. privacyIDEA 3.2 introduced the ContainerAudit module to support multiple logging targets which enabled the default SQLAudit and other logging modules to receive logged messages. This might be used to <a href="https://www.privacyidea.org/event-based-logging-with-privacyidea-and-logstash">integrate privacyIDEA logging with central logging systems like Logstash ans Splunk</a>.</p>



<p>The new version 3.3 builds on this basis and pushes forward towards a completely customizable logging. The new <a href="https://privacyidea.readthedocs.io/en/latest/eventhandler/logginghandler.html">event handler module <em>Logging</em></a> basically implements a UserNotification which is not sent via external service but to the Python logging facility instead. As all Event Handlers in privacyIDEA, it can be bound to any event with all the usual possibilities to configure further constraints. The custom log messages support the variables known from the UserNotification handler to provide the administrator with maximum flexibility. The privacyIDEA advanced logging is configured via a <a href="https://privacyidea.readthedocs.io/en/latest/installation/system/logging.html">configuration file</a>. Starting with version 3.3, privacyIDEA supports both YAML and INI format for the logging configuration file. This new event handler offers great flexibility since not only what is logged can be configured to your needs but also where to. The logging name can be customized, which enables an easy separation of different types of information.</p>



<h3 class="wp-block-heading">Tell me your index: the Indexed Secret Token</h3>



<p>privacyIDEA comes with a new token type, called<em> Indexed Secret</em>. This challenge response token was requested to realize a second factor using already known shared secrets between an organization and its employees. The secret is stored in privacyIDEA for every user and during login a challenge is presented, asking the user e.g. for the 1st and 4th character in his secret. For the secret &#8220;Secret&#8221;, the user would have to answer by typing &#8220;Sr&#8221;.</p>



<p>The secret may also be preset with user attributes from the userstore. However, note that using the phone numbers of your employees represent a weak second factor attribute. The potential of this token is to support complex rollout scenarios to provide every user with a unique second factor, right from the start.</p>



<h3 class="wp-block-heading">Administer Transparently</h3>



<p>Previously the admin user for whom an admin policy should be in place could be specified in privacyIDEA. This could be for example a policy to allow enabling and disabling of tokens but not the deletion. The new version adds the possibility to add specific users that are to be managed by this policy. This helps a lot in the delegation of user management and segmentation of your administrative tasks.</p>



<p>There are now separate fields for the admin user and the user himself in the admin policy creation dialog.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/04/policy-condition-1024x759.png" alt="" class="wp-image-1986" width="768" height="569" srcset="https://www.privacyidea.org/wp-content/uploads/2020/04/policy-condition-1024x759.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/04/policy-condition-300x222.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/04/policy-condition-768x569.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/04/policy-condition.png 1118w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure>



<p>The complete <a href="https://github.com/privacyidea/privacyidea/blob/master/Changelog">changelog</a> can be found at Github.</p>



<h3 class="wp-block-heading">Start your independence now</h3>



<p>privacyIDEA is the flexible open-source multi-factor-authentication solution which runs on-premises. It is hosted on <a href="https://github.com/privacyidea/">Github</a> and can be run and extended by anyone free-of-charge. But it also comes without any warranty. NetKnights provides <a href="https://netknights.it/en/produkte/privacyidea/">professional support for enterprise customers in three different levels</a>. Open-source means for privacyIDEA, that you will always be able to run it, <em>without</em> the fear of an end-of-life scenario. You can also participate in the development, reporting bugs, suggesting features or create pull requests to have your own code included on Github. You can discuss about privacyIDEA and share your use case in the privacyIDEA <a href="https://community.privacyidea.org/">community</a>.</p>



<p>privacyIDEA 3.3 can be installed from the <a href="https://github.com/privacyidea/">Github sources</a>, from the Python Package index at <a href="https://pypi.org/project/privacyIDEA/">pypi.org</a> or with the <a href="https://privacyidea.readthedocs.io/en/latest/installation/ubuntu.html">community packages</a> for Ubuntu 16.04 LTS and 18.04 LTS. NetKnights will also offer <a href="https://netknights.it/en/additional-service-privacyidea-support-customers-centos-7-repository/">packages for CentOS/RHEL</a> in the <a href="https://netknights.it/en/produkte/privacyidea/">privacyIDEA Enterprise Edition</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/privacyidea-3-3-with-webauthn/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Event-based logging with privacyIDEA and Logstash</title>
		<link>https://www.privacyidea.org/event-based-logging-with-privacyidea-and-logstash/</link>
					<comments>https://www.privacyidea.org/event-based-logging-with-privacyidea-and-logstash/#comments</comments>
		
		<dc:creator><![CDATA[Henning Hollermann]]></dc:creator>
		<pubDate>Sun, 05 Apr 2020 23:17:25 +0000</pubDate>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Event Handler]]></category>
		<category><![CDATA[Logging]]></category>
		<category><![CDATA[logstash]]></category>
		<category><![CDATA[privacyIDEA]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=1900</guid>

					<description><![CDATA[Keeping track of the system logs in a complex environment with many hosts and even more services can be challenging. 
A sophisticated logging system with aggregation and filtering capabilities helps the administrator to stay ahead of things. 
This article shows how to integrate privacyIDEA in the centralized logging system provided by the elastic stack]]></description>
										<content:encoded><![CDATA[
<p>Keeping track of the system logs in a complex environment with many hosts and even more services can be challenging. A sophisticated logging system with aggregation and filtering capabilities helps the administrator to stay ahead of things. Popular examples are <a href="https://www.splunk.com/">Splunk</a> and <a href="https://www.elastic.co/logstash">Logstash</a>. Both are intrinsically supported by privacyIDEA, since the software builds on the standard python logging library. This article shows how to integrate privacyIDEA in the centralized logging system provided by the elastic stack which consists of the software components Logstash, Elasticsearch and Kibana.</p>



<p>We will use the privacyIDEA logging facility to let the server not only store its system logs and audit locally but also feed them to a remote Logstash server. We will also show how to use the new Logging module of the Event Handler, introduced in privacyIDEA 3.3, to customize the logged information. The usual path of information is displayed in the following picture.</p>



<figure class="wp-block-image alignwide size-large"><img loading="lazy" decoding="async" width="1024" height="163" src="https://www.privacyidea.org/wp-content/uploads/2020/03/privacyIDEA-ELK_2000-1024x163.png" alt="" class="wp-image-1904" srcset="https://www.privacyidea.org/wp-content/uploads/2020/03/privacyIDEA-ELK_2000-1024x163.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/03/privacyIDEA-ELK_2000-300x48.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/03/privacyIDEA-ELK_2000-768x122.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/03/privacyIDEA-ELK_2000-1536x245.png 1536w, https://www.privacyidea.org/wp-content/uploads/2020/03/privacyIDEA-ELK_2000.png 1997w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Setup the Base System</h3>



<p>As the installation Logstash, Elasticsearch and Kibana is documented at the <a href="https://www.elastic.co/guide/en/elastic-stack/current/installing-elastic-stack.html">vendors website</a>, we will not go into detail here. In any case, you need a java runtime environment. For Ubuntu you can use the package <code>default-jre</code>. Once you have the elastic stack up and running, turn towards privacyIDEA.</p>



<p>The installation of privacyIDEA is documented at <a href="https://privacyidea.readthedocs.io/en/latest/">privacyidea.readthedocs.io</a>. For a quick start, there is a community package repository for Ubuntu 18.04 LTS available. Install the privacyIDEA server and become a little familiar to the WebUI, which is the primary management interface.</p>



<p>The base configuration of privacyIDEA is set in the <a href="https://privacyidea.readthedocs.io/en/latest/installation/system/inifile.html">configuration file <code>pi.cfg</code></a> and the dedicated <a href="https://privacyidea.readthedocs.io/en/latest/installation/system/logging.html#advanced-logging">logging configuration file <code>logging.cfg</code> or <code>logging.yml</code></a>. In the default Ubuntu 18.04 package installation, those are located in /etc/privacyidea/. To be able to view the audit logs in the WebUI and send them at the same time to the python logger, the <a href="https://privacyidea.readthedocs.io/en/latest/audit/#container-audit">ContainerAudit</a> module is used.</p>



<pre class="wp-block-preformatted has-small-font-size"># /etc/privacyidea/pi.cfg
PI_AUDIT_MODULE = 'privacyidea.lib.auditmodules.containeraudit'
PI_AUDIT_CONTAINER_WRITE = ['privacyidea.lib.auditmodules.sqlaudit','privacyidea.lib.auditmodules.loggeraudit']
PI_AUDIT_CONTAINER_READ = 'privacyidea.lib.auditmodules.sqlaudit'
PI_AUDIT_LOGGER_QUALNAME = 'pi-audit'
PI_LOGCONFIG = '/etc/privacyidea/logging.cfg'</pre>



<p>Note that we use a custom audit logger name &#8220;pi-audit&#8221; in the above configuration. See the documentation of the <a href="https://privacyidea.readthedocs.io/en/latest/audit/index.html#logger-audit">Logger Audit</a>.</p>



<h3 class="wp-block-heading">Send privacyIDEA logs to Logstash</h3>



<p>The logging module <code>privacyidea.lib.auditmodules.loggeraudit</code> sends the audit messages to the python logging system and makes it available to the configuration by <code>logging.yml</code>. To send both the privacyIDEA server logs and the audit log to Logstash, the <a href="https://github.com/eht16/python-logstash-async">module <code>python-logstash-async</code></a> comes in handy. It can be installed through pip by</p>



<pre class="wp-block-preformatted has-small-font-size">~$ pip install python-logstash-async</pre>



<p>The module can be used in a <code>logging.cfg</code> or <code>logging.yml</code> in YAML and INI format respectively. <a href="https://gist.github.com/laclaro/a9ba8b6f1f1ed8f9de23d1383f71666c">Minimal examples for the configuration of the logstash-async module</a> are found on Github Gist. A <a href="https://gist.github.com/laclaro/6cbd3f51bba0041d5307569644a575fc">more detailed YAML configuration file</a> is also available, which provides a good basis for this test case.</p>



<p>Restart privacyidea for the changes to have effect. If you used the extended configuration from gist, you should now see the audit log in /var/log/privacyidea/audit.log.</p>



<h3 class="wp-block-heading">Receive privacyIDEA logs with Logstash</h3>



<p>On the other end, Logstash is configured to listen on port 5959 and to forward the logs to Elasticsearch using different indices for the qualnames pi-audit, pi-eventlog and all the rest (privacyidea.*).</p>



<pre class="wp-block-preformatted has-small-font-size"># /etc/logstash/conf.d/privacyidea_elasticsearch.conf
# privacyIDEA input is logged by the python-logstash-async module
input {
   tcp {
      port =&gt; 5959
      codec =&gt; json
      tags =&gt; ["privacyidea"]
   }
}
# filter adds metadata field according to logger to
# separate the privacyIDEA audit log from the rest
filter {
   if [extra][logger_name] == "pi-audit" or [extra][logger_name] == "privacyidea.lib.auditmodules.loggeraudit" {
      mutate { add_field =&gt; { "[@metadata][indexPrefix]" =&gt; "pi-audit" } }
   } else if [extra][logger_name] == "pi-eventlog" {
      mutate { add_field =&gt; { "[@metadata][indexPrefix]" =&gt; "pi-eventlog" } }
   } else {
      mutate { add_field =&gt; { "[@metadata][indexPrefix]" =&gt; "privacyidea" } }
   }
}
# Logs are sent to elasticsearch using the indexPrefix
output {
   elasticsearch {
      index =&gt; "%{[@metadata][indexPrefix]}-%{+YYYY.MM.dd}"
   }
   # additional output to syslog
   stdout {
      codec =&gt; rubydebug
   }
}</pre>



<p>Restart logstash afterwards. The output section contains an additional part for logging to stdout. On a systemd-driven system (check <code>~$ ps -p 1</code>), it can be viewed by</p>



<pre class="wp-block-preformatted has-small-font-size">~# journalctl -f -u logstash</pre>



<p>Once you interact with the privacyIDEA server, you should see the incoming audit log messages in json format in the journalctl ountput on the logstash machine. The example below is the audit message for viewing the audit log in the privacyIDEA WebUI:</p>



<pre class="wp-block-preformatted has-small-font-size">{
          "extra" =&gt; {
                    "logger_name" =&gt; "pi-audit",
                   "process_name" =&gt; "MainProcess",
                    "thread_name" =&gt; "MainThread",
                           "line" =&gt; 85,
         "logstash_async_version" =&gt; "1.6.4",
                           "path" =&gt; "/opt/privacyidea/privacyidea/lib/auditmodules/loggeraudit.py",
                      "func_name" =&gt; "finalize_log",
                    "interpreter" =&gt; "/opt/privacyidea/venv/bin/python",
            "interpreter_version" =&gt; "3.6.9"
     },
          "level" =&gt; "INFO",
        "program" =&gt; "/opt/privacyidea/pi-manage",
           "port" =&gt; 47962,
            "pid" =&gt; 10047,
      "logsource" =&gt; "myhost",
     "@timestamp" =&gt; 2020-03-25T15:32:42.748Z,
       "@version" =&gt; "1",
           "type" =&gt; "python-logstash",
        "message" =&gt; "{'success': True, 'serial': '<strong>', 'user': '</strong>', 'realm': '**', 'resolver': '', 'token_type': '', 'client': '127.0.0.1', 'client_user_agent': 'firefox', 'privacyidea_server': 'localhost:5000', 'action': 'GET /audit/', 'action_detail': '', 'info': '', 'administrator': 'admin', 'policies': '', 'timestamp': datetime.datetime(2020, 3, 25, 15, 32, 42, 748526)}",
           "host" =&gt; "henning-t470"
 }</pre>



<h3 class="wp-block-heading">Display privacyIDEA logs with Kibana</h3>



<p>The logs received by Logstash are sent to Elasticsearch which talks to the Kibana instance. The Elasticsearch indices should appear in Kibana&#8217;s index management, available from the home screen.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="273" height="154" src="https://www.privacyidea.org/wp-content/uploads/2020/03/kibana-index-patterns-button-1.png" alt="" class="wp-image-1917" style="width:205px;height:116px"/></figure>



<p>The privacyIDEA indices will look like shown below.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large is-resized"><a href="https://www.privacyidea.org/wp-content/uploads/2020/03/kibana-indices.png"><img loading="lazy" decoding="async" width="1024" height="437" src="https://www.privacyidea.org/wp-content/uploads/2020/03/kibana-indices-1024x437.png" alt="" class="wp-image-1911" style="width:768px;height:328px" srcset="https://www.privacyidea.org/wp-content/uploads/2020/03/kibana-indices-1024x437.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/03/kibana-indices-300x128.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/03/kibana-indices-768x328.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/03/kibana-indices.png 1082w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>Note: the yellow health status is due to a default index setting <code>"index.number_of_replicas": "1"</code>. Changing it to zero will result in a green status. Under &#8220;Data Views&#8221; create a new data view with the index-pattern &#8220;privacyidea*,pi-audit-*,pi-event*&#8221;.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full"><a href="https://www.privacyidea.org/wp-content/uploads/2024/11/Create-Data-View.png"><img loading="lazy" decoding="async" width="816" height="568" data-id="2362" src="https://www.privacyidea.org/wp-content/uploads/2024/11/Create-Data-View.png" alt="" class="wp-image-2362" srcset="https://www.privacyidea.org/wp-content/uploads/2024/11/Create-Data-View.png 816w, https://www.privacyidea.org/wp-content/uploads/2024/11/Create-Data-View-300x209.png 300w, https://www.privacyidea.org/wp-content/uploads/2024/11/Create-Data-View-768x535.png 768w" sizes="auto, (max-width: 816px) 100vw, 816px" /></a></figure>



<figure class="wp-block-image size-large"><a href="https://www.privacyidea.org/wp-content/uploads/2024/11/Logs_View.png"><img loading="lazy" decoding="async" width="1024" height="498" data-id="2363" src="https://www.privacyidea.org/wp-content/uploads/2024/11/Logs_View-1024x498.png" alt="" class="wp-image-2363" srcset="https://www.privacyidea.org/wp-content/uploads/2024/11/Logs_View-1024x498.png 1024w, https://www.privacyidea.org/wp-content/uploads/2024/11/Logs_View-300x146.png 300w, https://www.privacyidea.org/wp-content/uploads/2024/11/Logs_View-768x374.png 768w, https://www.privacyidea.org/wp-content/uploads/2024/11/Logs_View.png 1042w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</figure>



<p>In the Logs view, select the privacyIDEA data view you can select the log columns (&#8220;selected fields&#8221;) to be shown. The privacyIDEA log messages are now nicely display<em>ed.</em></p>



<figure class="wp-block-image alignwide size-large"><a href="https://www.privacyidea.org/wp-content/uploads/2024/11/Bild3.png"><img loading="lazy" decoding="async" width="1024" height="498" src="https://www.privacyidea.org/wp-content/uploads/2024/11/Bild3-1024x498.png" alt="" class="wp-image-2364" srcset="https://www.privacyidea.org/wp-content/uploads/2024/11/Bild3-1024x498.png 1024w, https://www.privacyidea.org/wp-content/uploads/2024/11/Bild3-300x146.png 300w, https://www.privacyidea.org/wp-content/uploads/2024/11/Bild3-768x374.png 768w, https://www.privacyidea.org/wp-content/uploads/2024/11/Bild3.png 1042w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Don&#8217;t forget to save!</p>



<h3 class="wp-block-heading">Event-based logging from privacyIDEA to Logstash</h3>



<p>New in <a href="https://www.privacyidea.org/privacyidea-3-3-with-webauthn/">privacyIDEA 3.3</a> is the Event Handler module &#8220;Logging&#8221;. With this module, custom logging messages can be bound to any event. This opens the door to a whole new world of monitoring possibilities in privacyIDEA. To demonstrate the feature, we simply log whenever a token is disabled &#8212; a silly example, of course. The Event Handler is created as shown below.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><a href="https://www.privacyidea.org/wp-content/uploads/2020/03/LoggingNotification4.png"><img loading="lazy" decoding="async" width="930" height="942" src="https://www.privacyidea.org/wp-content/uploads/2020/03/LoggingNotification4.png" alt="" class="wp-image-1928" style="width:698px;height:707px" srcset="https://www.privacyidea.org/wp-content/uploads/2020/03/LoggingNotification4.png 930w, https://www.privacyidea.org/wp-content/uploads/2020/03/LoggingNotification4-296x300.png 296w, https://www.privacyidea.org/wp-content/uploads/2020/03/LoggingNotification4-768x778.png 768w" sizes="auto, (max-width: 930px) 100vw, 930px" /></a></figure>
</div>


<p>For the Logging module, only one action is available. The log level, the name of the logger and a custom message are required. The message field supports variables known from the user notification module (see <a href="https://privacyidea.readthedocs.io/en/latest/eventhandler/logginghandler.html">documentation</a>). Note, that it depends on the context of the RESTful API event if a certain variable is available or not. </p>



<p>The chosen logger name has to be added as a logger in <code>logging.yml</code> to send it to Logstash.</p>



<pre class="wp-block-preformatted has-small-font-size">loggers:
  pi-eventlog:
    handlers:
      - logfile
      - logstash_async
    level: DEBUG</pre>



<p>Restart privacyIDEA to apply the changes in the config file <code>logging.yml</code>. After triggering the event by disabling a token in privacyIDEA, Kibana shows the notification.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="25" src="https://www.privacyidea.org/wp-content/uploads/2020/03/LoggingNotification3-1024x25.png" alt="" class="wp-image-1927" srcset="https://www.privacyidea.org/wp-content/uploads/2020/03/LoggingNotification3-1024x25.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/03/LoggingNotification3-300x7.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/03/LoggingNotification3-768x18.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/03/LoggingNotification3.png 1081w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Of course, you can use the logging event handler for more reasonable purposes like not to send the full audit log to logstash but to single-out the important validate-check events. You can even apply some more conditions, if you like making use of the powerful condition properties of the privacyIDEA Event Handlers. This not only spares bandwidth and storage space but prevents important information to be buried by other data. The message field in privacyIDEA can be used for a custom log message with contextual information. The configurable logger name (e.g. <em>pi-validate-check</em>) provides an additional identifier. In the case of suspicious behavior or a security incident, all the information is there to quickly track down the threat.</p>



<h3 class="wp-block-heading">Conclusion</h3>



<p>With this demonstration of the logging facility, privacyIDEA proves again to be extraordinarily scalable. It integrates well with logging systems like Logstash and Splunk since the privacyIDEA server builds on the standard python logging library. For Logstash, this article showed the detailed steps how to integrate privacyIDEA via the loggeraudit and a small third-party python module called <em>python-logstash-async</em>.</p>



<p>In privacyIDEA 3.3 the logging capabilities have been further extended by an Event Handler module which enables to conditionally log arbitrary events to the python logging system. We showed that also these messages can easily be passed to Logstash and open a vast playground custom logging.</p>



<p>The solution shown here is only one possible approach. Since privacyIDEA is available as open source an licensed under the AGPL, another possibility would be of course to write your very own logger module to do whatever <em>you</em> want. privacyIDEA is and will be always open source and therefore it will <em>always stay</em> in <em>your</em> hands.</p>



<p>If you would like to have a custom logger module, but have no time to  implement it yourself, you can always request a quote from <a href="https://netknights.it/en/">Netknights</a>, the company which drives the privacyIDEA innovation via <a href="https://github.com/privacyidea/">Github</a>. They also provide professional support for privacyIDEA, including enterprise repositories for Ubuntu and CentOS/RHEL containing the server and a number of additional components and tools.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/event-based-logging-with-privacyidea-and-logstash/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Versatile 2FA Single Sign-On with Keycloak and privacyIDEA</title>
		<link>https://www.privacyidea.org/versatile-2fa-single-sign-on-with-keycloak-and-privacyidea/</link>
					<comments>https://www.privacyidea.org/versatile-2fa-single-sign-on-with-keycloak-and-privacyidea/#comments</comments>
		
		<dc:creator><![CDATA[Henning Hollermann]]></dc:creator>
		<pubDate>Tue, 24 Mar 2020 17:53:00 +0000</pubDate>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[2FA]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[keycloak]]></category>
		<category><![CDATA[kolab]]></category>
		<category><![CDATA[OpenID Connect]]></category>
		<category><![CDATA[privacyIDEA]]></category>
		<category><![CDATA[Roundcubemail]]></category>
		<category><![CDATA[SSO]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=1772</guid>

					<description><![CDATA[The integration of privacyIDEA with Keycloak to provide a solid basis to secure your applications with a second factor in a single sign-on (SSO) environment. For maximum flexibility, the system relies on standard protocols such as SAML or OpenID Connect (OIDC). This article shows exemplarily the integration of Keykcloak, privacyIDEA and Kolab.]]></description>
										<content:encoded><![CDATA[
<p>In a <a href="https://netknights.it/en/single-sign-on-with-privacyidea/">previous article</a>, we wrote about benefits and risks of single sign-on (SSO) in enterprise environments and how a solid 2-factor-authentication solution as provided by privacyIDEA helps reduce risks. In this article we will demonstrate how to setup a SSO system with <a href="https://www.keycloak.org/">Keycloak</a> and <a href="https://netknights.it/en/produkte/privacyidea/">privacyIDEA</a>. As an example application we integrate the <a href="https://kolabsystems.com/">Kolab Groupware Server</a> and setup the Roundcubemail webmailer to authenticate with OpenID Connect (OIDC) and a second factor managed by privacyIDEA. Other popular collaboration platforms such as <a href="https://www.tine20.com/en/">Tine 2.0</a> or <a href="https://www.open-xchange.com/">Open-Xchange</a> and many other applications will also work with Keycloak and privacyIDEA as long as they support at least one standard SSO protocol.</p>



<div class="wp-block-image is-style-default"><figure class="aligncenter size-large is-resized"><img decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/03/network-987x1024.png" alt="" class="wp-image-1932" width="600" srcset="https://www.privacyidea.org/wp-content/uploads/2020/03/network-987x1024.png 987w, https://www.privacyidea.org/wp-content/uploads/2020/03/network-289x300.png 289w, https://www.privacyidea.org/wp-content/uploads/2020/03/network-768x797.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/03/network.png 1100w" sizes="(max-width: 987px) 100vw, 987px" /></figure></div>



<p>First, we setup three machines with Ubuntu Server 18.04 and provide similar /etc/hosts files to each of them. For a proper setup, Kolab requires a fully qualified domain name. We choose <code>kolab.netknights.it</code>.</p>



<pre class="wp-block-preformatted has-small-font-size">127.0.0.1      localhost
127.0.1.1      kolab
192.168.56.200 kolab.netknights.it    kolab
192.168.56.201 pi.netknights.it       pi
192.168.56.202 keycloak.netknights.it keycloak</pre>



<p>To put the system into action, one would have to configure DNS and NAT  properly so that the server is reachable from the internet. DNS record  of type A, AAAA and MX are crucial to do this. You may read about this  requirement in the Kolab docs &#8220;<a href="https://docs.kolab.org/installation-guide/preparing-the-system.html">preparing the system</a>&#8220;. For this proof of concept we will not use any logical volumes nor discuss firewall setups or SSL transport layer security.</p>



<p>After updating the initial Ubuntu Server systems, we install privacyIDEA, Keycloak and Kolab following their general installing instructions. We start with Kolab, since in this scenario, we would like to attach the ds-389 LDAP directory delivered by Kolab to our backend, i.e. Keycloak and privacyIDEA.</p>



<h3 class="wp-block-heading">Kolab 16 Installation</h3>



<p>The primary OS supported by Kolab is CentOS, which is also supported by privacyIDEA. However, there are also Kolab and privacyIDEA packages available for Ubuntu 18.04. We will use these for our setup. The install instructions can be found at <a href="https://docs.kolab.org/installation-guide/ubuntu-18.04.html">docs.kolab.org</a>. We summarize them here for convenience</p>



<pre class="wp-block-preformatted has-small-font-size"># Add repositories for apt to /etc/sources/ 
~$ echo 'deb http://obs.kolabsys.com/repositories/Kolab:/16/Ubuntu_18.04/ ./ deb-src http://obs.kolabsys.com/repositories/Kolab:/16/Ubuntu_18.04/ ./' \ 
| tee /etc/apt/sources.list.d/kolab.list 
# Add signing key 
~$ wget -q -O- https://ssl.kolabsys.com/community.asc | apt-key add - 
~$ echo -e 'Package: *\nPin: origin obs.kolabsys.com\nPin-Priority: 501' \ 
| tee /etc/apt/preferences.d/kolab 
~$ apt-get update
~$ apt-get install kolab</pre>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/01-install-kolab-terminal-1.png" alt="" class="wp-image-1784" width="733" height="194" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/01-install-kolab-terminal-1.png 733w, https://www.privacyidea.org/wp-content/uploads/2020/02/01-install-kolab-terminal-1-300x79.png 300w" sizes="auto, (max-width: 733px) 100vw, 733px" /></figure></div>



<p>We let the postfix SMTP service be configured as &#8220;Internet with smarthost&#8221;. Outbound email will be relayed to another (trusted) mail server, e.g. the one of your ISP. Inbound mail will reach postfix on port 25 if your DNS records are configured correctly. After installation the configuration script is called via</p>



<pre class="wp-block-preformatted has-small-font-size">~$ setup-kolab</pre>



<p>It will ask for some information and several passwords. The password for the directory manager will be used to first login, so remember it. Also passwords for a the cyrus-imapd administrator, a kolab-service user, the mysql database root user and several database passwords are needed. Note, that all of them are stored in the /etc/kolab/kolab.conf file and only very few are needed for interactive logins.</p>



<p>Kolab comes without a predefined admin user. Only the directory admin is defined which should not be used for user administration. So we login as &#8220;cn=Directory Manager&#8221; and define a new admin user. In our default setup, the UID is generated from the surname (check the &#8220;System&#8221; tab), so we choose <code>kolab-admin</code> to differentiate from <code>pi-admin</code> and <code>keycloak-admin</code> later.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/03-kolab-webadmin-login-ssl.png" alt="" class="wp-image-1786" width="524" height="361" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/03-kolab-webadmin-login-ssl.png 627w, https://www.privacyidea.org/wp-content/uploads/2020/02/03-kolab-webadmin-login-ssl-300x207.png 300w" sizes="auto, (max-width: 524px) 100vw, 524px" /></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-add-user-1.png" alt="" class="wp-image-1788" width="534" height="513" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-add-user-1.png 534w, https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-add-user-1-300x288.png 300w" sizes="auto, (max-width: 534px) 100vw, 534px" /></figure></div>



<p>On the System tab we set the predefined <code>kolab-admin</code> role for the user to grant him access for user management. Also set a password.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-add-user-2.png" alt="" class="wp-image-1789" width="529" height="390" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-add-user-2.png 529w, https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-add-user-2-300x221.png 300w" sizes="auto, (max-width: 529px) 100vw, 529px" /></figure></div>



<p>Hit submit to complete the process. Next add another ordinary user to test the second factor login later on. We call this user <code>test-user</code>.</p>



<h3 class="wp-block-heading">privacyIDEA 3.x Installation</h3>



<p>Now, we setup privacyIDEA. Install instructions for the most recent version can be found at <a href="https://privacyidea.readthedocs.io/en/latest/">readthedocs.privacyidea.io</a>. We install the <a href="https://privacyidea.readthedocs.io/en/latest/installation/ubuntu.html#installing-privacyidea-3-0-or-higher">official Ubuntu packages</a>, specifically the <code>privacyidea-apache2</code> package. The installation only takes few minutes. After creating the admin user, here called <code>pi-admin</code>, with</p>



<pre class="wp-block-preformatted has-small-font-size">~$ pi-manage admin add pi-admin -e pi-admin@localhost</pre>



<p>we login to the UI. privacyIDEA needs to access the LDAP directory provided by Kolab, so we create an LDAP resolver and use the Kolab service account created above via &#8220;Config-&gt;Users-&gt;New ldapresolver&#8221;. The dn and password for the kolab-service account can be checked in the file /etc/kolab/kolab.conf. We use the OpenLDAP preset given by privacyIDEA but change the UID type to &#8220;dn&#8221;. The resolver test buttons help to avoid typos and to check the connection. For the test, we leave TLS to be configured later.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/ldap-resolver-2-829x1024.png" alt="" class="wp-image-1794" width="829" height="1024" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/ldap-resolver-2-829x1024.png 829w, https://www.privacyidea.org/wp-content/uploads/2020/02/ldap-resolver-2-243x300.png 243w, https://www.privacyidea.org/wp-content/uploads/2020/02/ldap-resolver-2-768x948.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/ldap-resolver-2.png 1149w" sizes="auto, (max-width: 829px) 100vw, 829px" /></figure></div>



<p>The resolver is added to a new realm <code>kolab_realm</code> at &#8220;Config-&gt;Realms-&gt;Create Realm&#8221;.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1019" height="133" src="https://www.privacyidea.org/wp-content/uploads/2020/02/create-realm.png" alt="" class="wp-image-1796" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/create-realm.png 1019w, https://www.privacyidea.org/wp-content/uploads/2020/02/create-realm-300x39.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/create-realm-768x100.png 768w" sizes="auto, (max-width: 1019px) 100vw, 1019px" /></figure></div>



<p></p>



<p>You should now be able to see the users within privacyIDEA.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/users.png" alt="" class="wp-image-1803" width="478" height="274" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/users.png 637w, https://www.privacyidea.org/wp-content/uploads/2020/02/users-300x172.png 300w" sizes="auto, (max-width: 478px) 100vw, 478px" /></figure></div>



<p>We will enroll an HOTP token for <code>test-user</code> with the <a href="https://netknights.it/en/produkte/privacyidea-authenticator-app/">privacyIDEA App</a>, available from Google Play Store. You may alternatively use the Google Authenticator. Install the app and proceed with the enrollment as given below. The privacyIDEA UI auto-completes the username as you type. The generated QR code must be scanned with the App to complete the enrollment.</p>



<figure class="wp-block-gallery columns-3 is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/enroll.png"><img loading="lazy" decoding="async" width="851" height="807" src="https://www.privacyidea.org/wp-content/uploads/2020/02/enroll.png" alt="" data-id="1797" class="wp-image-1797" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/enroll.png 851w, https://www.privacyidea.org/wp-content/uploads/2020/02/enroll-300x284.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/enroll-768x728.png 768w" sizes="auto, (max-width: 851px) 100vw, 851px" /></a><figcaption class="blocks-gallery-item__caption">Enroll a new OTP token&#8230;</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/enroll2-1-1024x376.png"><img loading="lazy" decoding="async" width="1024" height="376" src="https://www.privacyidea.org/wp-content/uploads/2020/02/enroll2-1-1024x376.png" alt="" data-id="1859" data-link="https://www.privacyidea.org/?attachment_id=1859" class="wp-image-1859" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/enroll2-1-1024x376.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/02/enroll2-1-300x110.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/enroll2-1-768x282.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/enroll2-1.png 1119w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="blocks-gallery-item__caption">&#8230;with the privacyIDEA app.</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/token-1.jpg"><img loading="lazy" decoding="async" width="870" height="1024" src="https://www.privacyidea.org/wp-content/uploads/2020/02/token-1-870x1024.jpg" alt="" data-id="1860" data-full-url="https://www.privacyidea.org/wp-content/uploads/2020/02/token-1.jpg" data-link="https://www.privacyidea.org/?attachment_id=1860" class="wp-image-1860" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/token-1-870x1024.jpg 870w, https://www.privacyidea.org/wp-content/uploads/2020/02/token-1-255x300.jpg 255w, https://www.privacyidea.org/wp-content/uploads/2020/02/token-1-768x904.jpg 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/token-1.jpg 872w" sizes="auto, (max-width: 870px) 100vw, 870px" /></a><figcaption class="blocks-gallery-item__caption">The token is assigned to &#8220;test-user&#8221;.</figcaption></figure></li></ul></figure>



<p>The OTP token is now assigned to the user <code>test-user</code> and the privacyIDEA app on your phone should display a six-digits OTP code.</p>



<p>To issue trigger challenges asking for an OTP key on user login, privacyIDEA needs an authorization. Since we do not want our pi-admin password to flow through the wire all the time, we create another, unpriviledged admin user on the privacyIDEA terminal.</p>



<pre class="wp-block-preformatted has-small-font-size">~$ pi-manage admin add trigger-admin -e trigger-admin@localhost</pre>



<p>The trigger-admin needs a superuser policy to restrict the access. In &#8220;Config-&gt;Policies&#8221;, first create a default superuser policy using the &#8220;superuser&#8221; template. Add only the pi-admin to the <code>admin</code> field. Then add another policy without template. Name it <code>trigger_admin</code>, select the scope <code>admin</code>, add the action <code>triggerchallenge</code> and add the created trigger-admin to the <code>admin</code> field. Now, we have two admin users. pi-admin has the default superuser access and trigger-admin has only very limited access allowing to trigger the challenge.</p>



<p>As privacyIDEA is now up and running, we proceed with the Keycloak server, which will act as the central element in the SSO environment.</p>



<h3 class="wp-block-heading">Keycloak 9 Installation</h3>



<p>Start the Keycloak installation by downloading the Keycloak standalone server from <a href="https://www.keycloak.org/downloads.html">keycloak.org</a>. General install information is found in the <a href="https://www.keycloak.org/docs/latest/getting_started/">&#8220;getting started&#8221; guide</a>. A detailed guide how to integrate Keycloak with systemd on Ubuntu Server 18.04 LTS is found <a href="https:&#47;&#x2f;&#109;&#x65;d&#x69;u&#109;&#x2e;&#99;&#x6f;m&#x2f;&#64;&#104;&#x61;&#115;&#x6e;a&#x74;&#46;&#115;&#x61;&#101;&#x65;d/setup-keycloak-server-on-ubuntu-18-04-ed8c7c79a2d9">here</a>. The necessary steps are summarized below.</p>



<pre class="wp-block-preformatted has-small-font-size">~$ sudo apt-get update
~$ sudo apt-get install default-jre-headless
# Install Keycloak 9
~$ mkdir -p /opt/keycloak /etc/keycloak
~$ wget https://downloads.jboss.org/keycloak/9.0.0/keycloak-9.0.0.tar.gz
~$ tar -xvzf keycloak-9.0.0.tar.gz
~$ mv keycloak-9.0.0.tar.gz /opt/keycloak
# Add keycloak user
~$ groupadd keycloak
~$ useradd -r -g keycloak -d /opt/keycloak -s /sbin/nologin keycloak
~$ chown -R keycloak: /opt/keycloak
~$ chmod o+x /opt/keycloak/bin/
# Place config file
~$ cp /opt/keycloak/docs/contrib/scripts/systemd/wildfly.conf /etc/keycloak/keycloak.conf
# Setup systemd files
~$ sed 's/wildfly/keycloak/' /opt/keycloak/docs/contrib/scripts/systemd/launch.sh \
| tee /opt/keycloak/bin/launch.sh
~$ chown keycloak: /opt/keycloak/bin/launch.sh
~$ sed 's/wildfly/keycloak/g' /opt/keycloak/docs/contrib/scripts/systemd/wildfly.service \
| tee /etc/systemd/system/keycloak.service
# Enable and start the daemon
~$ systemctl daemon-reload
~$ systemctl enable keycloak
~$ systemctl start keycloak
~$ systemctl status keycloak
# Add admin user
~$ /opt/keycloak/bin/add-user-keycloak.sh -r master -u <strong>keycloak-admin</strong> -p <strong>&lt;password&gt;</strong> 
~$ systemctl restart keycloak</pre>



<p>Now you should be greeted by Keycloak at http://192.168.56.202:8080. Login with your created <code>keycloak-admin</code> user. As Keycloak should validate the user logins it has to have access to the user store. In &#8220;User Federation&#8221;, add an LDAP provider with the following settings. The kolab-service account is used as an unpriviledged bind and again we disable TLS for the test setup.</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-ldap-setup-2.png" alt="" class="wp-image-1824" width="874" height="1625" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-ldap-setup-2.png 1089w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-ldap-setup-2-161x300.png 161w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-ldap-setup-2-551x1024.png 551w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-ldap-setup-2-768x1428.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-ldap-setup-2-826x1536.png 826w" sizes="auto, (max-width: 874px) 100vw, 874px" /></figure></div>



<p>Hit &#8220;Synchronize all users&#8221; to pull the users from LDAP to Keycloak. You may enable the periodic sync to keep the Keycloak user store up-to-date.</p>



<p><strong>Important: </strong>The keycloak-admin should not be required to provide a second factor to prevent locking the configuration while testing. For this purpose, define a <code>no2fa</code> group in &#8220;Groups&#8221; and add the keycloak-admin to that group in &#8220;Users&#8221;.</p>



<p>Next, privacyIDEA is integrated with Keycloak. Following our earlier article on the integration of <a href="https://community.privacyidea.org/t/how-to-use-keycloak-with-privacyidea/1132">Django with Keycloak and privacyIDEA</a>, we download the two files <a href="https://github.com/privacyidea/keycloak-provider/releases/download/v0.3/PrivacyIDEA-Provider.jar">PrivacyIDEA-Provider.jar</a> and <a href="https://github.com/privacyidea/keycloak-provider/releases/download/v0.3/privacyIDEA.ftl">privacyIDEA.ftl</a> of the most recent release of the <a href="https://github.com/privacyidea/keycloak-provider">privacyIDEA keycloak-provider</a> and install it to Keycloak.</p>



<pre class="wp-block-preformatted has-small-font-size">~$ wget https://github.com/privacyidea/keycloak-provider/releases/download/v0.3/PrivacyIDEA-Provider.jar
~$ wget https://github.com/privacyidea/keycloak-provider/releases/download/v0.3/privacyIDEA.ftl
~$ cp PrivacyIDEA-Provider.jar /opt/keycloak/standalone/deployment/
~$ cp privacyIDEA.ftl /opt/keycloak/themes/base/login/</pre>



<p>In Keycloak, the authentication is managed in so called &#8220;Authentication Flows&#8221;. Copy the default browser-based flow below and rename it to PrivacyIDEA.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-browser-1024x341.png" alt="" class="wp-image-1808" width="768" height="256" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-browser-1024x341.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-browser-300x100.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-browser-768x255.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-browser.png 1362w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure>



<p>Add an execution to &#8220;PrivacyIDEA Forms&#8221; and choose the installed plugin called PrivacyIDEA from the list.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution-button.png" alt="" class="wp-image-1810" width="760" height="96" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution-button.png 1013w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution-button-300x38.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution-button-768x97.png 768w" sizes="auto, (max-width: 760px) 100vw, 760px" /></figure>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution.png" alt="" class="wp-image-1809" width="516" height="142" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution.png 688w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution-300x82.png 300w" sizes="auto, (max-width: 516px) 100vw, 516px" /></figure>



<p>Delete the unnecessary items in the flow (or set them to disabled), so that only &#8220;PrivacyIDEA Forms&#8221; and &#8220;Cookie&#8221; remain. The authentication flow should now look like this:</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-final-1024x280.png" alt="" class="wp-image-1813" width="768" height="210" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-final-1024x280.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-final-300x82.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-final-768x210.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-final.png 1132w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure>



<p>We set PrivacyIDEA to REQUIRED here, which means that additionally to username and password, the second factor is required for all users. We have to configure the plugin to reach our privacyIDEA server at https://192.168.56.202. We disable SSL-verification for the self-signed certificate here, which you must not do in a productive environment. Members of the <code>no2fa</code> group, defined above will not be asked for their second factor. For issuing the trigger challenge a service account is needed. We use the <code>trigger-admin</code> account created in privacyIDEA earlier.<br></p>



<figure class="wp-block-image size-large is-resized is-style-default"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-config-button.png" alt="" class="wp-image-1812" width="603" height="74" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-config-button.png 804w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-config-button-300x37.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-config-button-768x94.png 768w" sizes="auto, (max-width: 603px) 100vw, 603px" /></figure>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-privacyidea-settings3.png" alt="" class="wp-image-1829" width="617" height="497" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-privacyidea-settings3.png 822w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-privacyidea-settings3-300x242.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-privacyidea-settings3-768x619.png 768w" sizes="auto, (max-width: 617px) 100vw, 617px" /></figure>



<p>Set the edited authentication flow as default browser flow in &#8220;Bindings&#8221;.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/binding.png" alt="" class="wp-image-1821" width="608" height="283" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/binding.png 811w, https://www.privacyidea.org/wp-content/uploads/2020/02/binding-300x139.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/binding-768x357.png 768w" sizes="auto, (max-width: 608px) 100vw, 608px" /></figure>



<p>So privacyIDEA is now configured to challenge the second factor for every user. The last step is to enable OpenID Connect logins in roundcubemail.</p>



<h3 class="wp-block-heading">Installation of the Kolab SSO plugin</h3>



<p>For the OIDC, Kolab provides the <code>kolab_sso</code> plugin for Roundcubemail which is available on git.kolab.org. Clone the repository and copy the plugin to the Roundcubemail directory to install it.</p>



<pre class="wp-block-preformatted has-small-font-size">~$ git clone https://git.kolab.org/diffusion/RPK/roundcubemail-plugins-kolab.git
~$ cp -r roundcubemail-plugins-kolab/plugins/kolab_sso/ /usr/share/roundcubemail/plugins/</pre>



<p>Place the default configuration file.</p>



<pre class="wp-block-preformatted has-small-font-size">~$ cp /usr/share/roundcubemail/plugins/kolab_sso/config.inc.php.dist /etc/roundcubemail/kolab_sso.inc.php</pre>



<p>Apache should redirect <code>host.roundcube/sso</code> to <code>host.roundcube/?_task=login&amp;_action=sso</code>, since keycloak does not support parameters in urls. It will display &#8220;Invalid parameter: redirect_uri&#8221;. Add the redirect as follows to /etc/apache2/sites-enabled/roundcubemail.conf.</p>



<pre class="wp-block-preformatted has-small-font-size">RewriteEngine On
RewriteCond %{REQUEST_URI} ^/roundcubemail
RewriteRule "^sso" "/roundcubemail/?_task=login&amp;_action=sso" [L,QSA]</pre>



<p>We proceed on the Keycloak machine and add Roundcubemail as a new OpenID Connect client as given below.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="834" height="1024" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-settings-834x1024.png" alt="" class="wp-image-1817" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-settings-834x1024.png 834w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-settings-244x300.png 244w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-settings-768x943.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-settings.png 1100w" sizes="auto, (max-width: 834px) 100vw, 834px" /></figure>



<p>Save the form to access the &#8220;Credentials&#8221; tab. We will soon need the generated secret again.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-credentials.png" alt="" class="wp-image-1818" width="804" height="187" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-credentials.png 804w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-credentials-300x70.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-credentials-768x179.png 768w" sizes="auto, (max-width: 804px) 100vw, 804px" /></figure>



<p>The kolab_sso plugin needs the certificate of the Keycloak server during the OpenID Connect authentication process. It is available from the Keycloak management console in the &#8220;Realm Settings&#8221;.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="253" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-realm-certificate2-1024x253.png" alt="" class="wp-image-1831" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-realm-certificate2-1024x253.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-realm-certificate2-300x74.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-realm-certificate2-768x190.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-realm-certificate2.png 1176w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Add the key and the client secret alongside the <code>token_uri</code> and <code>auth_uri</code> to the <code>kolab_sso.inc.php</code> configuration file. Make sure that the public key copied from keycloak is properly formatted. The IMAP, SMTP and LDAP credentials in the top part of the file are required for accessing the mailbox, sending emails and accessing the server addressbooks. Configure them accordingly.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="915" height="679" src="https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-kolab_sso-plugin-config-keycloak.png" alt="" class="wp-image-1807" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-kolab_sso-plugin-config-keycloak.png 915w, https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-kolab_sso-plugin-config-keycloak-300x223.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-kolab_sso-plugin-config-keycloak-768x570.png 768w" sizes="auto, (max-width: 915px) 100vw, 915px" /></figure></div>



<p>After successfully testing the ordinary password login with Roundcubemail at http://192.168.56.200/roundcubemail, you may disable the password login to allow only OpenID Connect by setting</p>



<pre class="wp-block-preformatted has-small-font-size"> $config['kolab_sso_disable_login'] = true;</pre>



<p>in <code>kolab_sso.inc.php</code>.</p>



<h3 class="wp-block-heading">Test the login</h3>



<p>We are now ready to test the OpenID Connect  login at Roundcubemail. Navigate once again to http://192.168.56.200/roundcubemail to test the login. You may monitor some log files during the process.</p>



<pre class="wp-block-preformatted has-small-font-size">/var/log/privacyidea/privacyidea.log
/var/log/roundcubemail/*
/opt/keycloak/standalone/log/*</pre>



<figure class="wp-block-gallery alignwide columns-4 is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login.png"><img loading="lazy" decoding="async" width="453" height="287" src="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login.png" alt="" data-id="1840" data-link="https://www.privacyidea.org/?attachment_id=1840" class="wp-image-1840" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login.png 453w, https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login-300x190.png 300w" sizes="auto, (max-width: 453px) 100vw, 453px" /></a><figcaption class="blocks-gallery-item__caption">The Roundcubemail kolab_sso login&#8230;</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login.png"><img loading="lazy" decoding="async" width="577" height="514" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login.png" alt="" data-id="1836" data-link="https://www.privacyidea.org/?attachment_id=1836" class="wp-image-1836" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login.png 577w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login-300x267.png 300w" sizes="auto, (max-width: 577px) 100vw, 577px" /></a><figcaption class="blocks-gallery-item__caption">gets redirected to Keycloak.</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login_2FA.png"><img loading="lazy" decoding="async" width="525" height="305" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login_2FA.png" alt="" data-id="1837" data-link="https://www.privacyidea.org/?attachment_id=1837" class="wp-image-1837" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login_2FA.png 525w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login_2FA-300x174.png 300w" sizes="auto, (max-width: 525px) 100vw, 525px" /></a><figcaption class="blocks-gallery-item__caption">After typing the password, the user is prompted to provide a second factor&#8230;</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/privacyIDEA_Authenticator.png"><img loading="lazy" decoding="async" width="540" height="327" src="https://www.privacyidea.org/wp-content/uploads/2020/02/privacyIDEA_Authenticator.png" alt="" data-id="1838" data-link="https://www.privacyidea.org/?attachment_id=1838" class="wp-image-1838" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/privacyIDEA_Authenticator.png 540w, https://www.privacyidea.org/wp-content/uploads/2020/02/privacyIDEA_Authenticator-300x182.png 300w" sizes="auto, (max-width: 540px) 100vw, 540px" /></a><figcaption class="blocks-gallery-item__caption">&#8230;which we get in this case from the OTP token in the privacyIDEA app.</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login_mailbox-1.png"><img loading="lazy" decoding="async" width="902" height="460" src="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login_mailbox-1.png" alt="" data-id="1842" data-full-url="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login_mailbox-1.png" data-link="https://www.privacyidea.org/?attachment_id=1842" class="wp-image-1842" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login_mailbox-1.png 902w, https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login_mailbox-1-300x153.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login_mailbox-1-768x392.png 768w" sizes="auto, (max-width: 902px) 100vw, 902px" /></a><figcaption class="blocks-gallery-item__caption">The correct OTP gets us directly to Roundcubemail webmail.</figcaption></figure></li></ul></figure>



<h3 class="wp-block-heading">Conclusion</h3>



<p>We demonstrated the integration of privacyIDEA with Keycloak to provide a solid basis to secure your applications with a second factor in a single sign-on (SSO) environment. For maximum flexibility, the system relies on standard protocols such as SAML or OpenID Connect (OIDC). The privacyIDEA keycloak-provider is designed to perfectly fit the two components together, uniting the rich identity management capabilities of Keycloak and the powerful multi factor management of privacyIDEA.</p>



<p>We chose the Roundcubemail webmailer of the Kolab Collaboration Server as an example application. The kolab_sso plugin provided the necessary interface to connect via OIDC to easily enhance security by adding a second factor managed by privacyIDEA. The setup of other popular open collaboration platforms such as <a href="https://www.tine20.com/en/">Tine 2.0</a> or <a href="https://www.open-xchange.com/">Open-Xchange</a> work similarly.</p>



<p>Including additional applications in this setup is very easy as long as they support at least one SSO protocol. These applications do not even to be hosted on your own servers. Nowadays, most cloud-based applications offer both, the possibility to use an external identity provider and to use OIDC. Thus, you can also use remote services with your own user base, defining access-rules to fit your needs.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/versatile-2fa-single-sign-on-with-keycloak-and-privacyidea/feed/</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
			</item>
	</channel>
</rss>
