├── .gitignore ├── .travis.yml ├── BLURB ├── COPYING ├── MANIFEST.in ├── NEWS ├── README ├── README.adoc ├── conf └── logging.conf ├── doc ├── LDAP_Setup.adoc ├── REST_API.adoc └── YubiHSM_Setup.adoc ├── examples ├── dictionary.yubiauth ├── http_basic_auth.py └── rlm_yubiauth.pl ├── release.py ├── setup.cfg ├── setup.py ├── test ├── test_client_api.py ├── test_rest_api.py ├── test_users.py ├── test_yhsm.py ├── test_yubikeys.py └── utils.py └── yubiauth ├── __init__.py ├── client ├── __init__.py ├── controller.py ├── model.py ├── rest.py ├── templates │ ├── assign_yubikey.html │ ├── base.html │ ├── change_password.html │ ├── created.html │ ├── form.html │ ├── layout.html │ ├── logged_in.html │ ├── login.html │ ├── manage.html │ ├── reauthenticate.html │ ├── register.html │ ├── revocation_code.html │ ├── revoke.html │ ├── session_required.html │ └── yubikey.html └── web.py ├── config.py ├── core ├── __init__.py ├── controller.py ├── ldapauth.py ├── model.py └── rest.py ├── default_settings.py ├── server.py ├── static ├── apple-touch-icon-114x114-precomposed.png ├── apple-touch-icon-144x144-precomposed.png ├── apple-touch-icon-57x57-precomposed.png ├── apple-touch-icon-72x72-precomposed.png ├── apple-touch-icon-precomposed.png ├── apple-touch-icon.png ├── css │ ├── bootstrap-responsive.css │ ├── bootstrap-responsive.min.css │ ├── bootstrap.css │ ├── bootstrap.min.css │ └── main.css ├── favicon.ico ├── img │ ├── glyphicons-halflings-white.png │ └── glyphicons-halflings.png └── js │ ├── main.js │ └── vendor │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.9.1.min.js │ └── modernizr-2.6.2-respond-1.1.0.min.js ├── util ├── __init__.py ├── controller.py ├── model.py ├── rest.py ├── static.py └── utils.py └── yhsm.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.egg-info 3 | *.egg 4 | build/ 5 | dist/ 6 | html/ 7 | .ropeproject 8 | ChangeLog 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "2.6" 4 | - "2.7" 5 | # Disabled as some dependencies don't work on Python 3. 6 | # - "3.2" 7 | # command to install dependencies 8 | install: "pip install -q -e . --use-mirrors" 9 | # command to run tests 10 | script: "python setup.py test" 11 | git: 12 | submodules: false 13 | -------------------------------------------------------------------------------- /BLURB: -------------------------------------------------------------------------------- 1 | Author: Yubico 2 | Basename: yubiauth 3 | Homepage: http://opensource.yubico.com/yubiauth/ 4 | License: BSD-2-Clause 5 | Name: yubiauth 6 | Project: yubiauth 7 | Summary: Authentication backend written in Python -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Yubico AB 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or 5 | without modification, are permitted provided that the following 6 | conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following 12 | disclaimer in the documentation and/or other materials provided 13 | with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19 | COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 25 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include COPYING 2 | include NEWS 3 | include release.py 4 | include ChangeLog 5 | include doc/*.md 6 | include examples/* 7 | include conf/* 8 | recursive-include yubiauth/static * 9 | recursive-include yubiauth/client/templates * 10 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | * Version 0.3.11 (unreleased) 2 | 3 | * Version 0.3.10 (released 2015-03-11) 4 | ** Fix per-user "_ldap_bind_dn" attribute (which was previously ignored). 5 | ** Improved documentation. 6 | 7 | * Version 0.3.9 (released 2014-08-02) 8 | ** Set pool recycle to 1h in SQLAlchemy (should prevent stale connections for MySQL). 9 | ** Added YubiKey lookup from LDAP. 10 | ** Return 404 when trying to unbind a YubiKey from a user if it was not already bound. 11 | 12 | * Version 0.3.8 (released 2014-02-21) 13 | ** Fixed compatibility with newer versions of yubico-client. 14 | ** Added dictionary for rlm_yubiauth. 15 | ** Fixed an issue with "allow_empty_passwords" not working correctly. 16 | 17 | * Version 0.3.7 (released 2013-11-25) 18 | ** Fixed bug with LDAP user auto-creation. 19 | 20 | * Version 0.3.6 (released 2013-11-22) 21 | ** Added LDAP authentication. 22 | 23 | * Version 0.3.5 (released 2013-07-19) 24 | ** Added customizable logging configuration. 25 | 26 | * Version 0.3.4 (released 2013-07-17) 27 | ** Unbounded attribute values. 28 | ** Added HTTP Basic Auth example. 29 | 30 | * Version 0.3.3 (released 2013-06-04) 31 | ** Renamed /client/status to /client/manage. 32 | ** Added setting to enable user deletion. 33 | 34 | * Version 0.3.2 (released 2013-06-04) 35 | ** Accept longs as well as ints in YubiAuth.get_user(). 36 | ** Improved logging. 37 | 38 | * Version 0.3.1 (released 2013-05-30) 39 | ** Bugfix release with include_package_data = True. 40 | 41 | * Version 0.3.0 (released 2013-05-30) 42 | ** Added examples/ with FreeRADIUS example. 43 | ** Use Beaker for session management. 44 | ** Added basic client UI for user registration and management. 45 | 46 | * Version 0.2.5 (released 2013-05-17) 47 | ** Fixed bug where custom YKVAL URLs were ignored. 48 | 49 | * Version 0.2.4 (released 2013-05-14) 50 | ** Cleanup rows in user-yubikey bindings table on user/yubikey deletion. 51 | ** Added renaming of users to core REST API. 52 | 53 | * Version 0.2.3 (released 2013-05-07) 54 | ** Better security for updating credentials. 55 | ** Moved configuration file to /etc/yubico/auth/yubiauth.conf 56 | 57 | * Version 0.2.2 (released 2013-05-07) 58 | ** Added auto-provisioning of YubiKeys (on by default) 59 | ** Added support for empty passwords (off by default). 60 | ** Added YubiKey identification (off by default). 61 | 62 | * Version 0.2.1 (released 2013-04-22) 63 | ** Re-release of 0.2.0 as the original release was missing files. 64 | 65 | * Version 0.2.0 (released 2013-04-22) 66 | ** Reorganized namespace. 67 | ** Added client API. 68 | 69 | * Version 0.1.3 (released 2013-04-15) 70 | ** Use latest yubico-client (1.7.0) with new module name. 71 | 72 | * Version 0.1.2 (released 2013-04-09) 73 | ** Prevent writing compiled version of the settings file. 74 | 75 | * Version 0.1.1 (released 2013-04-09) 76 | ** Added REST_PATH setting. 77 | ** Renamed configuration file to /etc/yubico/yubiauth/yubiauth.conf 78 | 79 | * Version 0.1 (released 2013-04-08) 80 | ** First public release. 81 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | == YubiAuth 2 | 3 | NOTE: This project is deprecated and is no longer being maintained. 4 | 5 | YubiAuth provides a user management system which can be used as a base for 6 | other systems. It allows the creation of users, which can be authenticated by 7 | username, password, and optionally a YubiKey OTP. 8 | 9 | Aside from providing a user authentication backend, YubiAuth allows storing 10 | and retrieving arbitrary key-value attributes for each user as well as each 11 | YubiKey. 12 | 13 | Though effort has been made to store password hashes securely, YubiAuth also 14 | allows using a YubiHSM for increased security. 15 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | README -------------------------------------------------------------------------------- /conf/logging.conf: -------------------------------------------------------------------------------- 1 | [loggers] 2 | keys=root 3 | 4 | [logger_root] 5 | level=INFO 6 | handlers=fileHandler 7 | 8 | [formatters] 9 | keys=formatter 10 | 11 | [handlers] 12 | keys=fileHandler 13 | 14 | [formatter_formatter] 15 | format=[%(levelname)s] %(asctime)s %(name)s: %(message)s 16 | datefmt=%Y-%m-%d %I:%M:%S 17 | 18 | [handler_fileHandler] 19 | class=handlers.WatchedFileHandler 20 | formatter=formatter 21 | args=("/var/log/yubiauth.log",) 22 | -------------------------------------------------------------------------------- /doc/LDAP_Setup.adoc: -------------------------------------------------------------------------------- 1 | == LDAP Setup 2 | If you already have an external user database which can be used to authenticate 3 | users over LDAP, you may use this with YubiAuth instead of the built-in 4 | password system. When LDAP password validation is used, local password 5 | validation will be disabled, and each time a user attempts to log in the 6 | request will be delegated to the LDAP server. Any user that does not exist in 7 | the LDAP database will not be able to log in. 8 | 9 | === Configuration 10 | To enable LDAP you will need to modify the configuration file, located here: 11 | 12 | /etc/yubico/auth/yubiauth.conf 13 | 14 | First off, find the USE_LDAP setting, and change it to True: 15 | 16 | USE_LDAP = True 17 | 18 | There are two more settings that are required to make things work. These are 19 | set as follows: 20 | 21 | LDAP_SERVER = '' 22 | 23 | This is the URL to the LDAP server to use for password authentication. The 24 | format for this is defined in http://www.ietf.org/rfc/rfc4516.txt[RFC 4516]. 25 | 26 | LDAP_BIND_DN = '