Keycloak.Net icon indicating copy to clipboard operation
Keycloak.Net copied to clipboard

clientId is HardCoded in FlurlExtensions.cs

Open anshumanchatterji opened this issue 2 years ago • 1 comments

                 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.

anshumanchatterji avatar Jan 06 '22 11:01 anshumanchatterji

@anshumanchatterji I suggest you create a PR!

Edit: Nevermind, I already created a PR here

adhip94 avatar Feb 23 '22 17:02 adhip94