Resource endpoints fail with 404 due to incorrectly constructed URLs
See original GitHub issueThanks for this library which looks great! 😃
I am having an issue running a simple quickstart to authenticate with keycloak and list clients:
#!/usr/bin/env node
import KcAdminClient from 'keycloak-admin';
async function main() {
const kcAdminClient = new KcAdminClient({
baseUrl: 'http://localhost:8081/keycloak/auth',
realmName: 'realm'
});
await kcAdminClient.auth({
username: 'username',
password: 'password',
grantType: 'password',
clientId: 'admin-cli'
});
await kcAdminClient.clients.find()
.catch(err => console.log(err));
}
main();
But on the clients.find()
line I get an error
Error: Request failed with status code 404
Looking into the error object the request URL was
http://localhost:8081/keycloak/auth%5Cadmin%5Crealms%5Crealm%5Cclients
i.e. it seems the URL has been constructed and/or encoded incorrectly.
I am running the script via
ts-node index.ts
Have you seen this before? Is there a known fix and/or workaround?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Resource endpoints fail with 404 due to incorrectly ... - GitHub
i.e. it seems the URL has been constructed and/or encoded incorrectly. I am running the script via. ts-node index.ts.
Read more >REST API 404: Bad URI, or Missing Resource? - Stack Overflow
I have a service which returns data. But there's situations where the data is broken. The request URL is correct (so not a...
Read more >404 Not Found Error: What It Is and How to Fix It - Airbrake Blog
The 404 Not Found Error is an HTTP response status code, which indicates that the requested resource could not be found.
Read more >Troubleshooting Azure CDN endpoints - 404 status code
Users who attempt to access your content via the CDN URL receive an HTTP 404 status code. Cause. There are several possible causes,...
Read more >Debugging the Spring MVC 404 “No mapping found for HTTP ...
As with any web application or website, Spring MVC returns the HTTP 404 response code when the requested resource can't be found.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Nice, that has fixed it, thank you!
Thanks for the quick response & fix 😃
Glad to hear that 😀