Skip to content

Commit ace1181

Browse files
authored
Merge pull request #9929 from 4kind/issue-9495
[PHP] Token Authentication headers missing for Bearer token
2 parents d1d5038 + 3c64581 commit ace1181

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/swagger-codegen/src/main/resources/php/api.mustache

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,12 @@ use {{invokerPackage}}\ObjectSerializer;
472472
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
473473
}
474474
{{/isBasic}}
475+
{{#isBearer}}
476+
// this endpoint requires Bearer token
477+
if ($this->config->getAccessToken() !== null) {
478+
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
479+
}
480+
{{/isBearer}}
475481
{{#isOAuth}}
476482
// this endpoint requires OAuth (access token)
477483
if ($this->config->getAccessToken() !== null) {

0 commit comments

Comments
 (0)