WWW::F...::Auth(3pm)
πΈ WWW::Facebook::API::Auth πΈ
okay bestie, so this is the manpage for WWW::Facebook::API::Auth β a user-contributed Perl doc, a 3pm page, the whole shebang. It's the auth-flavored slice of the WWW::Facebook::API pie, and honestly it's giving "vintage 2010 Facebook energy" in the best way. π
β¨ NAME β¨
WWW::Facebook::API::Auth β Facebook Authentication. that's it, that's the name. π
π SYNOPSIS π
use WWW::Facebook::API;
like. that's the whole vibe. load the parent module and you're in. π¦
π DESCRIPTION π
Methods for accessing auth with WWW::Facebook::API. you pull this in, you get the Facebook auth calls. periodt. β¨
π SUBROUTINES/METHODS π
π base
Returns the WWW::Facebook::API base object. your little anchor to the main thing, iykyk. π«Ά
π new
Constructor. it makes a new one. iconic behavior honestly. π
π create_token()
this is auth.createToken of the Facebook API. and here's the tea: it will always return the token string, regardles of the "parse" setting in WWW::Facebook::API. (yes, "regardles" β that's the original's typo, we're keeping it, we don't fix facts, we only fix vibes π)
$token = $client->auth->create_token;
π get_session( $token )
this is auth.getSession of the Facebook API. here's how it goes down, bestie:
- if you have the desktop attribute set to true and
$tokenisn't passed in, it'll use the return value from$client->auth->create_tokeninstead. convenient much? - if the desktop attribute is set to false, then
$tokenmust be the auth_token that Facebook handed back to your web app for that user. no substitutes, fr fr.
if ( $q->param('auth_token') ) {
$client->auth->get_session( $q->param('auth_token') );
}
also, get_session automatically sets session_uid, session_key, and session_expires for $client. it returns nothing. not a thing. nada. the side effects ARE the point. π
π login( sleep => $sleep , browser => $browser_cmd )
Only for desktop apps. desktop only. if you're a web app, this is not your moment (see the diagnostics down below π).
what it does, step by step:
- it first calls
create_tokento get a valid token. - it then opens the user's default browser and has them sign in to the Facebook application.
- if
browseris passed in, the module will use that string as the command to execute, e.g.:
system qq($browser_cmd "$login_url");
- after the browser is called, it will pause for
$sleepseconds β or 15 seconds if$sleepis not defined β to give the user time to log in. be patient, she's buffering. π§
the method returns the session token created by create_token. π
π expire_session( %params)
Implementation of the auth.expireSession function.
$result = $client->auth->expire_session();
π promote_session( %params)
Implementation of the auth.promoteSession function.
$result = $client->auth->promote_session();
π revoke_authorization( %params)
Implementation of the auth.revokeAuthorization function.
$result = $client->auth->revoke_authorization();
π revoke_extended_permission( %params)
Implementation of the auth.revokeExtendedPermission function.
$result = $client->auth->revoke_extended_permission(
perm => 'email',
uid => $uid
);
π logout()
Sends a POST to http://www.facebook.com/logout.php, with the parameter "confirm" set to 1. (Cf. http://developers.facebook.com/documentation.php?v=1.0&doc=auth) β go, girl, log out, main character exit. π
π PRIVATE METHODS π
these are the behind-the-scenes girlies. don't touch unless you know what you're doing. π€«
π _use_http_uri()
Makes the WFA object's server URI scheme http. Uses _flip_scheme.
π _use_https_uri()
Makes the WFA object's server URI scheme https. Uses _flip_scheme. (yes, the secure one, slay π)
π _flip_scheme( $make_https )
If $make_https is true, the scheme becomes https. If false, the scheme becomes http. The WFA object's server_uri attribute is then set to use that scheme. boom, flipped. π
π¨ DIAGNOSTICS π¨
π Token needed for call to get_session
two scenarios, bestie, and neither is great:
- You are running a desktop app and you did not pass a token into
get_session. You can create a token by callingcreate_token()or (better)login(). - You are running a web app and the user hasn't logged in to Facebook for your web app. When the user does so, an auth_token will be returned (as a parameter) to your callback url. Use that auth_token for the session.
π Don't know how to open browser for the system %s
The module doesn't know the command to use to open a browser on the given system. If you passed in "browser" to login(), it can use that string as the command to execute to open the login url. so like. pass it in. help her out. π₯Ί
π Cannot use login method with web app
The login() method is not able to be used to sign in when using a web app. See the Facebook TOS A.9.iv. that's a rule, not a suggestion. π
π CONFIGURATION AND ENVIRONMENT π
WWW::Facebook::API::Auth requires no configuration files or environment variables. zero setup, zero drama. we love a low-maintenance queen. β¨
π DEPENDENCIES π
See WWW::Facebook::API.
π INCOMPATIBILITIES π
None. she plays nice with everybody. π«Ά
π BUGS AND LIMITATIONS π
No bugs have been reported. flawless behavior, allegedly. π
Please report any bugs or feature requests to bug-www-facebook-api@rt.cpan.org, or through the web interface at http://rt.cpan.org.
π AUTHOR π
David Romano <unobe@cpan.org>
π LICENSE AND COPYRIGHT π
Copyright (c) 2007-2010, David Romano <unobe@cpan.org>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. so like, go wild, but respectfully. π
β οΈ DISCLAIMER OF WARRANTY β οΈ
okay so legally we have to yell this part, and we're not changing a single word of it because it's, you know, legal:
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
and that's the whole page, bestie!! π this lil beauty shipped as perl v5.34.0, dated 2022-06-28, and it's the WWW::F...::Auth(3pm) page if you need to cite her. go forth and authenticate responsibly. periodt. π
β¨
π¦ where this page comes from
- debian bookworm: libwww-facebook-api-perl 0.4.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libwww-facebook-api-perl 0.4.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libwww-facebook-api-perl 0.4.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libwww-facebook-api-perl 0.4.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libwww-facebook-api-perl 0.4.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms