Net::O...:Client(3pm)

πŸ’– Net::OAuth2::Client β€” the deprecated bestie πŸ’–

okay so this is a page from the User Contributed Perl Documentation section of the manual, and the star of the show is Net::OAuth2::Client, a client for OAuth2 access with a deprecated interface. yes bestie, deprecated. it's giving "still here, still slaying, but please move on" πŸ’…


✨ NAME ✨

Net::OAuth2::Client β€” client for OAuth2 access, deprecated interface.

no cap, the word "deprecated" is literally in the NAME section. they were not subtle about it. 🫢

🌸 SYNOPSIS 🌸

# This module provides the deprecated interface
my $client = Net::OAuth2::Client->new(
    $client_id,
    $client_secret,
    site => $site
);

my $auth = $client->web_server(
    redirect_path => "$site/auth/facebook/callback"
);

# interface since v0.50
my $client = Net::OAuth2::Profile::WebServer->new(
    client_id     => $client_id,
    client_secret => $client_secret,
    site          => $site
    redirect_uri  => "$site/auth/facebook/callback"
);

so like, first block is the old ✨vibe✨, second block is the interface since v0.50. glow-up fr fr. note that the old one passes redirect_path and the new one passes redirect_uri β€” do not mix those up, they are not the same key and the code is verbatim, so copy it exactly, iykyk πŸ’€


πŸ¦‹ DESCRIPTION πŸ¦‹

This module is kept to translate the expired interface into the new interface.

that's it. that's the whole description. it's a translator, a little bridge between your old code and the new hotness. iconic behavior honestly. 🌈


πŸ‘‘ METHODS πŸ‘‘

πŸŽ€ Constructors πŸŽ€

  • Net::OAuth2::Client->new($id, $secret, %options) β€” this object collects all %options to be used when web_server() creates a profile. and listen: the $id gets translated into OPTION "client_id", and $secret gets translated into "client_secret". so you hand it the short names and it quietly does the paperwork for you. queen of admin. πŸ’…

🧚 Accessors 🧚

  • $obj->id() β€” the id accessor.
  • $obj->secret() β€” the secret accessor.
  • $obj->user_agent() β€” the user agent accessor.

three little getters, living their best lives, no drama. ✨

πŸ“ Actions πŸ“

  • $obj->password(%options) β€” creates a Net::OAuth2::Profile::Password object, based on all the options you passed with new(), overruled/extended by the %options you pass right here. so: new() sets the base vibe, this call layers on top of it. πŸ”₯
  • $obj->web_server(%options) β€” creates a Net::OAuth2::Profile::WebServer object, based on all the options you passed with new(), overruled/extended by the %options you pass right here. same energy, different profile. 🫢
reminder bestie: the %options you pass into the action method overrule and extend what you gave new(). it doesn't replace it wholesale, it stacks. that's the whole mechanic, don't skip it.

πŸ’œ COPYRIGHTS πŸ’œ

Copyrights 2013-2019 on the perl code and the related documentation by [Mark Overmeer <markov@cpan.org>] for SURFnet bv, The Netherlands. For other contributors see "Changes".

Copyrights 2011-2012 by Keith Grennan.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/

shoutout to the legends who wrote this: Mark Overmeer for SURFnet bv (2013-2019) and Keith Grennan (2011-2012). absolute icons, we love a documented lineage. πŸ‘‘

and that's the whole page, bestie πŸŽ€ this was perl v5.32.1, dated 2021-10-15, from the Net::O...:Client(3pm) page β€” now go migrate your interface, she's deprecated for a reason πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from