.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "WWW::Facebook::API::Auth 3pm" .TH WWW::Facebook::API::Auth 3pm "2015-04-27" "perl v5.20.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" WWW::Facebook::API::Auth \- Facebook Authentication .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use WWW::Facebook::API; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Methods for accessing auth with WWW::Facebook::API .SH "SUBROUTINES/METHODS" .IX Header "SUBROUTINES/METHODS" .IP "base" 4 .IX Item "base" Returns the WWW::Facebook::API base object. .IP "new" 4 .IX Item "new" Constructor. .IP "\fIcreate_token()\fR" 4 .IX Item "create_token()" auth.createToken of the Facebook \s-1API.\s0 Will always return the token string, regardles of the \f(CW\*(C`parse\*(C'\fR setting in WWW::Facebook::API: .Sp .Vb 1 \& $token = $client\->auth\->create_token; .Ve .ie n .IP "get_session( $token )" 4 .el .IP "get_session( \f(CW$token\fR )" 4 .IX Item "get_session( $token )" auth.getSession of the Facebook \s-1API.\s0 If you have the desktop attribute set to true and \f(CW$token\fR isn't passed in, the return value from \&\f(CW\*(C`$client\->auth\->create_token\*(C'\fR will be used. If the desktop attribute is set to false the \f(CW$token\fR must be the auth_token returned from Facebook to your web app for that user: .Sp .Vb 3 \& if ( $q\->param(\*(Aqauth_token\*(Aq) ) { \& $client\->auth\->get_session( $q\->param(\*(Aqauth_token\*(Aq) ); \& } .Ve .Sp \&\f(CW\*(C`get_session\*(C'\fR automatically sets \f(CW\*(C`session_uid\*(C'\fR, \f(CW\*(C`session_key\*(C'\fR, and \&\f(CW\*(C`session_expires\*(C'\fR for \f(CW$client\fR. It returns nothing. .ie n .IP "login( sleep => $sleep , browser => $browser_cmd )" 4 .el .IP "login( sleep => \f(CW$sleep\fR , browser => \f(CW$browser_cmd\fR )" 4 .IX Item "login( sleep => $sleep , browser => $browser_cmd )" Only for desktop apps. It first calls \f(CW\*(C`create_token\*(C'\fR to get a valid token. It then opens the user's default browser and have them sign in to the Facebook application. If \f(CW\*(C`browser\*(C'\fR is passed in, the module will use that string as the command to execute, e.g.: .Sp .Vb 1 \& system qq($browser_cmd "$login_url"); .Ve .Sp After the browser is called, it will pause for \f(CW$sleep\fR seconds (or 15 seconds if \f(CW$sleep\fR is not defined), to give the user time to log in. The method returns the session token created by \f(CW\*(C`create_token\*(C'\fR. .ie n .IP "expire_session( %params)" 4 .el .IP "expire_session( \f(CW%params\fR)" 4 .IX Item "expire_session( %params)" Implementation of the auth.expireSession function. .Sp .Vb 1 \& $result = $client\->auth\->expire_session(); .Ve .ie n .IP "promote_session( %params)" 4 .el .IP "promote_session( \f(CW%params\fR)" 4 .IX Item "promote_session( %params)" Implementation of the auth.promoteSession function. .Sp .Vb 1 \& $result = $client\->auth\->promote_session(); .Ve .ie n .IP "revoke_authorization( %params)" 4 .el .IP "revoke_authorization( \f(CW%params\fR)" 4 .IX Item "revoke_authorization( %params)" Implementation of the auth.revokeAuthorization function. .Sp .Vb 1 \& $result = $client\->auth\->revoke_authorization(); .Ve .ie n .IP "revoke_extended_permission( %params)" 4 .el .IP "revoke_extended_permission( \f(CW%params\fR)" 4 .IX Item "revoke_extended_permission( %params)" Implementation of the auth.revokeExtendedPermission function. .Sp .Vb 4 \& $result = $client\->auth\->revoke_extended_permission( \& perm => \*(Aqemail\*(Aq, \& uid => $uid \& ); .Ve .IP "\fIlogout()\fR" 4 .IX Item "logout()" Sends a \s-1POST\s0 to http://www.facebook.com/logout.php, with the parameter \&\*(L"confirm\*(R" set to 1 (Cf. http://developers.facebook.com/documentation.php?v=1.0&doc=auth ) .SH "PRIVATE METHODS" .IX Header "PRIVATE METHODS" .IP "\fI_use_http_uri()\fR" 4 .IX Item "_use_http_uri()" Makes the \s-1WFA\s0 object's server \s-1URI\s0 scheme http. Uses \f(CW\*(C`_flip_scheme\*(C'\fR. .IP "\fI_use_https_uri()\fR" 4 .IX Item "_use_https_uri()" Makes the \s-1WFA\s0 object's server \s-1URI\s0 scheme https. Uses \f(CW\*(C`_flip_scheme\*(C'\fR. .ie n .IP "_flip_scheme( $make_https )" 4 .el .IP "_flip_scheme( \f(CW$make_https\fR )" 4 .IX Item "_flip_scheme( $make_https )" If \f(CW$make_https\fR is true, the scheme becomes https. If false, the scheme becomes http. The \s-1WFA\s0 object's \f(CW\*(C`server_uri\*(C'\fR attribute is then set to use that scheme. .SH "DIAGNOSTICS" .IX Header "DIAGNOSTICS" .IP "Token needed for call to get_session" 4 .IX Item "Token needed for call to get_session" You are running a desktop app and you did not pass a token into get_session. You can create a token by calling \fIcreate_token()\fR or (better) \fIlogin()\fR. .Sp 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. .ie n .IP "Don't know how to open browser for the system %s" 4 .el .IP "Don't know how to open browser for the system \f(CW%s\fR" 4 .IX Item "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 \f(CW\*(C`browser\*(C'\fR to \fIlogin()\fR, it can use that string as the command to execute to open the login url. .IP "Cannot use login method with web app" 4 .IX Item "Cannot use login method with web app" The \fIlogin()\fR method is not able to be used to sign in when using a web app. See the Facebook \s-1TOS A.9\s0.iv. .SH "CONFIGURATION AND ENVIRONMENT" .IX Header "CONFIGURATION AND ENVIRONMENT" WWW::Facebook::API::Auth requires no configuration files or environment variables. .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" See WWW::Facebook::API .SH "INCOMPATIBILITIES" .IX Header "INCOMPATIBILITIES" None. .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" No bugs have been reported. .PP Please report any bugs or feature requests to \&\f(CW\*(C`bug\-www\-facebook\-api@rt.cpan.org\*(C'\fR, or through the web interface at . .SH "AUTHOR" .IX Header "AUTHOR" David Romano \f(CW\*(C`\*(C'\fR .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Copyright (c) 2007\-2010, David Romano \f(CW\*(C`\*(C'\fR. All rights reserved. .PP This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. .SH "DISCLAIMER OF WARRANTY" .IX Header "DISCLAIMER OF WARRANTY" \&\s-1BECAUSE 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 \*(L"AS IS\*(R" 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.\s0 .PP \&\s-1IN 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 \s0(\s-1INCLUDING 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\s0), \s-1EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\s0