Nerzal / gocloak

golang keycloak client
Apache License 2.0
1.03k stars 283 forks source link

GetUserCount ignores IDPAlias in GetUsersParams #378

Open FloppyNotFound opened 2 years ago

FloppyNotFound commented 2 years ago

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:

Screenshots grafik