| 1 |
OpenID Connect Token Exchange |
| 2 |
============================= |
| 3 |
|
| 4 |
Presentation |
| 5 |
~~~~~~~~~~~~ |
| 6 |
|
| 7 |
Token exchange is the process of using a set of credentials or token to obtain |
| 8 |
an entirely different token, for example to get access to an application not |
| 9 |
included in current ``access_token``. |
| 10 |
|
| 11 |
Available Token Exchange systems |
| 12 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 13 |
|
| 14 |
.. tip:: |
| 15 |
|
| 16 |
The ``Lemonldap::NG::Portal::Lib::OIDCTokenExchange`` base class allow |
| 17 |
developers to easily write some other token exchange systems. See |
| 18 |
its manpage. |
| 19 |
|
| 20 |
|
| 21 |
Internal Token Exchange |
| 22 |
----------------------- |
| 23 |
|
| 24 |
LLNG provide an internal OIDC token exchange system that allows an OIDC relying |
| 25 |
party to ask for an access_token available for another. |
| 26 |
|
| 27 |
Configuration |
| 28 |
^^^^^^^^^^^^^ |
| 29 |
|
| 30 |
The only thing to configure is to add a list of Relying Party authorized to ask |
| 31 |
for an access_token into the destination Relying Party. This list contains a |
| 32 |
space separated of Relying Party names *(use the internal LLNG name, not the |
| 33 |
client ID)*: "OpenID Connect Relying Party » dest » Options » Advanced » Other RP allowed to exchange access_token". |
| 34 |
|
| 35 |
How to use it |
| 36 |
^^^^^^^^^^^^^ |
| 37 |
|
| 38 |
Request parameters: |
| 39 |
|
| 40 |
* **Authentication** *(RP source)*: |
| 41 |
|
| 42 |
* ``client_id``: the client identifier |
| 43 |
* ``client_secret`` if client isn't public |
| 44 |
* ``subject_token``: the current ``access_token`` |
| 45 |
|
| 46 |
* **Oauth2 parameters**: |
| 47 |
|
| 48 |
* ``grant_type`` must be ``urn:ietf:params:oauth:grant-type:token-exchange`` |
| 49 |
* ``subject_token_type`` *(optional)*, only ``urn:ietf:params:oauth:token-type:access_token`` is supported here |
| 50 |
* ``requested_token_type`` *(optional)*, only ``urn:ietf:params:oauth:token-type:access_token`` is supported here |
| 51 |
|
| 52 |
* **Target**: |
| 53 |
|
| 54 |
* ``audience``: the client identifier of the target *(not the internal LLNG name)* |
| 55 |
|
| 56 |
Exemple: |
| 57 |
|
| 58 |
:: |
| 59 |
|
| 60 |
curl -X POST \ |
| 61 |
-d "client_id=clientIdSrc" \ |
| 62 |
--data-urlencode "client_secret=ClientSecretSrc" \ |
| 63 |
--data-urlencode "grant_type=urn:ietf:params:oauth:grant-type:token-exchange" \ |
| 64 |
--data-urlencode "subject_token=accessTokenString" \ |
| 65 |
--data-urlencode "requested_token_type=urn:ietf:params:oauth:token-type:access_token" \ |
| 66 |
-d "audience=target-client" \ |
| 67 |
http://auth.example.com/oauth2/token |