Catalyst::ActionRole::OAuth2::ProtectedResource - Resource endpoint for OAuth2 authentication flows
version 0.001005
package AuthServer::Controller::OAuth2::Resource; use Moose; BEGIN { extends 'Catalyst::Controller::ActionRole' } with 'CatalystX::OAuth2::Controller::Role::WithStore'; __PACKAGE__->config( store => { class => 'DBIC', client_model => 'DB::Client' } ); sub resource : Chained('/') Args(0) Does('OAuth2::ProtectedResource') { my ( $self, $c ) = @_; $c->res->body( 'my protected resource' ); }
This action role implements an arbitrary resource endpoint to be protected by the authorization flow. Clients will only be able to access this resource if they provide a valid access token. The action body should be customized like a regular action.
Eden Cardim <edencardim@gmail.com>
This software is copyright (c) 2017 by Suretec Systems Ltd.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install CatalystX::OAuth2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::OAuth2
CPAN shell
perl -MCPAN -e shell install CatalystX::OAuth2
For more information on module installation, please visit the detailed CPAN module installation guide.