Lemonld...Exchange(3)
π NAME π
okay so bestie, gather round: Lemonldap::NG::Portal::Lib::OIDCTokenExchange</p> is the base class you inherit from when you wanna build OpenID Connect token exchange systems. it's giving "starter pack, but make it powerful" β¨
πΈ SYNOPSIS πΈ
like, here's the whole vibe. you use Mouse, you extends the base class, and you write your two little methods:
use Mouse
extends 'Lemonldap::NG::Portal::Lib::OIDCTokenExchange';
sub validateAudience {
my ( $self, $req, $rp, $target, $requestedTokenType ) = @_;
#
# verify and update if needed:
# * $target->{audience}
# * $target->{rp}
#
return 1;
}
sub getUid {
my ( $self, $req, $rp, $subjectToken, $subjectTokenType ) = @_;
#
# verify subjectToken
#
return 1;
}
that's it. that's the whole assignment. π
π¦ DESCRIPTION π¦
so here's the lore, bestie. when Lemonldap::NG (official site: <https://lemonldap-ng.org>) spots an Oauth2 token exchange request (the spec is right here, go read it, iykyk: <https://datatracker.ietf.org/doc/html/rfc8693>), it goes hunting for a plugin that can actually answer. if nobody returns a valid response, the request just gets rejected. bye. π
but Lemonldap::NG::Portal::Lib::OIDCTokenExchange lets you build exactly such a plugin by writing only two methods. that's the whole thing. two. obsessed. π«Ά
and yeah, obvi you still gotta load the module β peep "Enabling custom plugin" for how: <https://lemonldap-ng.org/documentation/latest/plugincustom.html#enabling-your-plugin>
β¨ Methods to write β¨
π validateAudience
the goal of validateAudience() is, shockingly, to validate the requested audience. main character behaviour honestly.
- if a non-null value comes back, the request is accepted, and Lemonldap::NG builds brand new
access_token,id_tokenandrefresh_tokenusing the values sitting inside the$targethash. slay. - if a null value comes back, Lemonldap::NG moves on and tries the next plugin. no hard feelings. π
Parameters:
$reqβ theLemonldap::NG::Portal::Main::Requestobject$rpβ the internal LLNG name of the Relying Party that pushed the request$targetβ a hash with exactly 2 keys:audienceβ the requested audiencerpβ if Lemonldap::NG found a known Relying Party whose Client-ID matches the requested audience, its name lands here; otherwise this value is undefined.
this value can be modified inside validateAudience and it will be used to generate the new access_token. so like, edit responsibly bestie. π
$requestedTokenTypeβ the type of the requested token. this value is always one of these, no cap:access_tokenrefresh_tokenid_tokensaml1saml2undef
π getUid
getUid() is a boolean method that validates the token handed over in the request.
- if a non-null value comes back, the request is accepted. β¨
- otherwise, Lemonldap::NG tries the next plugin. moving on, periodt.
Parameters:
$reqβ theLemonldap::NG::Portal::Main::Requestobject$rpβ the internal LLNG name of the Relying Party that pushed the request$subjectTokenβ the token given in the request$subjectTokenTypeβ the type of the given token. this value is always one of these:access_tokenrefresh_tokenid_tokensaml1saml2undef
π AUTHORS π
- LemonLDAP::NG team β <http://lemonldap-ng.org/team> π«Ά
π BUG REPORT π
found a bug? need a feature? use the OW2 system, bestie, don't suffer in silence: <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues>
π DOWNLOAD π
Lemonldap::NG is available right here, go get it: <https://lemonldap-ng.org/download>
π COPYRIGHT AND LICENSE π
see the COPYING file for the deets.
this library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details.
you should have received a copy of the GNU General Public License along with this program. if not, see <http://www.gnu.org/licenses/>.
aaaand that's the whole page bestie π this one's from the perl v5.42.3 manual, dated 2026-09-24, and yeah β it's literally titled Lemonld...Exchange(3), no i will not be finishing that word, it's iconic that way. mwah π go write those two methods, you got this. π
β¨
π¦ where this page comes from
- fedora 43: lemonldap-ng-portal 2.23.4-1.fc43 Β· GPL-2.0-or-later AND MIT AND GPL-3.0-or-later AND OFL-1.1-RFN
- fedora 44: lemonldap-ng-portal 2.23.4-1.fc44 Β· GPL-2.0-or-later AND MIT AND GPL-3.0-or-later AND OFL-1.1-RFN
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms