Nerzal/gocloak

GetServerInfo use wrong URL

roiebe opened this issue · 0 comments

roiebe commented

Describe the bug
GetServerInfo use wrong URL to request the server info from the keycloak server.
the URL <base-path>/admin/realms should be replaced with <base-path>/admin/serverinfo.
this mistake exists in the keycloak documentation too, and that may be the reason for the wrong implementation.

To Reproduce
Steps to reproduce the behavior:

  1. run keycloak version 20.0.3
  2. create a client (*gocloak.GoCloak)
  3. run client.LoginAdmin to get a token
  4. run client.GetServerInfo(ctx, token.AccessToken)

Expected behavior
the return value should contains server information, like the keycloak version, but it contains just default values.
the return value should be a single ServerInfoRepresentation, but it is a slice of ServerInfoRepresentation.
keycloak documentation refer to the wrong URL path, but they also describe that only a single ServerInfoRepresentation should be return. see https://www.keycloak.org/docs-api/20.0.3/rest-api/index.html#_root_resource

Desktop

  • OS: windows 11
  • Keyclaok Version: 20.0.3
  • goclaok version: 13.1.0