| 1 |
Apache Apisix |
| 2 |
============= |
| 3 |
|
| 4 |
|logo| |
| 5 |
|
| 6 |
Presentation |
| 7 |
------------ |
| 8 |
`Apache Apisix <https://apisix.apache.org/>`__ is a modern, high-performance, and cloud-native API gateway |
| 9 |
that enables you to manage and secure your API traffic effectively. |
| 10 |
It acts as an intermediary between clients and backend services, providing features such as load balancing, |
| 11 |
authentication, rate limiting, traffic control, and more |
| 12 |
|
| 13 |
Configuration |
| 14 |
-------------- |
| 15 |
|
| 16 |
LemonLDAP::NG |
| 17 |
~~~~~~~~~~~~~ |
| 18 |
|
| 19 |
Make sure you have already |
| 20 |
:doc:`enabled OpenID Connect<../idpopenidconnect>` on your LemonLDAP::NG |
| 21 |
server. |
| 22 |
|
| 23 |
APISIX acts as OpenID-COnnect Ressource Server, then it only validates given |
| 24 |
access_token. So LLNG configuration is related to the real Relying Party. |
| 25 |
|
| 26 |
Then, add a Relying Party with the following configuration: |
| 27 |
|
| 28 |
- Client ID : choose a client ID, such as ``james_client_id`` |
| 29 |
- Client Secret : choose a client secret, such as ``james_client_secret`` |
| 30 |
- Logout URL: endpoint to Apisix revoked token plugin, such as ``http://apisix.example.com:8081/add-revoked-token`` |
| 31 |
- Login redirect URI: such as ``http://apisix.example.com:8081/login-callback.html`` |
| 32 |
- **Options/Advanced** |
| 33 |
* **Release claims in Access Token**: set to **On** |
| 34 |
|
| 35 |
Define exported attributes: |
| 36 |
|
| 37 |
- ``email``: the user identifier |
| 38 |
|
| 39 |
Apisix |
| 40 |
~~~~~~ |
| 41 |
|
| 42 |
The Apisix route configuration for OIDC is as follows: (based on `openid-connect plugins <https://apisix.apache.org/docs/apisix/plugins/openid-connect/>`__) |
| 43 |
|
| 44 |
.. code-block:: yaml |
| 45 |
|
| 46 |
services: |
| 47 |
- |
| 48 |
id: jmap_service_oidc |
| 49 |
upstream_id: jmap_upstream |
| 50 |
plugins: |
| 51 |
openid-connect: |
| 52 |
_meta: |
| 53 |
filter: |
| 54 |
- - request_method |
| 55 |
- "~=" |
| 56 |
- OPTIONS |
| 57 |
client_id: "james_client_id" |
| 58 |
client_secret: "james_client_secret" |
| 59 |
discovery: "http://lemonldap.domain/auth/realms/oidc/.well-known/openid-configuration" |
| 60 |
scope: "openid profile email" |
| 61 |
bearer_only: true |
| 62 |
use_jwks: true |
| 63 |
|
| 64 |
.. note:: |
| 65 |
|
| 66 |
The example with Apisix and Apache James can be found here: `<https://github.com/apache/james-project/blob/master/examples/oidc/README.md>`__ |
| 67 |
|
| 68 |
.. |logo| image:: /applications/apache_apisix_logo.png |
| 69 |
:class: align-center |