Closed jet-go closed 1 year ago
either adding a new option to choose auth type or https://github.com/Nerzal/gocloak/blob/v13.8.0/client.go#L84-L94 or adding json tag might fix it. https://github.com/Nerzal/gocloak/blob/v13.8.0/models.go#L925-L927 (still need to test it though)
I was able resolve it with resty middleware. Let me close this.
rc := resty.New()
rc.OnBeforeRequest(func(c *resty.Client, r *resty.Request) error {
r.SetFormData(map[string]string{"client_secret": client_secret))
return nil
})
gc := gocloak.NewClient(uri)
gc.SetRestyClient(rc)
Describe the bug If we use ClientID/ClientSecret, it's always set as BasicAuth header. If we try to login/generate tokens for client_id with colon
:
(eg. client_id: my_svc:my_app), the basic auth fails (basic auth doesn't allow username with colons)To Reproduce Steps to reproduce the behavior:
Expected behavior Expected to use client_secret in form body as default or allow option to switch the auth type.