lvermeulen / Keycloak.Net

C# client for Keycloak 6.x
MIT License
206 stars 121 forks source link

Add Method to pull the list of realms #19

Closed eramosr16 closed 4 years ago

eramosr16 commented 4 years ago

Sorry I should create a PR for this but I can't at this moment, just create a method under RealmsAdmin/KeycloakClient.cs:

public async Task<IEnumerable<Realm>> GetRealmsAsync(string realm) => await GetBaseUrl(realm) .AppendPathSegment($"/admin/realms") .GetJsonAsync<IEnumerable<Realm>>() .ConfigureAwait(false);

Test method:

[Theory] [InlineData("master")] public async Task GetRealmsAsync(string realm) { var result = await _client.GetRealmsAsync(realm); Assert.NotNull(result); }

lvermeulen commented 4 years ago

It's in release 1.0.13