Skip to content

Commit

Permalink
Merge pull request #86 from MohammadWaleed/develop
Browse files Browse the repository at this point in the history
prepare for 0.30.0
  • Loading branch information
MohammadWaleed authored Mar 14, 2022
2 parents 523bada + e62ec6e commit 861abc6
Show file tree
Hide file tree
Showing 3 changed files with 243 additions and 241 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Features:
3. No need to specify any urls other than the base uri
4. No encode/decode for json just data as you expect

works with Keycloak 7.0 admin rest api
Works with Keycloak 7.0+ admin REST API.

https://www.keycloak.org/docs-api/7.0/rest-api/index.html
https://www.keycloak.org/documentation -> "Administration REST API"


# How to use
Expand All @@ -60,6 +60,8 @@ $client = Keycloak\Admin\KeycloakClient::factory([
]);
```

Since version 0.30, if your Keycloak base URL starts with `auth/`, add it to `baseUri` (e.g. http://127.0.0.1:8180/auth). Base URL for Keycloak versions 7 to 16 have systematically `auth/`. On Keycloak 17+ it depends on your settings.


#### 2. Use it

Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Middleware/RefreshToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function getAccessToken($credentials, $refresh, $options)
return new RejectedPromise("cannot refresh token when the 'refresh_token' is missing");
}

$url = "auth/realms/{$options['realm']}/protocol/openid-connect/token";
$url = "realms/{$options['realm']}/protocol/openid-connect/token";
$clientId = $options["client_id"] ?? "admin-cli";
$grantType = $refresh ? "refresh_token" : ($options["grant_type"] ?? "password");
$params = [
Expand Down
Loading

0 comments on commit 861abc6

Please sign in to comment.