forked from apoloz/alfa-bank-sdk
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user