add oauth2 support for Perl

This commit is contained in:
wing328
2015-11-05 16:32:46 +08:00
parent 30a4be833b
commit 4bfc032a64
5 changed files with 17 additions and 8 deletions

View File

@@ -327,7 +327,7 @@ sub update_params_for_auth {
}
elsif ($auth eq 'petstore_auth') {
# TODO support oauth
$header_params->{'Authorization'} = 'Bearer ' . $WWW::SwaggerClient::Configuration::access_token;
}
else {

View File

@@ -17,8 +17,12 @@ our $http_user_agent = 'Perl-Swagger';
# authenticaiton setting
our $api_key = {};
our $api_key_prefix = {};
our $username;
our $password;
# username and password for HTTP basic authentication
our $username = '';
our $password = '';
# access token for OAuth
our $access_token = '';
1;