Closed as not planned
Description
Cant send extra attribute in password grant
config.PasswordCredentialsToken(ctx, username, password)
So, we have to use Echange
to send client_ip
token, err = config.Exchange(ctx, "",
oauth2.SetAuthURLParam("grant_type", "password"),
oauth2.SetAuthURLParam("username", username),
oauth2.SetAuthURLParam("password", password),
oauth2.SetAuthURLParam("scope", strings.Join(config.Scopes, " ")),
oauth2.SetAuthURLParam("client_ip", clientIP))
I made http middleware which convert basic authentication to openid token for temporary backward compatibility
server extention read clientIP from attribute.
Server support forwarded request https://github.com/keycloak/keycloak-documentation/blob/master/server_installation/topics/clustering/load-balancer.adoc
But I have no idea how to set exchange request headers
req.Header.Set("X-Forwarded-Proto", "https");
req.Header.Set("X-Forwarded-For", clientIP);
Metadata
Metadata
Assignees
Labels
No labels