Net::OAuth2::Profile(3pm) | User Contributed Perl Documentation | Net::OAuth2::Profile(3pm) |
Net::OAuth2::Profile - OAuth2 access profiles
Net::OAuth2::Profile is extended by Net::OAuth2::Profile::Password Net::OAuth2::Profile::WebServer
See Net::OAuth2::Profile::WebServer and Net::OAuth2::Profile::Password
Base class for OAuth `profiles'. Currently implemented:
You may want to use the OAuth2 documentation at Google <https://developers.google.com/accounts/docs/OAuth2WebServer> to understand the process and the parameters.
The absolute uri which needs to be used to be addressed to execute the $command. May be specified as URI object or STRING.
As previous, but relative to the "site" option value.
Which method to use for the call (by default POST).
Additional parameters for the command.
-Option --Default client_id <required> client_secret <required> grant_type <required> hd undef scope undef secrets_in_params <true> site undef state undef token_scheme 'auth-header:Bearer' user_agent <created internally>
See https://developers.google.com/identity/protocols/OpenIDConnect#hd-param for more details.
QQ Catalyst, on the other hand, does refuse requests with these parameters in the query. So, with this flag explicitly set to false, only the Auth header gets included.
Before [0.53], the default was 'auth-header:OAuth'.
Specify the method to submit authenticated requests to the service. By default, add the access token as a header, such as: "Authorization: Bearer TOKEN". Some services require that the header will be different, i.e. "Authorization: OAuth TOKEN", for which case specify token_scheme 'auth-header:Oauth'.
To add the access token as a uri-parameter: 'uri-query:oauth_token' (in this case, the parameter name will be oauth_token) Merge the access token inside a form body via 'form-body:oauth_token'
HTTP
example:
my $auth = Net::OAuth2::Profile::WebServer->new(...); my $token = $auth->get_access_token($code, ...); # possible... my $resp = $auth->request_auth($token, GET => $uri, $header, $content); my $resp = $auth->request_auth($token, $request); # nicer (?) my $resp = $token->get($uri, $header, $content); my $resp = $token->request($request);
Adds an "Authorization" header to requests. The default REALM is "OAuth", but "Bearer" and "OAuth2" may work as well.
Adds the token to the query parameter list. The default FIELD name used is "oauth_token".
Adds the token to the www-form-urlencoded body of the request. The default FIELD name used is "oauth_token".
Copyrights 2013-2019 on the perl code and the related
documentation
by [Mark Overmeer <markov@cpan.org>] for SURFnet bv, The Netherlands.
For other contributors see "Changes".
Copyrights 2011-2012 by Keith Grennan.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
2021-10-15 | perl v5.32.1 |