The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Facebook::Signed - Signed values given by Facebook to an application

VERSION

version 0.010

SYNOPSIS

  my $signed = Facebook::Signed->new(
        facebook_data => $cookie_as_text,
        secret => $secret,
  );

  my $custom_value = $signed->get('custom_key');

  # shortcuts, return undef if not existing
  my $fb_uid = $signed->uid;
  my $fb_access_token = $signed->access_token;
  my $fb_session_key = $signed->session_key;

DESCRIPTION

If you have any suggestion how we can use this package namespace, please suggest to authors listed in the end of this document.

METHODS

facebook_data

Is a: String

This data is used for getting the signed values. Its required on construction.

secret

Is a: String

This is the secret for your application. Its required on construction.

$obj->get

Arguments: $key

Return value: Str

Returns the value of a specific key of the signed values or undef it this is not exist.

Facebook::Signed::check_payload

Arguments: $facebook_data, $app_secret

Return value: HashRef

Checks the signature of the given facebook data (from cookie or other ways) with the given application secret and gives back the checked HashRef or an empty one.

$obj->uid

Arguments: None

Return value: Integer

Gives back the signed uid of the signed values given

$obj->access_token

Arguments: None

Return value: String

Gives back the signed access_token of the signed values given

$obj->session_key

Arguments: None

Return value: String

Gives back the signed session_key of the signed values given

$obj->expires

Arguments: None

Return value: Integer

Gives back the signed expire date as timestamp of the signed values given

$obj->base_domain

Arguments: None

Return value: String

Gives back the signed base_domain of the cookie given

ATTRIBUTES

METHODS

AUTHOR

Torsten Raudssus <torsten@raudssus.de> http://www.raudssus.de/

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Raudssus Social Software & Facebook Distribution Authors.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.