Plack::Middleware::Auth::OAuth2::ProtectedResource - middleware for OAuth 2.0 Protected Resource endpoint
my $app = sub {...}; builder { enable "Plack::Middleware::Auth::OAuth2::ProtectedResource", data_handler => "YourApp::DataHandler", error_uri => q{http://example.org/error/description}; enable "Plack::Middleware::JSONP"; enable "Plack::Middleware::ContentLength"; $app; }; # and on your controller $plack_request->env->{REMOTE_USER}; $plack_request->env->{X_OAUTH_CLIENT_ID}; $plack_request->env->{X_OAUTH_SCOPE};
middleware for OAuth 2.0 Protected Resource endpoint
This method parses access token. If access token is valid, authorization information are set to environment variables.
After successful verifying authorization within middleware layer, Following 3 type of values are set in env.
Identifier of user who grant the client to access the user's protected resource that is stored on service provider.
Identifier of the client that accesses to user's protected resource on beharf of the user.
Scope parameter that represents what kind of resources that the user grant client to access.
Lyo Kato, <lyo.kato@gmail.com>
Copyright (C) 2010 by Lyo Kato
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install OAuth::Lite2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OAuth::Lite2
CPAN shell
perl -MCPAN -e shell install OAuth::Lite2
For more information on module installation, please visit the detailed CPAN module installation guide.