-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gocloak is broken for Keycloak v17.0 : need to remove /auth from the gocloak endpoint path #346
Comments
@Nerzal i would like to thank you for this wonderful Go Library. With this bug i wanted to bring it to your notice that |
Hi, see #252 how to change the endpoint`s paths. Fully example for Keycloak 17: package main
import (
"context"
"crypto/tls"
"fmt"
gocloak "github.com/Nerzal/gocloak/v11"
)
var URL string = "https://127.0.0.1:8443"
func main() {
realm := "master"
clientID := "my-resource-server"
clientSecret := "***"
client := gocloak.NewClient(URL, gocloak.SetAuthAdminRealms("admin/realms"), gocloak.SetAuthRealms("realms"))
restyClient := client.RestyClient()
restyClient.SetDebug(true)
restyClient.SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true})
ctx := context.Background()
token, err := client.LoginClient(ctx, clientID, clientSecret, realm)
if err != nil {
panic("Login failed:" + err.Error())
}
fmt.Println(token)
} |
thanks @mbecker I can confirm this works. |
Hi, I am using Keycloak 18 with lib v11.1.0. I have updated the options for the path change. The |
I found this in the migrating to quarkus guide: Default context path changed
|
Thanks mbecker for share this solutions! |
We've created a ticket to address this problem at my workplace. |
Heyho everyone, here is an update: I managed to pack this into a Task in the new sprint at work. I'm using the time at work to merge and test on the dev branch and then pack a new big release within the next days |
Describe the bug
Upon hitting any of the API calls i am getting error
To Reproduce
Steps to reproduce the behavior:
17.0.1
11.0.2
FYI direct CURL on keyckoak works fine
Expected behavior
We should able to successfully authenticatae using gocloak method
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Important : Starting 17.0+ version of Keycloak, there's a change in endpoints as per the official documentation, you need to omit
/auth
from the endpoint.We need a mechanism in gocloak to omit
\admin
The text was updated successfully, but these errors were encountered: