Closed ytanne closed 8 months ago
Describe the bug I am failing to set custom token endpoint.
To Reproduce Steps to reproduce the behavior:
// values are just examples hostname = "https://test.domain" customEndpoint = "test/path/to/token"
client := gocloak.NewClient(hostname, gocloak.SetTokenEndpoint(customEndpoint)) token, err := client.LoginClient(context.Background(), username, password, realm) if err != nil { log.Println(err) os.Exit(1) }
2. Run: ```bash go run test.go
404 Not Found: RESTEASY003210: Could not find resource for full path: https://test.domain/realms//test/path/to/token
Expected behavior I expect to get the token
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
What keycloak version are u using?
I have found the source of the issue. The realm that I was passing was empty. Anyway, I wonder why you use strings.Join in makeURL instead of url.JoinPath?
strings.Join
makeURL
url.JoinPath
Describe the bug I am failing to set custom token endpoint.
To Reproduce Steps to reproduce the behavior:
client := gocloak.NewClient(hostname, gocloak.SetTokenEndpoint(customEndpoint)) token, err := client.LoginClient(context.Background(), username, password, realm) if err != nil { log.Println(err) os.Exit(1) }
Expected behavior I expect to get the token
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Kernel: Linux 5.15.0-89-generic Architecture: x86-64