NAME

VK::OAuth - OAuth authorization on your site with VK API

SYNOPSIS

my $object = VK::OAuth->new(
    app_id     => 'YOUR APP ID',
    secret     => 'YOUR APP SECRET',
    postback   => 'POSTBACK URL',
);

DESCRIPTION

Use this module for input VK OAuth authorization on your site

METHODS

new

my $vk = VK::OAuth->new(
    app_id     => 'YOUR APP ID',
    secret     => 'YOUR APP SECRET',
    postback   => 'POSTBACK URL',
);

The new constructor lets you create a new VK::OAuth object.

authorize

my $url = $vk->authorize( {option => 'value'} );
# Your web app redirect method.
$self->redirect($url);

This method returns a URL, for which you want to redirect the user.

Options

http://vk.com/developers.php?oid=-1&p=Авторизация_сайтов

Response

Method returns URI object.

request_access_token

This method gets access token from VK API.

Options

code - returned in redirected get request from authorize API method.

Response

Method returns HASH object with keys $obj->{user_id}, $obj->{access_token}, $obj->{expires_in}.

request

This method sends requests to VK API.

Options

method (required) - returned in redirected get request from authorize API method; params (not required) - other params; access_token (required) - access token.

Response

Method returns HASH object with requested data.

SUPPORT

Github: https://github.com/Foxcool/VK-OAuth

More information: Authorization - http://vk.com/developers.php?oid=-1&p=Авторизация_сайтов API methods - http://vk.com/developers.php?oid=-1&p=Описание_методов_API And others in http://vk.com/developers.php

AUTHOR

Copyright 2012 Alexander Babenko.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 124:

Non-ASCII character seen before =encoding in 'http://vk.com/developers.php?oid=-1&p=Авторизация_сайтов'. Assuming UTF-8