|
| 1 | +.. image:: https://odoo-community.org/readme-banner-image |
| 2 | + :target: https://odoo-community.org/get-involved?utm_source=readme |
| 3 | + :alt: Odoo Community Association |
| 4 | + |
| 5 | +============ |
| 6 | +Auth Api Key |
| 7 | +============ |
| 8 | + |
| 9 | +.. |
| 10 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 11 | + !! This file is generated by oca-gen-addon-readme !! |
| 12 | + !! changes will be overwritten. !! |
| 13 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 14 | + !! source digest: sha256:78e3946b0dbb81bb6fbf6c434aaf5214faec00449a765c2f41e321b65024ba05 |
| 15 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 16 | +
|
| 17 | +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png |
| 18 | + :target: https://odoo-community.org/page/development-status |
| 19 | + :alt: Production/Stable |
| 20 | +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png |
| 21 | + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html |
| 22 | + :alt: License: LGPL-3 |
| 23 | +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github |
| 24 | + :target: https://github.com/OCA/server-auth/tree/19.0/auth_api_key |
| 25 | + :alt: OCA/server-auth |
| 26 | +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png |
| 27 | + :target: https://translation.odoo-community.org/projects/server-auth-19-0/server-auth-19-0-auth_api_key |
| 28 | + :alt: Translate me on Weblate |
| 29 | +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png |
| 30 | + :target: https://runboat.odoo-community.org/builds?repo=OCA/server-auth&target_branch=19.0 |
| 31 | + :alt: Try me on Runboat |
| 32 | + |
| 33 | +|badge1| |badge2| |badge3| |badge4| |badge5| |
| 34 | + |
| 35 | +Authenticate http requests from an API key. |
| 36 | + |
| 37 | +API keys are codes passed in (in the http header API-KEY) by programs |
| 38 | +calling an API in order to identify -in this case- the calling program's |
| 39 | +user. |
| 40 | + |
| 41 | +Take care while using this kind of mechanism since information into http |
| 42 | +headers are visible in clear. Thus, use it only to authenticate requests |
| 43 | +from known sources. |
| 44 | + |
| 45 | +For unknown sources, it is a good practice to filter out this header at |
| 46 | +proxy level. |
| 47 | + |
| 48 | +Odoo allows users to authenticate ``XMLRPC/JSONRPC`` calls using their |
| 49 | +API key instead of a password by native API keys (``res.users.apikey``). |
| 50 | +However, ``auth_api_key`` has some special features of its own such as: |
| 51 | + |
| 52 | +- API keys remain usable even when the user is inactive, if enabled via |
| 53 | + settings (e.g., for system users in a shopinvader case). |
| 54 | +- Supports dual authentication via Basic Auth and API_KEY in separate |
| 55 | + HTTP headers. |
| 56 | +- Admins can manage API keys for all users |
| 57 | + |
| 58 | +Given these advantages, particularly in use case like system user |
| 59 | +authentication, we have decided to keep the ``auth_api_key`` module |
| 60 | + |
| 61 | +**Table of contents** |
| 62 | + |
| 63 | +.. contents:: |
| 64 | + :local: |
| 65 | + |
| 66 | +Configuration |
| 67 | +============= |
| 68 | + |
| 69 | +The api key menu is available into Settings > Technical in debug mode. |
| 70 | +By default, when you create an API key, the key is saved into the |
| 71 | +database. |
| 72 | + |
| 73 | +If you want to manage them via serve environment settings use |
| 74 | +auth_api_key_server_env. |
| 75 | + |
| 76 | +Usage |
| 77 | +===== |
| 78 | + |
| 79 | +To apply this authentication system to your http request you must set |
| 80 | +'api_key' as value for the 'auth' parameter of your route definition |
| 81 | +into your controller. |
| 82 | + |
| 83 | +.. code:: python |
| 84 | +
|
| 85 | + class MyController(Controller): |
| 86 | +
|
| 87 | + @route('/my_service', auth='api_key', ...) |
| 88 | + def my_service(self, *args, **kwargs): |
| 89 | + pass |
| 90 | +
|
| 91 | +Bug Tracker |
| 92 | +=========== |
| 93 | + |
| 94 | +Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-auth/issues>`_. |
| 95 | +In case of trouble, please check there if your issue has already been reported. |
| 96 | +If you spotted it first, help us to smash it by providing a detailed and welcomed |
| 97 | +`feedback <https://github.com/OCA/server-auth/issues/new?body=module:%20auth_api_key%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
| 98 | + |
| 99 | +Do not contact contributors directly about support or help with technical issues. |
| 100 | + |
| 101 | +Credits |
| 102 | +======= |
| 103 | + |
| 104 | +Authors |
| 105 | +------- |
| 106 | + |
| 107 | +* ACSONE SA/NV |
| 108 | + |
| 109 | +Contributors |
| 110 | +------------ |
| 111 | + |
| 112 | +- Denis Robinet <denis.robinet@acsone.eu> |
| 113 | +- Laurent Mignon <laurent.mignon@acsone.eu> |
| 114 | +- Quentin Groulard <quentin.groulard@acsone.eu> |
| 115 | +- Sébastien Beau <sebastien.beau@akretion.com> |
| 116 | +- Chafique Delli <chafique.delli@akretion.com> |
| 117 | +- Thien Vo Hong <thienvh@trobz.com> |
| 118 | + |
| 119 | +Other credits |
| 120 | +------------- |
| 121 | + |
| 122 | +The migration of this module from 17.0 to 18.0 was financially supported |
| 123 | +by Camptocamp. |
| 124 | + |
| 125 | +Maintainers |
| 126 | +----------- |
| 127 | + |
| 128 | +This module is maintained by the OCA. |
| 129 | + |
| 130 | +.. image:: https://odoo-community.org/logo.png |
| 131 | + :alt: Odoo Community Association |
| 132 | + :target: https://odoo-community.org |
| 133 | + |
| 134 | +OCA, or the Odoo Community Association, is a nonprofit organization whose |
| 135 | +mission is to support the collaborative development of Odoo features and |
| 136 | +promote its widespread use. |
| 137 | + |
| 138 | +This module is part of the `OCA/server-auth <https://github.com/OCA/server-auth/tree/19.0/auth_api_key>`_ project on GitHub. |
| 139 | + |
| 140 | +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
0 commit comments