Catalyst::Authentication::Credential::OAuth2 - Authenticate against OAuth2 servers
version 0.001006
__PACKAGE__->config( 'Plugin::Authentication' => { default => { credential => { class => 'OAuth2', grant_uri => 'http://authserver/request', token_uri => 'http://authserver/token', client_id => 'dead69beef' }, store => { class => 'Null' } } } );
This module implements authentication via OAuth2 credentials, giving you a user object which stores tokens for accessing protected resources.
Required attributes that you get from your Oauth2 provider
optional secret code from your Oauth2 provider (you need to review the docs from your provider).
Value of 'scope' field submitted to the grant_uri
Default is GET; some providers require POST
Default is 'application/x-www-form-urlencoded', some providers support 'application/json'.
By default we call ->find_user on the store with a hashref that contains key 'token' and the value of the access_token (which we get from calling the 'token_uri'). The results of calling the token_uri is usually a JSON named array structure which can contain other fields such as id_token (typically a JWT). You can set this to an arrayref of extra fields you want to pass.
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.