Skip to content

Commit df1df9d

Browse files
committed
Added new body to refresh token
1 parent 349d96f commit df1df9d

12 files changed

+122
-107
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.9.0-SNAPSHOT
1+
7.10.0-SNAPSHOT

CustomApi/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ $username = 'username_example'; // string | Username
6060
$password = 'password_example'; // string | User Password
6161
$client_id = 'client_id_example'; // string | Client id
6262
$grant_type = 'grant_type_example'; // string | Grant Type
63+
$refresh_token = 'refresh_token_example'; // string | Refresh Token
6364

6465
try {
65-
$result = $apiInstance->realmsRealmProtocolOpenidConnectTokenPost($realm, $username, $password, $client_id, $grant_type);
66+
$result = $apiInstance->realmsRealmProtocolOpenidConnectTokenPost($realm, $username, $password, $client_id, $grant_type, $refresh_token);
6667
print_r($result);
6768
} catch (Exception $e) {
6869
echo 'Exception when calling CustomApi->realmsRealmProtocolOpenidConnectTokenPost: ', $e->getMessage(), PHP_EOL;
@@ -104,5 +105,5 @@ vendor/bin/phpunit
104105
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
105106

106107
- API version: `1.0`
107-
- Generator version: `7.9.0-SNAPSHOT`
108+
- Generator version: `7.10.0-SNAPSHOT`
108109
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`

CustomApi/docs/Api/CustomApi.md

Lines changed: 8 additions & 6 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, $username, $password, $client_id, $grant_type): \WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost200Response
13+
realmsRealmProtocolOpenidConnectTokenPost($realm, $username, $password, $client_id, $grant_type, $refresh_token): \WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost200Response
1414
```
1515

1616
Oidc Login
@@ -35,9 +35,10 @@ $username = 'username_example'; // string | Username
3535
$password = 'password_example'; // string | User Password
3636
$client_id = 'client_id_example'; // string | Client id
3737
$grant_type = 'grant_type_example'; // string | Grant Type
38+
$refresh_token = 'refresh_token_example'; // string | Refresh Token
3839

3940
try {
40-
$result = $apiInstance->realmsRealmProtocolOpenidConnectTokenPost($realm, $username, $password, $client_id, $grant_type);
41+
$result = $apiInstance->realmsRealmProtocolOpenidConnectTokenPost($realm, $username, $password, $client_id, $grant_type, $refresh_token);
4142
print_r($result);
4243
} catch (Exception $e) {
4344
echo 'Exception when calling CustomApi->realmsRealmProtocolOpenidConnectTokenPost: ', $e->getMessage(), PHP_EOL;
@@ -49,10 +50,11 @@ try {
4950
| Name | Type | Description | Notes |
5051
| ------------- | ------------- | ------------- | ------------- |
5152
| **realm** | **string**| realm name (not id!) | |
52-
| **username** | **string**| Username | |
53-
| **password** | **string**| User Password | |
54-
| **client_id** | **string**| Client id | |
55-
| **grant_type** | **string**| Grant Type | |
53+
| **username** | **string**| Username | [optional] |
54+
| **password** | **string**| User Password | [optional] |
55+
| **client_id** | **string**| Client id | [optional] |
56+
| **grant_type** | **string**| Grant Type | [optional] |
57+
| **refresh_token** | **string**| Refresh Token | [optional] |
5658

5759
### Return type
5860

CustomApi/lib/Api/CustomApi.php

Lines changed: 53 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* The version of the OpenAPI document: 1.0
1818
* Generated by: https://openapi-generator.tech
19-
* Generator version: 7.9.0-SNAPSHOT
19+
* Generator version: 7.10.0-SNAPSHOT
2020
*/
2121

2222
/**
@@ -128,19 +128,20 @@ public function getConfig()
128128
* Oidc Login
129129
*
130130
* @param string $realm realm name (not id!) (required)
131-
* @param string $username Username (required)
132-
* @param string $password User Password (required)
133-
* @param string $client_id Client id (required)
134-
* @param string $grant_type Grant Type (required)
131+
* @param string $username Username (optional)
132+
* @param string $password User Password (optional)
133+
* @param string $client_id Client id (optional)
134+
* @param string $grant_type Grant Type (optional)
135+
* @param string $refresh_token Refresh Token (optional)
135136
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'] to see the possible values for this operation
136137
*
137138
* @throws \WebMI\KeycloakApiClient\CustomApi\ApiException on non-2xx response or if the response body is not in the expected format
138139
* @throws \InvalidArgumentException
139140
* @return \WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost200Response|\WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost400Response|\WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost400Response
140141
*/
141-
public function realmsRealmProtocolOpenidConnectTokenPost($realm, $username, $password, $client_id, $grant_type, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
142+
public function realmsRealmProtocolOpenidConnectTokenPost($realm, $username = null, $password = null, $client_id = null, $grant_type = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
142143
{
143-
list($response) = $this->realmsRealmProtocolOpenidConnectTokenPostWithHttpInfo($realm, $username, $password, $client_id, $grant_type, $contentType);
144+
list($response) = $this->realmsRealmProtocolOpenidConnectTokenPostWithHttpInfo($realm, $username, $password, $client_id, $grant_type, $refresh_token, $contentType);
144145
return $response;
145146
}
146147

@@ -150,19 +151,20 @@ public function realmsRealmProtocolOpenidConnectTokenPost($realm, $username, $pa
150151
* Oidc Login
151152
*
152153
* @param string $realm realm name (not id!) (required)
153-
* @param string $username Username (required)
154-
* @param string $password User Password (required)
155-
* @param string $client_id Client id (required)
156-
* @param string $grant_type Grant Type (required)
154+
* @param string $username Username (optional)
155+
* @param string $password User Password (optional)
156+
* @param string $client_id Client id (optional)
157+
* @param string $grant_type Grant Type (optional)
158+
* @param string $refresh_token Refresh Token (optional)
157159
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'] to see the possible values for this operation
158160
*
159161
* @throws \WebMI\KeycloakApiClient\CustomApi\ApiException on non-2xx response or if the response body is not in the expected format
160162
* @throws \InvalidArgumentException
161163
* @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)
162164
*/
163-
public function realmsRealmProtocolOpenidConnectTokenPostWithHttpInfo($realm, $username, $password, $client_id, $grant_type, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
165+
public function realmsRealmProtocolOpenidConnectTokenPostWithHttpInfo($realm, $username = null, $password = null, $client_id = null, $grant_type = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
164166
{
165-
$request = $this->realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $username, $password, $client_id, $grant_type, $contentType);
167+
$request = $this->realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $username, $password, $client_id, $grant_type, $refresh_token, $contentType);
166168

167169
try {
168170
$options = $this->createHttpClientOption();
@@ -186,18 +188,6 @@ public function realmsRealmProtocolOpenidConnectTokenPostWithHttpInfo($realm, $u
186188

187189
$statusCode = $response->getStatusCode();
188190

189-
if ($statusCode < 200 || $statusCode > 299) {
190-
throw new ApiException(
191-
sprintf(
192-
'[%d] Error connecting to the API (%s)',
193-
$statusCode,
194-
(string) $request->getUri()
195-
),
196-
$statusCode,
197-
$response->getHeaders(),
198-
(string) $response->getBody()
199-
);
200-
}
201191

202192
switch($statusCode) {
203193
case 200:
@@ -283,6 +273,19 @@ public function realmsRealmProtocolOpenidConnectTokenPostWithHttpInfo($realm, $u
283273
];
284274
}
285275

276+
if ($statusCode < 200 || $statusCode > 299) {
277+
throw new ApiException(
278+
sprintf(
279+
'[%d] Error connecting to the API (%s)',
280+
$statusCode,
281+
(string) $request->getUri()
282+
),
283+
$statusCode,
284+
$response->getHeaders(),
285+
(string) $response->getBody()
286+
);
287+
}
288+
286289
$returnType = '\WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost200Response';
287290
if ($returnType === '\SplFileObject') {
288291
$content = $response->getBody(); //stream goes to serializer
@@ -348,18 +351,19 @@ public function realmsRealmProtocolOpenidConnectTokenPostWithHttpInfo($realm, $u
348351
* Oidc Login
349352
*
350353
* @param string $realm realm name (not id!) (required)
351-
* @param string $username Username (required)
352-
* @param string $password User Password (required)
353-
* @param string $client_id Client id (required)
354-
* @param string $grant_type Grant Type (required)
354+
* @param string $username Username (optional)
355+
* @param string $password User Password (optional)
356+
* @param string $client_id Client id (optional)
357+
* @param string $grant_type Grant Type (optional)
358+
* @param string $refresh_token Refresh Token (optional)
355359
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'] to see the possible values for this operation
356360
*
357361
* @throws \InvalidArgumentException
358362
* @return \GuzzleHttp\Promise\PromiseInterface
359363
*/
360-
public function realmsRealmProtocolOpenidConnectTokenPostAsync($realm, $username, $password, $client_id, $grant_type, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
364+
public function realmsRealmProtocolOpenidConnectTokenPostAsync($realm, $username = null, $password = null, $client_id = null, $grant_type = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
361365
{
362-
return $this->realmsRealmProtocolOpenidConnectTokenPostAsyncWithHttpInfo($realm, $username, $password, $client_id, $grant_type, $contentType)
366+
return $this->realmsRealmProtocolOpenidConnectTokenPostAsyncWithHttpInfo($realm, $username, $password, $client_id, $grant_type, $refresh_token, $contentType)
363367
->then(
364368
function ($response) {
365369
return $response[0];
@@ -373,19 +377,20 @@ function ($response) {
373377
* Oidc Login
374378
*
375379
* @param string $realm realm name (not id!) (required)
376-
* @param string $username Username (required)
377-
* @param string $password User Password (required)
378-
* @param string $client_id Client id (required)
379-
* @param string $grant_type Grant Type (required)
380+
* @param string $username Username (optional)
381+
* @param string $password User Password (optional)
382+
* @param string $client_id Client id (optional)
383+
* @param string $grant_type Grant Type (optional)
384+
* @param string $refresh_token Refresh Token (optional)
380385
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'] to see the possible values for this operation
381386
*
382387
* @throws \InvalidArgumentException
383388
* @return \GuzzleHttp\Promise\PromiseInterface
384389
*/
385-
public function realmsRealmProtocolOpenidConnectTokenPostAsyncWithHttpInfo($realm, $username, $password, $client_id, $grant_type, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
390+
public function realmsRealmProtocolOpenidConnectTokenPostAsyncWithHttpInfo($realm, $username = null, $password = null, $client_id = null, $grant_type = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
386391
{
387392
$returnType = '\WebMI\KeycloakApiClient\CustomApi\Model\RealmsRealmProtocolOpenidConnectTokenPost200Response';
388-
$request = $this->realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $username, $password, $client_id, $grant_type, $contentType);
393+
$request = $this->realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $username, $password, $client_id, $grant_type, $refresh_token, $contentType);
389394

390395
return $this->client
391396
->sendAsync($request, $this->createHttpClientOption())
@@ -427,16 +432,17 @@ function ($exception) {
427432
* Create request for operation 'realmsRealmProtocolOpenidConnectTokenPost'
428433
*
429434
* @param string $realm realm name (not id!) (required)
430-
* @param string $username Username (required)
431-
* @param string $password User Password (required)
432-
* @param string $client_id Client id (required)
433-
* @param string $grant_type Grant Type (required)
435+
* @param string $username Username (optional)
436+
* @param string $password User Password (optional)
437+
* @param string $client_id Client id (optional)
438+
* @param string $grant_type Grant Type (optional)
439+
* @param string $refresh_token Refresh Token (optional)
434440
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'] to see the possible values for this operation
435441
*
436442
* @throws \InvalidArgumentException
437443
* @return \GuzzleHttp\Psr7\Request
438444
*/
439-
public function realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $username, $password, $client_id, $grant_type, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
445+
public function realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $username = null, $password = null, $client_id = null, $grant_type = null, $refresh_token = null, string $contentType = self::contentTypes['realmsRealmProtocolOpenidConnectTokenPost'][0])
440446
{
441447

442448
// verify the required parameter 'realm' is set
@@ -446,33 +452,10 @@ public function realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $userna
446452
);
447453
}
448454

449-
// verify the required parameter 'username' is set
450-
if ($username === null || (is_array($username) && count($username) === 0)) {
451-
throw new \InvalidArgumentException(
452-
'Missing the required parameter $username when calling realmsRealmProtocolOpenidConnectTokenPost'
453-
);
454-
}
455455

456-
// verify the required parameter 'password' is set
457-
if ($password === null || (is_array($password) && count($password) === 0)) {
458-
throw new \InvalidArgumentException(
459-
'Missing the required parameter $password when calling realmsRealmProtocolOpenidConnectTokenPost'
460-
);
461-
}
462456

463-
// verify the required parameter 'client_id' is set
464-
if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) {
465-
throw new \InvalidArgumentException(
466-
'Missing the required parameter $client_id when calling realmsRealmProtocolOpenidConnectTokenPost'
467-
);
468-
}
469457

470-
// verify the required parameter 'grant_type' is set
471-
if ($grant_type === null || (is_array($grant_type) && count($grant_type) === 0)) {
472-
throw new \InvalidArgumentException(
473-
'Missing the required parameter $grant_type when calling realmsRealmProtocolOpenidConnectTokenPost'
474-
);
475-
}
458+
476459

477460

478461
$resourcePath = '/realms/{realm}/protocol/openid-connect/token';
@@ -509,6 +492,10 @@ public function realmsRealmProtocolOpenidConnectTokenPostRequest($realm, $userna
509492
if ($grant_type !== null) {
510493
$formParams['grant_type'] = ObjectSerializer::toFormValue($grant_type);
511494
}
495+
// form params
496+
if ($refresh_token !== null) {
497+
$formParams['refresh_token'] = ObjectSerializer::toFormValue($refresh_token);
498+
}
512499

513500
$headers = $this->headerSelector->selectHeaders(
514501
['application/json', ],

CustomApi/lib/ApiException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* The version of the OpenAPI document: 1.0
1818
* Generated by: https://openapi-generator.tech
19-
* Generator version: 7.9.0-SNAPSHOT
19+
* Generator version: 7.10.0-SNAPSHOT
2020
*/
2121

2222
/**

CustomApi/lib/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* The version of the OpenAPI document: 1.0
1818
* Generated by: https://openapi-generator.tech
19-
* Generator version: 7.9.0-SNAPSHOT
19+
* Generator version: 7.10.0-SNAPSHOT
2020
*/
2121

2222
/**

CustomApi/lib/HeaderSelector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* The version of the OpenAPI document: 1.0
1818
* Generated by: https://openapi-generator.tech
19-
* Generator version: 7.9.0-SNAPSHOT
19+
* Generator version: 7.10.0-SNAPSHOT
2020
*/
2121

2222
/**

CustomApi/lib/Model/ModelInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* The version of the OpenAPI document: 1.0
1919
* Generated by: https://openapi-generator.tech
20-
* Generator version: 7.9.0-SNAPSHOT
20+
* Generator version: 7.10.0-SNAPSHOT
2121
*/
2222

2323
/**

CustomApi/lib/Model/RealmsRealmProtocolOpenidConnectTokenPost200Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* The version of the OpenAPI document: 1.0
1919
* Generated by: https://openapi-generator.tech
20-
* Generator version: 7.9.0-SNAPSHOT
20+
* Generator version: 7.10.0-SNAPSHOT
2121
*/
2222

2323
/**
@@ -187,7 +187,7 @@ public function isNullableSetToNull(string $property): bool
187187
* @var string[]
188188
*/
189189
protected static $attributeMap = [
190-
'access_token' => 'accessToken',
190+
'access_token' => 'access_token',
191191
'expires_in' => 'expires_in',
192192
'refresh_expires_in' => 'refresh_expires_in',
193193
'refresh_token' => 'refresh_token',

CustomApi/lib/Model/RealmsRealmProtocolOpenidConnectTokenPost400Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* The version of the OpenAPI document: 1.0
1919
* Generated by: https://openapi-generator.tech
20-
* Generator version: 7.9.0-SNAPSHOT
20+
* Generator version: 7.10.0-SNAPSHOT
2121
*/
2222

2323
/**

0 commit comments

Comments
 (0)