NAME

Plack::Middleware::Auth::OAuth - OAuth signature validation middleware

SYNOPSIS

use Plack::Builder;

my $app = sub { ...};

builder {
    enable "Plack::Middleware::Auth::OAuth",
        consumer_key => 'YOUR_CONSUMER_KEY',
        consumer_secret => 'YOUR_CONSUMER_SECRET',
        validate_post   => 1,
        ;
    $app;
};

DESCRIPTION

Plack::Middleware::Auth::OAuth is OAuth signature validation handler for Plack.

CONFIGURATION

consumer_key

Your application's consumer key.

consumer_secret

Your application's consumer secret.

validate_post

Includes body parameters in validation. For MBGA-Town, you should use this option.

check_nonce_cb

A callback function to validate oauth_nonce.

check_timestamp_cb

A callback function to validate oauth_timestamp.

unauthorized_cb

A callback function (psgi application) for returning custom response when unauthorized.

validate_only

doing only validation. not returning response directly from middleware (unauthorized method not to be called).

discriminating authorization is valid or not by seeing $env->{'psgix.oauth_authorized'} in your app.

secret_resolver_cb

A callback function for resolving consumer_secret. This callback takes argument: ($consumer_key, $env).

strict

Default: 0

if true, it judge unsupported param as invalid when validating params. if false, it accepts unsupported parameters.

AUTHOR

Hideo Kimura <hide@cpan.org> Masayuki Matsuki <songmu@cpan.org>

SEE ALSO

LICENSE

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