lvermeulen / Keycloak.Net

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

clientId is HardCoded in FlurlExtensions.cs #72

Open anshumanchatterji opened 2 years ago

anshumanchatterji commented 2 years ago
                 var result = await url
                .AppendPathSegment($"/auth/realms/{realm}/protocol/openid-connect/token")
                .WithHeader("Content-Type", "application/x-www-form-urlencoded")
                .PostUrlEncodedAsync(new List<KeyValuePair<string, string>>
                {
                    new KeyValuePair<string, string>("grant_type", "client_credentials"),
                    new KeyValuePair<string, string>("client_secret", clientSecret),
                    new KeyValuePair<string, string>("client_id", "admin-cli")    // <-------------------- Hardcoded
                })
                .ReceiveJson().ConfigureAwait(false);

There should be an overload in the constructor of KeycloakClient where client_id could be passed. I could submit a PR.

adhip94 commented 2 years ago

@anshumanchatterji I suggest you create a PR!

Edit: Nevermind, I already created a PR here