gocloak icon indicating copy to clipboard operation
gocloak copied to clipboard

GetUserCount ignores IDPAlias in GetUsersParams

Open FloppyNotFound opened this issue 2 years ago • 0 comments

Describe the bug I want to retrieve the amount of users which are registered via a certain IDP. When I call the Method "GetUsers", the filter works as expected, but in the function "GetUserCount", the IDPAlias in GetUsersParams seems to be ignored.

To Reproduce Steps to reproduce the behavior:

  1. Setup a Keycloak Instance and client
  2. Connect an Identity Provider
  3. Login into Keycloak via OpenID Connect by using a User from the external Identity Provider
  4. Call GetUserCount function as follows:
realm := "myrealm"
idp := "my-identity-provider"
userTotal, err := kcClient.GetUserCount(ctx, *kcAccessToken, realm, gocloak.GetUsersParams{
		IDPAlias: &idp,
})

Expected behavior userTotal == 1

Actual behavior userTotal == 2 Seems like the admin-User is counted as well, although it was obviously not registered via the IDP

Additional Information:

  • Version: v11

Screenshots grafik

FloppyNotFound avatar Oct 17 '22 15:10 FloppyNotFound