Add H2H authentication service and new example flows

- Implement H2H authentication service for secure client authentication
- Add new examples for authorization code flow and H2H auth service
- Include example for generating client secret
- Update core connector and token request functionality
- Enhance README with new features

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-01-23 20:58:30 +03:00
parent 60c99bca40
commit 2964c391b5
11 changed files with 497 additions and 11 deletions

View File

@@ -42,6 +42,7 @@ class GetTokenRequest extends Request implements HasBody
protected string $clientSecret,
protected ?string $code = null,
protected ?string $redirectUri = null,
protected ?string $refreshToken = null,
protected string $grantType = 'authorization_code'
) {}
// </SECTION>
@@ -64,11 +65,15 @@ class GetTokenRequest extends Request implements HasBody
'client_secret' => $this->clientSecret,
];
if($this->grantType === 'authorization_code') {
if ($this->grantType === 'authorization_code') {
$body['code'] = $this->code;
$body['redirect_uri'] = $this->redirectUri;
}
if ($this->grantType === 'refresh_token') {
$body['refresh_token'] = $this->refreshToken;
}
return $body;
}
// </SECTION>