lvermeulen / Keycloak.Net

C# client for Keycloak 6.x
MIT License
203 stars 120 forks source link

Variabilize grant_type value #85

Open FRANCISAnas opened 1 year ago

FRANCISAnas commented 1 year ago

@lvermeulen, Can you variabilize the value of the key grant_type in Keycloak.Net/Client/KeycloakClient.cs line 308 please ?

Something like this :


public async Task<IEnumerable<Resource>> GetResourcesOwnedByClientAsync(string realm, string clientId, string grantType) => await GetBaseUrl(realm)
            .AppendPathSegment($"/realms/{realm}/protocol/openid-connect/token")
            .PostUrlEncodedAsync(new List<KeyValuePair<string, string>>
            {
                new KeyValuePair<string, string>("grant_type", grantType),
                new KeyValuePair<string, string>("response_mode", "permissions"),
                new KeyValuePair<string, string>("audience", clientId)
            })
            .ReceiveJson<IEnumerable<Resource>>()
            .ConfigureAwait(false);

I don't have right to commit/push on your repository, so i opend this issue.

Thank you 😉