We used Swagger to generate a C# SDK for Keycloak v26.3.3. We’re using the code below to authenticate and get a list of Keycloak users. I keep getting 401 Unauthorised, but when I use the same bearer token via my Insomnia REST client, I get results:
var c = new Client.Configuration()
{
BasePath = "https://fqdn.for.keycloak",
AccessToken = "jwst.bearer.token",
}
var cli = Api.UsersApi(c);
var x = cli.AdminRealmsRealmUsersGet("test");
Has anyone had any success generating and using a C# SDK from the OpenAPI specification? Can you share some insights on what I’m missing. My URL, realm, and the Token appear to be valid. Can’t see what I’m doing wrong here.