Skip to content

Commit 6681bb9

Browse files
committed
Added recovery_code and otp to login request
1 parent 8156456 commit 6681bb9

File tree

4 files changed

+44
-12
lines changed

4 files changed

+44
-12
lines changed

CustomApi/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ $grant_type = 'refresh_token'; // string | Grant Type
6060
$username = 'username_example'; // string | Username
6161
$password = 'password_example'; // string | User Password
6262
$client_id = 'client_id_example'; // string | Client id
63+
$otp = 'otp_example'; // string | App OTP
64+
$recovery_code = 'recovery_code_example'; // string | Recovery Code
6365
$refresh_token = 'refresh_token_example'; // string | Refresh Token
6466

6567
try {
66-
$result = $apiInstance->realmsRealmProtocolOpenidConnectTokenPost($realm, $authorization, $grant_type, $username, $password, $client_id, $refresh_token);
68+
$result = $apiInstance->realmsRealmProtocolOpenidConnectTokenPost($realm, $authorization, $grant_type, $username, $password, $client_id, $otp, $recovery_code, $refresh_token);
6769
print_r($result);
6870
} catch (Exception $e) {
6971
echo 'Exception when calling CustomApi->realmsRealmProtocolOpenidConnectTokenPost: ', $e->getMessage(), PHP_EOL;

CustomApi/docs/Api/CustomApi.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All URIs are relative to http://localhost, except if the operation defines anoth
1010
## `realmsRealmProtocolOpenidConnectTokenPost()`
1111

1212
```php
13-
realmsRealmProtocolOpenidConnectTokenPost($realm, $authorization, $grant_type, $username, $password, $client_id, $refresh_token): \WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost200Response
13+
realmsRealmProtocolOpenidConnectTokenPost($realm, $authorization, $grant_type, $username, $password, $client_id, $otp, $recovery_code, $refresh_token): \WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost200Response
1414
```
1515

1616
Oidc Login
@@ -36,10 +36,12 @@ $grant_type = 'refresh_token'; // string | Grant Type
3636
$username = 'username_example'; // string | Username
3737
$password = 'password_example'; // string | User Password
3838
$client_id = 'client_id_example'; // string | Client id
39+
$otp = 'otp_example'; // string | App OTP
40+
$recovery_code = 'recovery_code_example'; // string | Recovery Code
3941
$refresh_token = 'refresh_token_example'; // string | Refresh Token
4042

4143
try {
42-
$result = $apiInstance->realmsRealmProtocolOpenidConnectTokenPost($realm, $authorization, $grant_type, $username, $password, $client_id, $refresh_token);
44+
$result = $apiInstance->realmsRealmProtocolOpenidConnectTokenPost($realm, $authorization, $grant_type, $username, $password, $client_id, $otp, $recovery_code, $refresh_token);
4345
print_r($result);
4446
} catch (Exception $e) {
4547
echo 'Exception when calling CustomApi->realmsRealmProtocolOpenidConnectTokenPost: ', $e->getMessage(), PHP_EOL;
@@ -56,6 +58,8 @@ try {
5658
| **username** | **string**| Username | [optional] |
5759
| **password** | **string**| User Password | [optional] |
5860
| **client_id** | **string**| Client id | [optional] |
61+
| **otp** | **string**| App OTP | [optional] |
62+
| **recovery_code** | **string**| Recovery Code | [optional] |
5963
| **refresh_token** | **string**| Refresh Token | [optional] |
6064

6165
### Return type

CustomApi/lib/Api/CustomApi.php

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,18 @@ public function getConfig()
133133
* @param string|null $username Username (optional)
134134
* @param string|null $password User Password (optional)
135135
* @param string|null $client_id Client id (optional)
136+
* @param string|null $otp App OTP (optional)
137+
* @param string|null $recovery_code Recovery Code (optional)
136138
* @param string|null $refresh_token Refresh Token (optional)
137139
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'] to see the possible values for this operation
138140
*
139141
* @throws \WebMI\KeycloakApiClient\CustomApi\ApiException on non-2xx response or if the response body is not in the expected format
140142
* @throws \InvalidArgumentException
141143
* @return \WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost200Response|\WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost400Response|\WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost400Response
142144
*/
143-
public function realmsRealmProtocolOpenidConnectTokenPost($realm, $authorization = null, $grant_type = 'refresh_token', $username = null, $password = null, $client_id = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
145+
public function realmsRealmProtocolOpenidConnectTokenPost($realm, $authorization = null, $grant_type = 'refresh_token', $username = null, $password = null, $client_id = null, $otp = null, $recovery_code = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
144146
{
145-
list($response) = $this->realmsRealmProtocolOpenidConnectTokenPostWithHttpInfo($realm, $authorization, $grant_type, $username, $password, $client_id, $refresh_token, $contentType);
147+
list($response) = $this->realmsRealmProtocolOpenidConnectTokenPostWithHttpInfo($realm, $authorization, $grant_type, $username, $password, $client_id, $otp, $recovery_code, $refresh_token, $contentType);
146148
return $response;
147149
}
148150

@@ -157,16 +159,18 @@ public function realmsRealmProtocolOpenidConnectTokenPost($realm, $authorization
157159
* @param string|null $username Username (optional)
158160
* @param string|null $password User Password (optional)
159161
* @param string|null $client_id Client id (optional)
162+
* @param string|null $otp App OTP (optional)
163+
* @param string|null $recovery_code Recovery Code (optional)
160164
* @param string|null $refresh_token Refresh Token (optional)
161165
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'] to see the possible values for this operation
162166
*
163167
* @throws \WebMI\KeycloakApiClient\CustomApi\ApiException on non-2xx response or if the response body is not in the expected format
164168
* @throws \InvalidArgumentException
165169
* @return array of \WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost200Response|\WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost400Response|\WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost400Response, HTTP status code, HTTP response headers (array of strings)
166170
*/
167-
public function realmsRealmProtocolOpenidConnectTokenPostWithHttpInfo($realm, $authorization = null, $grant_type = 'refresh_token', $username = null, $password = null, $client_id = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
171+
public function realmsRealmProtocolOpenidConnectTokenPostWithHttpInfo($realm, $authorization = null, $grant_type = 'refresh_token', $username = null, $password = null, $client_id = null, $otp = null, $recovery_code = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
168172
{
169-
$request = $this->realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $authorization, $grant_type, $username, $password, $client_id, $refresh_token, $contentType);
173+
$request = $this->realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $authorization, $grant_type, $username, $password, $client_id, $otp, $recovery_code, $refresh_token, $contentType);
170174

171175
try {
172176
$options = $this->createHttpClientOption();
@@ -358,15 +362,17 @@ public function realmsRealmProtocolOpenidConnectTokenPostWithHttpInfo($realm, $a
358362
* @param string|null $username Username (optional)
359363
* @param string|null $password User Password (optional)
360364
* @param string|null $client_id Client id (optional)
365+
* @param string|null $otp App OTP (optional)
366+
* @param string|null $recovery_code Recovery Code (optional)
361367
* @param string|null $refresh_token Refresh Token (optional)
362368
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'] to see the possible values for this operation
363369
*
364370
* @throws \InvalidArgumentException
365371
* @return \GuzzleHttp\Promise\PromiseInterface
366372
*/
367-
public function realmsRealmProtocolOpenidConnectTokenPostAsync($realm, $authorization = null, $grant_type = 'refresh_token', $username = null, $password = null, $client_id = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
373+
public function realmsRealmProtocolOpenidConnectTokenPostAsync($realm, $authorization = null, $grant_type = 'refresh_token', $username = null, $password = null, $client_id = null, $otp = null, $recovery_code = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
368374
{
369-
return $this->realmsRealmProtocolOpenidConnectTokenPostAsyncWithHttpInfo($realm, $authorization, $grant_type, $username, $password, $client_id, $refresh_token, $contentType)
375+
return $this->realmsRealmProtocolOpenidConnectTokenPostAsyncWithHttpInfo($realm, $authorization, $grant_type, $username, $password, $client_id, $otp, $recovery_code, $refresh_token, $contentType)
370376
->then(
371377
function ($response) {
372378
return $response[0];
@@ -385,16 +391,18 @@ function ($response) {
385391
* @param string|null $username Username (optional)
386392
* @param string|null $password User Password (optional)
387393
* @param string|null $client_id Client id (optional)
394+
* @param string|null $otp App OTP (optional)
395+
* @param string|null $recovery_code Recovery Code (optional)
388396
* @param string|null $refresh_token Refresh Token (optional)
389397
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'] to see the possible values for this operation
390398
*
391399
* @throws \InvalidArgumentException
392400
* @return \GuzzleHttp\Promise\PromiseInterface
393401
*/
394-
public function realmsRealmProtocolOpenidConnectTokenPostAsyncWithHttpInfo($realm, $authorization = null, $grant_type = 'refresh_token', $username = null, $password = null, $client_id = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
402+
public function realmsRealmProtocolOpenidConnectTokenPostAsyncWithHttpInfo($realm, $authorization = null, $grant_type = 'refresh_token', $username = null, $password = null, $client_id = null, $otp = null, $recovery_code = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
395403
{
396404
$returnType = '\WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost200Response';
397-
$request = $this->realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $authorization, $grant_type, $username, $password, $client_id, $refresh_token, $contentType);
405+
$request = $this->realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $authorization, $grant_type, $username, $password, $client_id, $otp, $recovery_code, $refresh_token, $contentType);
398406

399407
return $this->client
400408
->sendAsync($request, $this->createHttpClientOption())
@@ -441,13 +449,15 @@ function ($exception) {
441449
* @param string|null $username Username (optional)
442450
* @param string|null $password User Password (optional)
443451
* @param string|null $client_id Client id (optional)
452+
* @param string|null $otp App OTP (optional)
453+
* @param string|null $recovery_code Recovery Code (optional)
444454
* @param string|null $refresh_token Refresh Token (optional)
445455
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'] to see the possible values for this operation
446456
*
447457
* @throws \InvalidArgumentException
448458
* @return \GuzzleHttp\Psr7\Request
449459
*/
450-
public function realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $authorization = null, $grant_type = 'refresh_token', $username = null, $password = null, $client_id = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
460+
public function realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $authorization = null, $grant_type = 'refresh_token', $username = null, $password = null, $client_id = null, $otp = null, $recovery_code = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
451461
{
452462

453463
// verify the required parameter 'realm' is set
@@ -464,6 +474,8 @@ public function realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $author
464474

465475

466476

477+
478+
467479
$resourcePath = '/realms/{realm}/protocol/openid-connect/token';
468480
$formParams = [];
469481
$queryParams = [];
@@ -503,6 +515,14 @@ public function realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $author
503515
$formParams = array_merge($formParams, ObjectSerializer::toFormValue('client_id', $client_id));
504516
}
505517
// form params
518+
if ($otp !== null) {
519+
$formParams = array_merge($formParams, ObjectSerializer::toFormValue('otp', $otp));
520+
}
521+
// form params
522+
if ($recovery_code !== null) {
523+
$formParams = array_merge($formParams, ObjectSerializer::toFormValue('recovery_code', $recovery_code));
524+
}
525+
// form params
506526
if ($refresh_token !== null) {
507527
$formParams = array_merge($formParams, ObjectSerializer::toFormValue('refresh_token', $refresh_token));
508528
}

custom.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ components:
137137
description: Grant Type
138138
example: password
139139
default: password
140+
otp:
141+
type: string
142+
description: App OTP
143+
recovery_code:
144+
type: string
145+
description: Recovery Code
140146
required:
141147
- username
142148
- password

0 commit comments

Comments
 (0)