Amon2::Auth::Site::Instagram - Instagram auth integration for Amon2
#add config +{ Auth => { client_id => 'client id', client_secret => 'client secret', redirect_url => 'redirect url', scope => 'scope' #e.g. 'likes+comments' } } #add app __PACKAGE__->load_plugin('Web::Auth', { module => 'Instagram', on_finished => sub { my ($c, $access_token, $user) = @_; my $id = $user->{id}; #e.g. 123456 my $full_name = $user->{full_name}; #e.g. nao takanashi $c->session->set(instagram => +{ access_token => $access_token, user => $user, }); return $c->redirect('/'); }, on_error => sub { my ($c, $error_message) = @_; ... }, });
Amon2::Auth::Site::Instagram is a Instagram authenticate module for Amon2
If true, this module fetch user data immediately after authentication.
$auth->auth_uri($c:Amon2::Web, $callback_uri : Str) :Str
$auth->callback($c:Amon2::Web, $callback:HashRef) : Plack::Response
on_error callback function is called when an error occurs.
The arguments are following:
sub { my ($c, $error_message) = @_; ... }
on_finished callback function is called if an authentication was finished.ck function is called After successful authentication.
sub { my ($c, $access_token, $refresh_token, $user) = @_; ... }
If you set $auth-user_info> as a false value, authentication engine does not pass $user.
instagram developers site http://instagram.com/developer
Amon2::Plugin::Web::Auth https://metacpan.org/module/TOKUHIROM/Amon2-Auth-0.03/lib/Amon2/Plugin/Web/Auth.pm
Copyright (C) ntakanashi.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
ntakanashi <ntakanashi666 at gmail.com>
To install Amon2::Auth::Site::Instagram, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Amon2::Auth::Site::Instagram
CPAN shell
perl -MCPAN -e shell install Amon2::Auth::Site::Instagram
For more information on module installation, please visit the detailed CPAN module installation guide.