Skip to content

Commit

Permalink
Merge pull request #9929 from 4kind/issue-9495
Browse files Browse the repository at this point in the history
[PHP] Token Authentication headers missing for Bearer token
  • Loading branch information
frantuma authored Dec 13, 2019
2 parents d1d5038 + 3c64581 commit ace1181
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/swagger-codegen/src/main/resources/php/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,12 @@ use {{invokerPackage}}\ObjectSerializer;
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
{{/isBasic}}
{{#isBearer}}
// this endpoint requires Bearer token
if ($this->config->getAccessToken() !== null) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}
{{/isBearer}}
{{#isOAuth}}
// this endpoint requires OAuth (access token)
if ($this->config->getAccessToken() !== null) {
Expand Down

0 comments on commit ace1181

Please sign in to comment.