I have a problem with updating user using keycloak rest api, neither my requests work.
For example, I'm trying to get all realm users based on docs. I send get-request on this endpoint
http://keycloak.my/auth/realms/my_realm/account/users
but get 404 error
How to make it work? Why do I get 404, if I take this endpoint from docs?
This URL:
http://keycloak.my/auth/realms/my_realm/account/users
is incorrect.
The correct one is:
http://keycloak.my/auth/admin/realms/my_realm/account/users
For all those endpoints the base URL is ${KeycloakIP}/auth/admin/
Related
I have an AWS API Gateway proxy URL to an internal API. I need to get a customized header "rwd" from the API response and so I have set in the API Gateway's integration response and method response, and I see the header when I test the URL within API Gateway console.
But when I call the API Gateway URL from Postman, or cURL, the header is missing.
Any idea what am I missing in the setup?
Answering my own question - needed to click on "Deploy API" in the dropdown for changes to take effect. Silly me for missing it!
I'm trying to get my github profile detail from github using the graphql endpoint 'https://developer.github.com/v4/explorer/' and after creating a personal token i'm getting a 405 error, this is my code please what am I doing wrong error messageenter image description here
The page you're attempting to load is a UI tool to help developers explore GraphQL. In other words, it's a normal webpage, not the GraphQL endpoint.
The error message you're getting is a 405 Method Not Allowed. That's because you're making a POST request to this page, but that isn't a valid method here. Because this is a normal webpage, you probably need to use a normal GET request if you want to load it.
If you're looking to make a GraphQL request, you'll need to use the proper endpoints, which is https://api.github.com/graphql. A POST request is correct for that endpoint.
I've build an Android app using Firebase, but I'd like to test the performance of the Cloud Firestore using REST requests (through Postman). I've looked up some info on some sites from Firebase, but everytime I send a request, I get a 404 Not Found.
The Authentication I use seems to work, by doing a POST request to
https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=MY_API_KEY I'm able to get a Firebase Id Token.
After that I tried sending a GET request to https://firestore.googleapis.com/v1beta1/parent=projects/MY_PROJECT_ID/databases/(default)/documents/MY_COLLECTION_ID with the token as Authrorization header, but everytime I seem to get 404 Page Not Found.
I'm not sure what I'm doing wrong and I hope someone can help me with this.
Thanks in advance!
Apparently I wasn't supposed to include the parent= in the URL, I removed it and now it works just fine.
I'm calling the IBM Bluemix Administration API for Message Hub (aka Kafka), as described here.
Calling the endpoint https://kafka-admin-prod02.messagehub.services.eu-gb.bluemix.net:443/topics (using an appropriate X-Auth-Token value corresponding to our API key, and a GET verb) seems to work - it returns a list of the topics we've manually configured in the Bluemix Message Hub admin screen.
However, calling the same URL with the verb POST and a body of {name: 'mynewtopicname'} and a Content-Type of application/json (this appears to be the correct syntax, according to the Swagger docs for the API) doesn't work - I get a result of "HTTP 405 Method Not Allowed". That seems to happen whether I use GET, PUT, POST or DELETE (which also means I cannot delete a topic).
Am I doing something wrong?
(I'm using Message Hub on the UK Bluemix instance, if it's relevant).
To create topics you need to do a POST to the URL /admin/topics, not /topics. Give it a try and let me know if it works.
I refer many document for trying making api Restful like below:
GET /user
POST /user
GET /user/123
PUT /user/123
DELETE /uesr/123
But Backend uses OAuth2 token to retrieve user id, it means that Server will know 123 after get token.
I thought it's not a great idea to put token directly in the id place:
GET /user/aweakleknf11123232sadwanawndajkdnamdal
Is any better practice to the restful OAuth2 API?
While designing RESTful api don't think too much about how your url look, rather it is just representation of your resources.
And moreover it is not good idea to expose domain model of your project if your api is public.
If you have gone through Facebook api design you can see that they refer user as
/me?method=GET&format=json&access_token=...
They have abstracted the domain and just sharing self descriptive representation.