<?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>login &#8211; privacyID3A</title>
	<atom:link href="https://www.privacyidea.org/tag/login/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.privacyidea.org</link>
	<description>flexible, Open Source Multi Factor Authentication (2FA)</description>
	<lastBuildDate>Wed, 08 Mar 2017 12:03:42 +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>login &#8211; privacyID3A</title>
	<link>https://www.privacyidea.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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 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="(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>SSH Keys and OTP: Really strong two factor authentication</title>
		<link>https://www.privacyidea.org/ssh-keys-and-otp-really-strong-two-factor-authentication/</link>
					<comments>https://www.privacyidea.org/ssh-keys-and-otp-really-strong-two-factor-authentication/#comments</comments>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Thu, 29 Oct 2015 11:00:29 +0000</pubDate>
				<category><![CDATA[documentation]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[Yubikey]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=771</guid>

					<description><![CDATA[This blog will show how you can use privacyIDEA to secure your SSH login. In this case users need to provide an SSH Key and in addition an OTP token and an optional password. Thus you have the following authentication factors: SSH Key (soft possession factor &#8211; copyable!) optional passphrase on the SSH Key, which is [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This blog will show how you can use privacyIDEA to secure your SSH login. In this case users need to provide an SSH Key and in addition an OTP token and an optional password.</p>
<p>Thus you have the following authentication factors:</p>
<ol>
<li>SSH Key (soft <strong>possession</strong> factor &#8211; copyable!)</li>
<li>optional passphrase on the SSH Key, which is not controlled by the server! (<strong>knowledge</strong>)</li>
<li>OTP token <a href="http://privacyidea.readthedocs.org/en/latest/configuration/token_config.html#supported-tokentypes" target="_blank">supported by privacyIDEA</a> like Google Authenticator or preferable a Yubikey (hard <strong>possession</strong> factor &#8211; not copyable)</li>
<li>an optional OTP PIN controlled by privacyIDEA (<strong>knowledge</strong>)</li>
</ol>
<h2>Connect SSH to privacyIDEA</h2>
<p>Connecting SSH to privacyIDEA is described in this <a href="https://www.youtube.com/watch?v=tNoHzrajtcg&amp;t=1m52s" target="_blank">video</a>. It uses the privacyIDEA PAM Module in the <a href="http://privacyidea.readthedocs.org/en/latest/application_plugins/index.html#pluggable-authentication-module">online documentation</a>.</p>
<p>In the SSH configuration you need to set</p>
<pre>UsePAM yes</pre>
<p>This way SSH will authenticate the user against the PAM stack using <em>/etc/pam.d/sshd</em>.</p>
<p>This howto will assume you are using a Ubuntu system. Other systems like CentOS use slightly different PAM configuration, but the idea is the same.</p>
<h3>Install privacyIDEA PAM</h3>
<p>To use PAM with privacyIDEA you need the privacyIDEA <a href="https://github.com/privacyidea/pam_python">PAM authentication module</a>. On a Ubuntu 14.04 you can install it like</p>
<pre>add-apt-repository ppa:privacyidea/privacyidea
apt-get update
apt-get install privacyidea-pam</pre>
<p>In other cases you can get it from github with the above mentioned link.</p>
<h3>Configure SSH PAM</h3>
<p>Now lets take a look at the PAM config for SSH. The file <em>/etc/pam.d/sshd</em> contains a line</p>
<pre>@include common-auth</pre>
<p>Change this line to</p>
<pre>@include common-auth-pi</pre>
<p>By creating such a new file it is easier for us to add two factors to every PAM enabled service.</p>
<p>Copy the file <em>/etc/pam.d/common-auth</em> to <em>/etc/pam.d/common-auth-pi</em>. The file<em> /etc/pam.d/common-auth-pi</em> will look like this:</p>
<pre>auth     [success=1 default=ignore] pam_python.so /lib/security/privacyidea_pam.py url=https://yourserver \ 
                                                  nosslverify debug
auth    requisite   pam_deny.so
auth    required    pam_permit.so
auth    optional    pam_cap.so</pre>
<p>In the file <em>common-auth-pi</em> we replace <em>pam_unix.so</em> with <em>privacyidea_pam</em>. You need to specify the URL of your privacyIDEA server. If everything is working out fine, you can remove the <em>debug</em> parameter. If you have a trusted certificate you can remove <em>nosslverify</em>.</p>
<blockquote><p>Please assure, that you are logged in to your system or that you have other mean to login like ssh keys. Modifying the PAM stack for SSH can result in not being able to login with a password via SSH anymore.</p></blockquote>
<p>Now that you have configured</p>
<ul>
<li>/etc/ssh/sshd_config</li>
<li>/etc/pam.d/common-auth-pi</li>
<li>/etc/pam.d/sshd</li>
</ul>
<p>you can restart the SSH server for the changes to take effect.</p>
<p>When you now try to login via SSH, the username and password will be sent to privacyIDEA for verification. You can not use you OTP PIN and Yubikey to login.</p>
<blockquote><p>If you experience any problems, take a look at <em>/var/log/auth.log</em>.</p></blockquote>
<p>If everything is working fine, you are now authenticating with:</p>
<ol>
<li>OTP token <a href="http://privacyidea.readthedocs.org/en/latest/configuration/token_config.html#supported-tokentypes" target="_blank">supported by privacyIDEA</a> like Google Authenticator or preferable a Yubikey (hard <strong>possession</strong> factor &#8211; not copyable)</li>
<li>an optional OTP PIN controlled by privacyIDEA (<strong>knowledge</strong>)</li>
</ol>
<h2>Add SSH Keys</h2>
<p>You may realize, that if you have an SSH key in the authorized_keys you will not be asked for the OTP. At the moment you either login with SSH key or with OTP. Let&#8217;s change this now, that you can use SSH key <strong>and</strong> OTP.</p>
<p>The current OpenSSH comes with the options <strong>AuthenticationMethods</strong>. This is used to concatenate required authentication methods. See the man page of sshd_config for more details.</p>
<p>In the file<em> /etc/ssh/sshd_config</em> we add this line:</p>
<pre>AuthenticationMethods publickey,password</pre>
<p>This means that SSH will require that you pass a trusted SSH key and after this ask you for a password (PIN+OTP), which will be verified by privacyIDEA.</p>
<p>The login will look like this:</p>
<pre>root@gawain ~ # ssh root@privacyidea
Authenticated with partial success.
root@privacyidea's password: 
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-66-generic x86_64)</pre>
<p>The &#8220;Authenticated with partial success&#8221; means, that the authentication with the SSH key succeeded. Now you need to specify the One Time Password to be sent to privacyIDEA.</p>
<blockquote><p>Note: If you want to login as user &#8220;root&#8221;, be sure to add &#8220;PermitRootLogin yes&#8221; to your<em> sshd_config</em>.</p></blockquote>
<p>Finally we managed to authenticate the users with:</p>
<ol>
<li>SSH Key (soft <strong>possession</strong> factor &#8211; copyable!)</li>
<li>optional passphrase on the SSH Key, which is not controlled by the server! (<strong>knowledge</strong>)</li>
<li>OTP token <a href="http://privacyidea.readthedocs.org/en/latest/configuration/token_config.html#supported-tokentypes" target="_blank">supported by privacyIDEA</a> like Google Authenticator or preferable a Yubikey (hard <strong>possession</strong> factor &#8211; not copyable)</li>
<li>an optional OTP PIN controlled by privacyIDEA (<strong>knowledge</strong>)</li>
</ol>
<h2>Manage SSH Keys with privacyIDEA</h2>
<p>Wait! Are you still there? One thing might still strike you:</p>
<p>While all OTP tokens are centrally managed by privacyIDEA, users still put their public SSH keys on all the machines and you are wondering where the SSH keys of all the users are floating around.</p>
<p>There is no easy way for you to revoke a compromized SSH key.</p>
<p>But you can also solve this with privacyIDEA. Users can upload their public SSH keys to privacyIDEA with the tokentype <a href="http://privacyidea.readthedocs.org/en/latest/configuration/tokens/sshkey.html" target="_blank">SSH Key</a>.</p>
<p>This way you can also manage all SSH keys in privacyIDEA. In sshd_config you need to use the AuthorizedKeysCommand to retrieve the SSH keys from privayyIDEA just in time. Deleting an SSH key in privacyIDEA will deny access for this user immediatly.</p>
<p>You can read <a href="https://www.howtoforge.com/tutorial/ssh-key-management-with-privacyidea/" target="_blank">SSH Key Management with privacyIDEA</a> to set this up.</p>
<p>This way you have three strong factors to secure the access to SSH.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/ssh-keys-and-otp-really-strong-two-factor-authentication/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>New howto at howtoforge: Securing WordPress</title>
		<link>https://www.privacyidea.org/new-howto-at-howtoforge-securing-wordpress/</link>
					<comments>https://www.privacyidea.org/new-howto-at-howtoforge-securing-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Fri, 25 Jul 2014 06:40:07 +0000</pubDate>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=372</guid>

					<description><![CDATA[There is a new Howto at howtoforge.com, that describes how you can secure your wordpress login using privacyIDEA.]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignleft wp-image-373" src="https://www.privacyidea.org/wp-content/uploads/2014/07/wordpress-logo-notext-rgb-300x300.png" alt="wordpress-logo-notext-rgb" width="100" height="100" srcset="https://www.privacyidea.org/wp-content/uploads/2014/07/wordpress-logo-notext-rgb-300x300.png 300w, https://www.privacyidea.org/wp-content/uploads/2014/07/wordpress-logo-notext-rgb-150x150.png 150w, https://www.privacyidea.org/wp-content/uploads/2014/07/wordpress-logo-notext-rgb.png 500w" sizes="auto, (max-width: 100px) 100vw, 100px" /></p>
<p>There is a new <a href="http://www.howtoforge.com/secure-wordpress-login-with-two-factor-authentication-using-privacyidea" target="_blank">Howto at howtoforge.com</a>, that describes how you can secure your wordpress login using privacyIDEA.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/new-howto-at-howtoforge-securing-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
