<?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>Development &#8211; privacyID3A</title>
	<atom:link href="https://www.privacyidea.org/tag/development/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.privacyidea.org</link>
	<description>flexible, Open Source Multi Factor Authentication (2FA)</description>
	<lastBuildDate>Tue, 14 Feb 2017 16:18:26 +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>Development &#8211; privacyID3A</title>
	<link>https://www.privacyidea.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>More flexible policies with regular expressions</title>
		<link>https://www.privacyidea.org/flexible-policies-regular-expressions/</link>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Tue, 14 Feb 2017 16:18:26 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Policy]]></category>
		<category><![CDATA[User Management]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=1143</guid>

					<description><![CDATA[Today I want to give you an idea about the current development in privacyIDEA. You may like privacyIDEA because it is probably the most flexible and extensible multi factor authentication system due to its sophisticated policies and event handler framework. But I just pushed a small enhancement in regards to the policies, which my ease [&#8230;]]]></description>
										<content:encoded><![CDATA[<figure id="attachment_1145" aria-describedby="caption-attachment-1145" style="width: 300px" class="wp-caption alignleft"><a href="https://www.privacyidea.org/wp-content/uploads/2017/02/characters-2029373_640.png"><img decoding="async" class="size-medium wp-image-1145" src="https://www.privacyidea.org/wp-content/uploads/2017/02/characters-2029373_640-300x157.png" alt="" width="300" height="157" srcset="https://www.privacyidea.org/wp-content/uploads/2017/02/characters-2029373_640-300x157.png 300w, https://www.privacyidea.org/wp-content/uploads/2017/02/characters-2029373_640.png 640w" sizes="(max-width: 300px) 100vw, 300px" /></a><figcaption id="caption-attachment-1145" class="wp-caption-text">Identify users by regular expression.</figcaption></figure>
<p>Today I want to give you an idea about the current development in privacyIDEA. You may like privacyIDEA because it is probably the most flexible and extensible multi factor authentication system due to its sophisticated <a href="http://privacyidea.readthedocs.io/en/latest/policies/index.html" target="_blank">policies</a> and <a href="http://privacyidea.readthedocs.io/en/latest/eventhandler/index.html" target="_blank">event handler framework</a>.</p>
<p>But I just pushed a small enhancement in regards to the policies, which my ease your life. You are now able to not only define policies based on realms, resolvers and list of users, but you may also use <a href="https://github.com/privacyidea/privacyidea/issues/581" target="_blank">regular expressions for the users in policies</a>. This will be part of privacyIDEA 2.18 which is scheduled for midth of March 2017.</p>
<p>This way you do not need to rely on the user realms and user resolvers. You can also specify, that a certain policy should be bound to all users matching <em>customer_.*</em> or <em>admin_.*</em>.</p>
<p>This can help to ease things, since you do not need to split up a realm into many resolvers.</p>
<p>Tell us, what you like. Join the <a href="https://groups.google.com/forum/#!forum/privacyidea" target="_blank">Google Group</a>, post your issues at <a href="https://github.com/privacyidea/privacyidea" target="_blank">Github</a> or <a href="https://www.youtube.com/channel/UCesoTaB76oX42vX7WGfyyFA" target="_blank">subscribe to the Youtube Channel.</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Add two factor authentication to your web application</title>
		<link>https://www.privacyidea.org/add-two-factor-authentication-web-application/</link>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Sun, 15 Jan 2017 12:46:05 +0000</pubDate>
				<category><![CDATA[documentation]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[login]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=1127</guid>

					<description><![CDATA[This blog article describes, how you can add two factor authentication to your web application using the authentication system privacyIDEA. Two factor authentication has been added this way to ownCloud/Nextcloud, OTRS, dokuwiki, WordPress, TYPO3, Django, Kopano (Zarafa) and SimpleSAMLphp. See the plugin section of the privacyIDEA online documentation. Two different concepts There are basically two [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="https://www.privacyidea.org/wp-content/uploads/2017/01/code-1839406_1280.jpg"><img decoding="async" class="size-medium wp-image-1138 alignleft" src="https://www.privacyidea.org/wp-content/uploads/2017/01/code-1839406_1280-300x200.jpg" alt="" width="300" height="200" srcset="https://www.privacyidea.org/wp-content/uploads/2017/01/code-1839406_1280-300x200.jpg 300w, https://www.privacyidea.org/wp-content/uploads/2017/01/code-1839406_1280-768x512.jpg 768w, https://www.privacyidea.org/wp-content/uploads/2017/01/code-1839406_1280-1024x683.jpg 1024w, https://www.privacyidea.org/wp-content/uploads/2017/01/code-1839406_1280.jpg 1280w" sizes="(max-width: 300px) 100vw, 300px" /></a>This blog article describes, how you can add two factor authentication to your web application using the authentication system privacyIDEA.</p>
<p>Two factor authentication has been added this way to ownCloud/Nextcloud, OTRS, dokuwiki, WordPress, TYPO3, Django, Kopano (Zarafa) and SimpleSAMLphp. See the <a href="http://privacyidea.readthedocs.io/en/latest/application_plugins/index.html" target="_blank">plugin section of the privacyIDEA online documentation</a>.</p>
<h2>Two different concepts</h2>
<p>There are basically two ways for the user to provide a second factor during authentication. The first one is to completely replace the authentication of your webapplication. In this case your application delegates the complete authentication process to privacyIDEA. This is implemented e.g. in the <a href="https://github.com/privacyidea/privacyidea/tree/master/authmodules/OTRS" target="_blank">OTRS plugin</a> and the <a href="https://github.com/privacyidea/wordpress-strong-authentication" target="_blank">WordPress plugin</a>. In this case the plugin will take care of the first <em>and</em> second factor. And in certain cases it will also take care of the WebUI Login Screen.</p>
<p>The other possiblity is that your application uses its normal password based authentication, but after the user has successfully authenticated with his usual username and the application password, your application decides, not to immediately allow access, but hand over the authentication to the 2FA plugin, which will take care of quering the second factor. This is implemented in the <a href="https://github.com/NetKnights-GmbH/privacyidea-owncloud-app" target="_blank">privacyIDEA ownCloud App</a>.</p>
<p>In addition we already published some <a href="https://github.com/privacyidea/AuthModuleRequirements" target="_blank">basic requirements for <em>modular</em> two factor authentication</a> in a web application.</p>
<h3>Hand complete authentication process to the 2FA plugin</h3>
<p>Your application should allow to register or configure a 3rd party module or class. This class would have to provide a method like <em>authenticate_user</em> for verifying the users input. The easiest way would be, that such a plugin does not even has to change or bring its own login screen. In such simple case, the authentication method <em>authenticate_user</em> would simple receive the credentials, that were entered at your applications default login screen. It then would return True or False or maybe raise an exception.</p>
<p>The privacyIDEA plugin for your webapplication would use this username and this password to issue a call to the privacyIDEA REST API. The plugin would call the <a href="http://privacyidea.readthedocs.io/en/latest/modules/api/validate.html#post--validate-check" target="_blank">/validate/check</a> endpoint with <em>username</em> and <em>password</em> as parameters and simply evaluate the JSON response.</p>
<p>Managing users, returning user attributes or listing users would be out of scope of such an authentication plugin. Authorization would be out of scope, just as it is with the Unix PAM stack.</p>
<h4>Example OTRS</h4>
<p>An example implementation of the complete authentication replacement is the OTRS plugin for privacyIDEA.</p>
<p>In this case the administrator can configure in OTRS which Perl module should be used for authenticating the user. <strong>Note</strong>: Not for verifying if the user exists and not for fetching attributes like given name or email address of the user.</p>
<p>The Perl module has to provide a function <em>Auth</em>, which takes a dictionary/hash with the keys <em>User</em> and <em>Pw</em>. If the credentials were verified successfully this function returns the Username of the user, otherwise an empty string.</p>
<p><a href="https://github.com/privacyidea/privacyidea/blob/master/authmodules/OTRS/privacyIDEA-4_0.pm#L86" target="_blank">See the implementation at github</a>.</p>
<p>In this case, privacyIDEA takes care of verifying two factors. The user has entered a knowledge and a One Time Password (2nd factor: possession) into the password field. privacyIDEA knows how to verify the static password (knowledge) and the OTP value.</p>
<h4>Example WordPress</h4>
<p>The WordPress plugin works the same. It does not modify the login screen, as this is not necessary. The user enters his static password and his one time password in the password field. The WordPress plugin registers or overwrites the function <a href="https://github.com/privacyidea/wordpress-strong-authentication/blob/master/strong-authentication.php#L236" target="_blank">wp_authenticate</a>, which takes the credentials that were entered by the user. WordPress relies on the return value of this function, which again is either a WordPress User object or null.</p>
<p>Within this function of the plugin, the credentials are verified against the configured privacyIDEA server. In this case this is done using <a href="https://github.com/privacyidea/wordpress-strong-authentication/blob/master/strong-authentication.php#L63" target="_blank">curl</a>.</p>
<p><strong>Note</strong>: All authentication requests are forwarded to privacyIDEA. WordPress does not know if the user has a second factor or not. It does not know, which kind of second factor a user has. This is all handled by privacyIDEA. This way the plugin can be kept rather light weight.</p>
<h3>Only hand second factor to the 2FA plugin</h3>
<p>Instead of passing the complete authentication process to the 3rd party plugin, you can also design your authentication framework this way, that your application still verifies the static user password and request an additional authentication on top.</p>
<p>This can be interesting, if your application needs to know the user password, since it is used to contact email servers or encrypt data.</p>
<p>Your application will verify the password as before. But in addition it will pass the controll the the 2FA plugin</p>
<h4>Example ownCloud</h4>
<p>The ownCloud 2FA Framework is implemented this way.</p>
<p>In the first step the user has to authenticate against ownCloud with the ownCloud password.</p>
<figure id="attachment_1134" aria-describedby="caption-attachment-1134" style="width: 300px" class="wp-caption alignnone"><a href="https://www.privacyidea.org/wp-content/uploads/2017/01/owncloud-first-factor.png"><img loading="lazy" decoding="async" class="wp-image-1134 size-medium" src="https://www.privacyidea.org/wp-content/uploads/2017/01/owncloud-first-factor-300x264.png" width="300" height="264" srcset="https://www.privacyidea.org/wp-content/uploads/2017/01/owncloud-first-factor-300x264.png 300w, https://www.privacyidea.org/wp-content/uploads/2017/01/owncloud-first-factor.png 524w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><figcaption id="caption-attachment-1134" class="wp-caption-text">User authenticates with his normal ownCloud password.</figcaption></figure>
<p>If the user entered the correct password, which is still verified by ownCloud, the web application (ownCloud) calls the 2FA plugin to ask for the second factor.</p>
<figure id="attachment_1135" aria-describedby="caption-attachment-1135" style="width: 297px" class="wp-caption alignnone"><a href="https://www.privacyidea.org/wp-content/uploads/2017/01/owncloud-second-factor.png"><img loading="lazy" decoding="async" class="wp-image-1135 size-medium" src="https://www.privacyidea.org/wp-content/uploads/2017/01/owncloud-second-factor-297x300.png" width="297" height="300" srcset="https://www.privacyidea.org/wp-content/uploads/2017/01/owncloud-second-factor-297x300.png 297w, https://www.privacyidea.org/wp-content/uploads/2017/01/owncloud-second-factor.png 481w" sizes="auto, (max-width: 297px) 100vw, 297px" /></a><figcaption id="caption-attachment-1135" class="wp-caption-text">If the user entered the correct static ownCloud password, he is asked for the second factor.</figcaption></figure>
<p>The ownCloud 2FA framework requires the plugin to register a Class that is <a href="https://github.com/NetKnights-GmbH/privacyidea-owncloud-app/blob/master/twofactor_privacyidea/lib/Provider/TwoFactorPrivacyIDEAProvider.php#L34" target="_blank">derived from a certain 2FA base class</a>. This way the web application (ownCloud) knows, if two factor authentication can be used for the user, who is already authenticated in the first step.</p>
<p>The 2FA framework then asks the plugin/class to <a href="https://github.com/NetKnights-GmbH/privacyidea-owncloud-app/blob/master/twofactor_privacyidea/lib/Provider/TwoFactorPrivacyIDEAProvider.php#L81" target="_blank">provide a template for the 2nd step of the Login UI</a>. Finally the 2FA framework calls a <a href="https://github.com/NetKnights-GmbH/privacyidea-owncloud-app/blob/master/twofactor_privacyidea/lib/Provider/TwoFactorPrivacyIDEAProvider.php#L93" target="_blank">class method in the plugin to verify the 2nd factor</a>.</p>
<p>This good thing about it is, that ownCloud can know the user&#8217;s password and thus use the user&#8217;s for encryption and sending emails. The drawback of this design is, that the authentication workflow might be a bit more complicated, exspecially if it comes to special scenarios like challenge response authentication.</p>
<h2>Special case for Challenge Response token like SMS and Email</h2>
<p>Although <a href="https://netknights.it/en/lasting-two-factor-authentication-with-privacyidea/" target="_blank">NIST recommended to not use SMS for two factor authentication</a> it is still an attractive and easy way. In addition privacyIDEA can run any combination of authentication devices. Some users may use Yubikeys, others Google Authenticators, some users use key fob tokens and another group could use SMS.</p>
<p>But privacyIDEA needs additional information to trigger an SMS. Not everybody can trigger the sending of an SMS, otherwise the user would get spammed with SMS on his mobile phone.</p>
<p>There are two ways to trigger and SMS:</p>
<ol>
<li>The user authenticates with his OTP PIN (static password). privacyIDEA realizes, that this is the correct password for an SMS token and will send the SMS.</li>
<li>An administrative or system account requests the sending of an SMS for this specific user.</li>
</ol>
<p>In both cases the 2FA framework of your application has to provide the possibility to issue a REST request before the user authenticats. Because this first REST request will send the user the code, which he then can use to finally authenticate.</p>
<p>Most applications do not allow this easily today.</p>
<p>There is a beta implementation for the ownCloud 2FA framework, which is not that perfect. The <a href="https://github.com/NetKnights-GmbH/privacyidea-owncloud-app/blob/challenge-response/twofactor_privacyidea/lib/Provider/TwoFactorPrivacyIDEAProvider.php#L149" target="_blank">SMS is triggered when the Login UI is rendered</a>. This has the side effect that the SMS is triggered again, if the user entered a wrong OTP value, since the UI is rendered again.</p>
<p>When designing the authentication framework of your web applications, you could have such corner cases in mind.</p>
<h2>Now it is your turn!</h2>
<p>If you want to add 2FA to your web application, please contact us in our <a href="https://groups.google.com/forum/#!forum/privacyidea" target="_blank">Google Group</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Create your own user portal</title>
		<link>https://www.privacyidea.org/create-user-portal/</link>
					<comments>https://www.privacyidea.org/create-user-portal/#respond</comments>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Tue, 01 Nov 2016 07:43:33 +0000</pubDate>
				<category><![CDATA[documentation]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Google Authenticator]]></category>
		<category><![CDATA[REST API]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=1089</guid>

					<description><![CDATA[Sometimes it is important to add user self service functionalities to your own portal or create a stripped down version of the privacyIDEA user selfservice. You can strip down the rights for users in a very detailed manner using policies. You can also define an enrollment wizard policy, so that enrolling tokens gets even more [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Sometimes it is important to add user self service functionalities to your own portal or create a stripped down version of the privacyIDEA user selfservice. You can strip down the rights for users in a very detailed manner <a href="http://privacyidea.readthedocs.io/en/latest/policies/user.html" target="_blank">using policies</a>. You can also <a href="https://www.youtube.com/watch?v=diAGbsiG8_A" target="_blank">define an enrollment wizard policy</a>, so that enrolling tokens gets even more simpler. But sometimes even this is not enough.<a href="https://www.privacyidea.org/wp-content/uploads/2016/11/rest-api.png"><img loading="lazy" decoding="async" class=" wp-image-1090 alignright" src="https://www.privacyidea.org/wp-content/uploads/2016/11/rest-api-300x256.png" alt="rest-api" width="177" height="151" srcset="https://www.privacyidea.org/wp-content/uploads/2016/11/rest-api-300x256.png 300w, https://www.privacyidea.org/wp-content/uploads/2016/11/rest-api.png 649w" sizes="auto, (max-width: 177px) 100vw, 177px" /></a></p>
<h2>privacyIDEA REST API</h2>
<p>privacyIDEA provides a great and <a href="http://privacyidea.readthedocs.io/en/latest/modules/api.html" target="_blank">simple REST API</a> which lets you automate and integrate all tasks into other workflows. In fact the privacyIDEA Web UI as a single page application uses this REST API. Thus you could easily open the developer tools of your browser and monitor the HTTP requests that are sent.</p>
<h3>Authenticating a user</h3>
<p>A user needs to authenticate at the Web UI and also at the REST API. This is done by issuing the request</p>
<figure id="attachment_1092" aria-describedby="caption-attachment-1092" style="width: 152px" class="wp-caption alignright"><a href="https://www.privacyidea.org/wp-content/uploads/2016/11/auth-request.png"><img loading="lazy" decoding="async" class=" wp-image-1092" src="https://www.privacyidea.org/wp-content/uploads/2016/11/auth-request-300x215.png" alt="Auth-Request in the Chrome developer tools." width="152" height="109" srcset="https://www.privacyidea.org/wp-content/uploads/2016/11/auth-request-300x215.png 300w, https://www.privacyidea.org/wp-content/uploads/2016/11/auth-request.png 593w" sizes="auto, (max-width: 152px) 100vw, 152px" /></a><figcaption id="caption-attachment-1092" class="wp-caption-text">Auth-Request in the Chrome developer tools.</figcaption></figure>
<pre>POST /auth</pre>
<p><a href="http://privacyidea.readthedocs.io/en/latest/modules/api/auth.html#post--auth" target="_blank">The auth request</a> takes the username and the users password. Which password the user needs to provide, depends on the <em>login_mode</em> policy in the <em>WebUI</em> scope. The auth request returns an <em>authorization token</em> which needs to be added to each subsequent request.</p>
<p>You can also issue a test request using <em>httpie</em> from the command line like this:</p>
<pre>% http --verify no --pretty all --json POST https://localhost/auth username=secureuser password=test
/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py:794: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
 InsecureRequestWarning)
HTTP/1.1 200 OK
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 843
Content-Type: application/json
Date: Tue, 01 Nov 2016 07:28:55 GMT
Server: nginx/1.10.0 (Ubuntu)

{
 "id": 1, 
 "jsonrpc": "2.0", 
 "result": {
 "status": true, 
 "value": {
 "default_tokentype": "totp", 
 "log_level": 30, 
 "logout_time": 120, 
 "menus": [], 
 "policy_template_url": "https://raw.githubusercontent.com/privacyidea/policy-templates/master/templates/", 
 "realm": "secure", 
 "rights": [], 
 "role": "user", 
 "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InNlY3VyZXVzZXIiLCJub25jZSI6IjQyYjhhMWIzNDEzYTA5ZmQzMDljMDI3NzY3Mjc4N2I5MmFiNWI2ZWUiLCJhdXRodHlwZSI6InBhc3N3b3JkIiwicmVhbG0iOiJzZWN1cmUiLCJyaWdodHMiOltdLCJyb2xlIjoidXNlciIsImV4cCI6MTQ3Nzk4ODkzNX0.vCXNNV4Bmt2UuC0FMuc2qMbr8i_8zweROadvfLYcJzU", 
 "token_page_size": 15, 
 "token_wizard": false, 
 "token_wizard_2nd": false, 
 "user_details": false, 
 "user_page_size": 15, 
 "username": "secureuser"
 }
 }, 
 "time": 1477985335.376939, 
 "version": "privacyIDEA 2.16.dev3", 
 "versionnumber": "2.16.dev3"
}</pre>
<p>Using the authorization token</p>
<p>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InNlY3VyZXVzZXIiLCJub25jZSI6IjQyYjhhMWIzNDEzYTA5ZmQzMDljMDI3NzY3Mjc4N2I5MmFiNWI2ZWUiLCJhdXRodHlwZSI6InBhc3N3b3JkIiwicmVhbG0iOiJzZWN1cmUiLCJyaWdodHMiOltdLCJyb2xlIjoidXNlciIsImV4cCI6MTQ3Nzk4ODkzNX0.vCXNNV4Bmt2UuC0FMuc2qMbr8i_8zweROadvfLYcJzU</p>
<p>for subsequent call.</p>
<h3>Enrolling a token</h3>
<p>Now the user can enroll a token using the <a href="http://privacyidea.readthedocs.io/en/latest/modules/api/token.html" target="_blank">token endpoints</a>. You need to issue a /token/init request.</p>
<p>To enroll an TOTP token the user would have to issue such a request:</p>
<pre>http --verify no --pretty all --json POST https://localhost/token/init \
     PI-Authorization:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InNlY3VyZXVzZXIiLCJub25jZSI6IjQyYjhhMWIzNDEzYTA5ZmQzMDljMDI3NzY3Mjc4N2I5MmFiNWI2ZWUiLCJhdXRodHlwZSI6InBhc3N3b3JkIiwicmVhbG0iOiJzZWN1cmUiLCJyaWdodHMiOltdLCJyb2xlIjoidXNlciIsImV4cCI6MTQ3Nzk4ODkzNX0.vCXNNV4Bmt2UuC0FMuc2qMbr8i_8zweROadvfLYcJzU \
     type=totp genkey=1 otplen=6</pre>
<p>The secret and also the image of the QR code to be scanned with a smartphone app is contained in the response:</p>
<pre> "googleurl": {
 "description": "URL for google Authenticator", 
 "img": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeoAAAHqAQAAAADjFjCXAAAD90lEQVR4nO2dTY6jSBBGXwxItQSpD+Cj4JuN6khzAziKbwBLS6CYRWaQ6epZGUaW218sEJR5SqUUiv+kzDkg019HaBAuXLhw4cKFCxd+Lm5ZWuzKZkw9MKVHsOtS7uLV63mrC/80HHd3Z3B397lx9xmgc2fwNd/Rxd0wN14R41vvXfir8SWbL7t2Kz4CTH3jDDczoHGGeTMAzKw9eXXhn4W3P559MrDh1q4M49Y6rC3DCA6Nw3Lq6sKFAzDMjee4rm/crkuLf/cAi9n/vrrwj8I7dx8JD+t+txzh7c41KSHg7uvJqwv/SHwyM7MeYGmx6/KVzBxAfvx7BmBLKeypqwv/MDwpVmmL+XTJhsxZNvPpsuKwpkfoHjtob7134a/Co3ISRZNUFxkBH2myig0zJIc7+Ir73KhyIvwMfDOzy4pdSSbNk66N3Yp/X1ZySWX5cqZ+k4cVfkCictKtLcM/X85kjdtwM5zubs7y5ZZeW3qM7m4++BbYW+9d+Kvw7GEh27XsTZObbTzZurHbXwEgpbnysMKflRLIAdERG2bIHTEeumSlVaa4TvjzEtkElGZsJBeNl/ShqKMXkdYJfx7374t71X2YerArAMuXA1tqxuYGrfqwwo9JMVwM1SVGAKqSyhxhXlVheeu9C38V/pA5QK7I5fQh+9pcQ2FXPVSvE35IstZ1/ptUypWS26yYOcyT1gl/WrL+zECaZeo8HGlys8XDQsk1ZOuEH5Bi61Idboy54VC9ukFWzJy0TvgBiSrx7j4jrsuXsH/p5fyoep3wQ1JZsxLN7XoVZeH9h4j1pHXCD0j4y1wRybLnsLA7170jIQ8r/Bj+0Gno9kkTGi9tsTrh6B7t31vvXfir8Lpysg/UVWU5Qv8i4Nt7s9I64U9LZBNF/1bKVEnKZpNznR9eka0T/rwU9xljTLuvjZmT/N4M+Tw26ogJPyRVbpD1L8py46P+7YlsXch7670LfxX+4EjnaLf+R4RXXdyldcIPSVYf4pzr8Gjr9kDuR29CWif8gFS2rrT7PSadqiGn6qJZYuEn4O63Frt2ax7ZzHObUTnJh8I2g+5umuoUfl4fNs8yVVavLtDlBhmgcxPCD+LV2X+HNX/Oaf9byGbO8mtlGMGmfo4f33rvwl+Ll291Ml3u9WfqhqpLAbC0MNzkYYWfgA+lVBzHc1JZeOqhfDAxVYmn/uTVhX8Y/nAyMc7j1DMnUTQpbYmCKa4Tfh4eZ1/zecQ8bjdDjKU0iuuEH5Eftq7MDVcTxOkzieWT2MphhR+Tug9bHfFv6t7sGKNN0TnTpJPwQxL1OmAvC5ejiOzzdWHhVnRGTPhB3PTf64QLFy5cuHDhwv8I/F/uK4F3xSCgRwAAAABJRU5ErkJggg==", 
 "value": "otpauth://totp/TOTP0008C54E?secret=ND2QFT6LIMFXCEARWIMTBT456NY6K7H5&amp;counter=1&amp;digits=6&amp;issuer=privacyIDEA"
 },</pre>
<p>In the same way you could let the user manage his tokens, delete them, reset PINs etc&#8230;</p>
<p>For more information see the <a href="http://privacyidea.readthedocs.io/en/latest/modules/api.html" target="_blank">complete REST API documentation</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/create-user-portal/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tine 2.0 with two factor support using privacyIDEA</title>
		<link>https://www.privacyidea.org/tine-2-0-with-two-factor-support-using-privacyidea/</link>
					<comments>https://www.privacyidea.org/tine-2-0-with-two-factor-support-using-privacyidea/#respond</comments>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Tue, 20 Sep 2016 11:51:00 +0000</pubDate>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Whatsup]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[documentation]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=1067</guid>

					<description><![CDATA[Tine 2.0 Integration Tine 2.0 is a groupware and CRM which is available as open source and Enterprise Edition. Last weekend I met some guys from tine 2.0 in Kiel at the local Linux and open source conference. We again talked about two factor authentication and then we used a time slot to do a [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>Tine 2.0 Integration</h2>
<p><a href="https://www.tine20.com/" target="_blank">Tine 2.0 is a groupware and CRM</a> which is available as open source and Enterprise Edition. Last weekend I met some guys from tine 2.0 in <a href="https://twitter.com/kielux" target="_blank">Kiel at the local Linux and open source conference</a>. We again talked about two factor authentication and then we used a time slot to do a spontaneous workshop. I explained the easy authentication API of privacyIDEA. You can find it in the <a href="http://privacyidea.readthedocs.io/en/latest/modules/api/validate.html#post--validate-check" target="_blank">online documentation of readthedocs</a>. After all it boils down to one simple ajax call. All other logic is handled within privacyIDEA.</p>
<p>After only half an hour the first stub was running. By the end of the afternoon <a href="https://github.com/tine20/Tine-2.0-Open-Source-Groupware-and-CRM/commit/8630657a04212288722d6a4ddfc0549625ef8483" target="_blank">everything was fine, mocked and tested</a>!</p>
<p>This shows, that if you take some time to read the <a href="http://privacyidea.readthedocs.io/en/latest/modules/api/validate.html" target="_blank">REST API</a>, adding two factor authentication to your own application is easy as pie!</p>
<h2>Secure your own Application</h2>
<p>privacyIDEA is already integrated into many applications like TYPO3, WordPress, OTRS, ownCloud, Nextcloud, Contao, dokuwiki and Tine 2.0. Be the next one to increase security and implement 2FA securely and easy with privacyIDEA!</p>
<p>If you want to integrate privacyIDEA into your application and have any questions, join the <a href="https://gitter.im/privacyidea/Lobby" target="_blank">gitter.im</a> chat or the <a href="https://groups.google.com/forum/#!forum/privacyidea" target="_blank">Google group</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/tine-2-0-with-two-factor-support-using-privacyidea/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>privacyIDEA development &#8211; using PyCharm</title>
		<link>https://www.privacyidea.org/privacyidea-development-howto/</link>
					<comments>https://www.privacyidea.org/privacyidea-development-howto/#respond</comments>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Fri, 09 Sep 2016 14:12:15 +0000</pubDate>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Development]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=1035</guid>

					<description><![CDATA[Today I am talking about how I am developing privacyIDEA and how it might be easy for you to participate. A while ago I started using pycharm. There are many different IDEs out there.  I also used Aptana and Eclipse for a while. But pycharm just feels a bit quicker and navigation in the code [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Today I am talking about how I am developing privacyIDEA and how it might be easy for you to participate.</p>
<p>A while ago I started using <a href="https://www.jetbrains.com/pycharm/?fromMenu" target="_blank">pycharm</a>. There are many different IDEs out there. <a href="https://www.privacyidea.org/wp-content/uploads/2016/09/icon_PyCharm.png"><img loading="lazy" decoding="async" class="size-full wp-image-1039 alignright" src="https://www.privacyidea.org/wp-content/uploads/2016/09/icon_PyCharm.png" alt="icon_PyCharm" width="128" height="128" /></a> I also used Aptana and Eclipse for a while. But pycharm just feels a bit quicker and navigation in the code seem to me more intuitive. vim is no IDE to me. But everyone is allowed to do what suites him best. privacyIDEA is a project with several layers &#8211; database, libraries, dependencies and APIs. It helps me to be able to browse the code and &#8220;find usages&#8221; and &#8220;refactor&#8221; functions and variables.</p>
<p>So, in this blog post I will show you, how you can set up the privacyIDEA project for development, running and debugging.</p>
<h2>Get privacyIDEA</h2>
<p>First get the privacyIDEA sources. You may as well first fork privacyIDEA into your own repository, so that you can commit changes and issue pull requests. We clone the repository locally and also setup a virtualenv, so that you have everything you need for development.</p>
<pre>cd ~
git clone https://github.com/privacyidea/privacyidea.git
cd privacyidea
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt</pre>
<p>For pip install to run successfully, you might need to install additional development packages.</p>
<h2>Get PyCharm</h2>
<p>Go and <a href="https://www.jetbrains.com/pycharm/download/#section=linux" target="_blank">get pycharm for your operating system</a>. Follow the easy installation instructions on their website.</p>
<h2>Setup privacyIDEA project</h2>
<p>Now start pycharm and now we can set up the new privacyIDEA project.</p>
<figure id="attachment_1049" aria-describedby="caption-attachment-1049" style="width: 300px" class="wp-caption alignnone"><a href="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-01.png"><img loading="lazy" decoding="async" class="wp-image-1049 size-medium" src="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-01-300x291.png" alt="pycharm-01" width="300" height="291" srcset="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-01-300x291.png 300w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-01.png 474w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><figcaption id="caption-attachment-1049" class="wp-caption-text">Create a new project.</figcaption></figure>
<p>Choose &#8220;Create New Project&#8221;. Select a &#8220;Pure Python&#8221; project with the Location of the folder, where you cloned the git repository.</p>
<figure id="attachment_1048" aria-describedby="caption-attachment-1048" style="width: 300px" class="wp-caption alignnone"><a href="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-02-create-new-project.png"><img loading="lazy" decoding="async" class="wp-image-1048 size-medium" src="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-02-create-new-project-300x178.png" alt="pycharm-02-create-new-project" width="300" height="178" srcset="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-02-create-new-project-300x178.png 300w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-02-create-new-project-768x456.png 768w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-02-create-new-project.png 782w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><figcaption id="caption-attachment-1048" class="wp-caption-text">Select the directory of the cloned git repository.</figcaption></figure>
<p>We need to change the Interpreter. We want to use the Python Interpreter from our virtualenv. So click on the gear icon next to &#8220;Interpreter&#8221;, choose &#8220;Add local Python Interpreter&#8221; and select the python binary from your virtualenv.</p>
<p>&nbsp;</p>
<figure id="attachment_1046" aria-describedby="caption-attachment-1046" style="width: 300px" class="wp-caption alignnone"><a href="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-04.png"><img loading="lazy" decoding="async" class="wp-image-1046 size-medium" src="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-04-300x146.png" alt="pycharm-04" width="300" height="146" srcset="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-04-300x146.png 300w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-04-768x374.png 768w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-04.png 972w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><figcaption id="caption-attachment-1046" class="wp-caption-text">Use the existing files to create the project.</figcaption></figure>
<p>pycharm is now indexing the python code in your project. This may take quite a while.</p>
<p>Meanwhile we can&#8230;</p>
<h2>Set up your local privacyIDEA</h2>
<p>We are running and debugging privacyIDEA from within pycharm. We will do this on the current code we are developing. Thus we need to setup privacyIDEA. In the root directory of the project you will find the script <em>pi-manage</em>.</p>
<p>We need to create encryption and signing keys and also the local database &#8220;data.sqlite&#8221;. This configuration is read from the internal config in <em>privacyidea/config.py</em>.</p>
<pre>./pi-manage create_enckey
./pi-manage create_audit_keys
./pi-manage createdb
./pi-manage admin add &lt;yourAdminAccount&gt;</pre>
<p>In the last step we create the first token administrator. You may think of a name and provide the administrators password.</p>
<h2>Create Run and Debug Configurations</h2>
<p>When indexing is done, we can create <em>Run and Debug Configurations</em>. These configurations help you to run tests, run the privacyIDEA server and also debug these runs.</p>
<p>On the upper right corner is a drop down box, which is initially empty. Choose &#8220;Edit Configurations&#8230;&#8221;.</p>
<figure id="attachment_1051" aria-describedby="caption-attachment-1051" style="width: 600px" class="wp-caption alignnone"><a href="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-create-run-configuration.png"><img loading="lazy" decoding="async" class="wp-image-1051" src="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-create-run-configuration-300x229.png" alt="pycharm-create-run-configuration" width="600" height="458" srcset="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-create-run-configuration-300x229.png 300w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-create-run-configuration-768x587.png 768w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-create-run-configuration-1024x782.png 1024w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-create-run-configuration.png 1063w" sizes="auto, (max-width: 600px) 100vw, 600px" /></a><figcaption id="caption-attachment-1051" class="wp-caption-text">Create run configuration</figcaption></figure>
<p>First we will create a pure Python configuration we might call &#8220;run server&#8221;. The server can be run locally also using the script <em>pi-manage</em>. Thus we enter &#8220;pi-manage&#8221; as the Script and &#8220;runserver&#8221; as the parameter.</p>
<p>Please assure, to select the correct Python interpreter. This one in our virtualenv!</p>
<p>Also choose the project root directory as working directory. This way we do not have to install the privacyIDEA python module, but can just run on the current code.</p>
<p>We also create a second configuration which we use to run all integrated tests.</p>
<figure id="attachment_1053" aria-describedby="caption-attachment-1053" style="width: 600px" class="wp-caption alignnone"><a href="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-run-tests.png"><img loading="lazy" decoding="async" class="wp-image-1053" src="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-run-tests-300x241.png" alt="pycharm-run-tests" width="600" height="483" srcset="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-run-tests-300x241.png 300w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-run-tests-768x618.png 768w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-run-tests.png 952w" sizes="auto, (max-width: 600px) 100vw, 600px" /></a><figcaption id="caption-attachment-1053" class="wp-caption-text">Create Test configuration</figcaption></figure>
<p>The test configuration lets us run all 700+ tests in the tests directory.</p>
<h2>Run it!</h2>
<p>Want to see, what I mean? Select the configuration &#8220;run server&#8221; and hit the green start triangle. pycharm will run privacyIDEA and it will listen on localhost:5000.</p>
<p>You can now navigate your browser to <a href="http://localhost:5000" target="_blank">http://localhost:5000</a> and log in as the administrator, which you created earlier.</p>
<h2>The Code</h2>
<p>On the left side you can have different views like the project view (files) or the code structure of the current file.</p>
<figure id="attachment_1040" aria-describedby="caption-attachment-1040" style="width: 599px" class="wp-caption alignnone"><a href="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-structure.png"><img loading="lazy" decoding="async" class="wp-image-1040" src="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-structure-300x194.png" alt="pycharm-structure" width="599" height="387" srcset="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-structure-300x194.png 300w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-structure-768x496.png 768w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-structure-1024x661.png 1024w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-structure.png 1106w" sizes="auto, (max-width: 599px) 100vw, 599px" /></a><figcaption id="caption-attachment-1040" class="wp-caption-text">Code structure</figcaption></figure>
<p>There are many different ways to navigate the code and over time everyone will finds his preferred way. You can navigate via the tree views on the left, by navigating within the code by jumping the method and class definitions or by the breadcrumps above the main window.</p>
<p>Within the project you can also use Ctrl-H so search anything in the current sub folder.</p>
<h3>privacyIDEA Code Structure</h3>
<figure id="attachment_1058" aria-describedby="caption-attachment-1058" style="width: 469px" class="wp-caption alignnone"><a href="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-privacyidea-structure.png"><img loading="lazy" decoding="async" class="wp-image-1058 size-full" src="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-privacyidea-structure.png" alt="pycharm-privacyidea-structure" width="469" height="578" srcset="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-privacyidea-structure.png 469w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-privacyidea-structure-243x300.png 243w" sizes="auto, (max-width: 469px) 100vw, 469px" /></a><figcaption id="caption-attachment-1058" class="wp-caption-text">privacyIDEA Code structure</figcaption></figure>
<p>The basic structure in privacyIDEA looks like this:</p>
<p>You will find the database definition in <em>privacyidea/models.py</em>.</p>
<p>All library functions, which operate on the database are located in <em>privacyidea/lib/</em>. The REST API of the privacyIDEA server is defined in <em>privacyidea/api/</em>.</p>
<p><em>privacyidea/webui/</em> contains the jump in point for the UI. The privacyIDEA WebUI is implemented as a AngularJS Single Page Application. All this can be found in <em>privacyidea/static/</em>.</p>
<h2>Debug it!</h2>
<figure id="attachment_1041" aria-describedby="caption-attachment-1041" style="width: 600px" class="wp-caption alignnone"><a href="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-debug-view.png"><img loading="lazy" decoding="async" class="wp-image-1041" src="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-debug-view-300x216.png" alt="pycharm-debug-view" width="600" height="432" srcset="https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-debug-view-300x216.png 300w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-debug-view-768x553.png 768w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-debug-view-1024x738.png 1024w, https://www.privacyidea.org/wp-content/uploads/2016/09/pycharm-debug-view.png 1614w" sizes="auto, (max-width: 600px) 100vw, 600px" /></a><figcaption id="caption-attachment-1041" class="wp-caption-text">Debug the code, the auth API</figcaption></figure>
<p>You may also select the configuration &#8220;run server&#8221; and hit the debug button. privacyIDEA will be started and listen on port 5000. But this time you can set breakpoints and step through the code. In the above example we set a breakpoint in the REST API /auth/ which is called when a user is trying to login to the WebUI. This way we can stept through the login process and monitor all variables.</p>
<h2>Fork it!</h2>
<p>I very much hope you liked this short introduction and it helps you to better understand the internals of privacyIDEA or to get started with privacyIDEA development. So go and fork privacyIDEA at github, get your pycharm, add new features and issue your pull requests!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/privacyidea-development-howto/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
