I want to make a rest call to my Keycloak server.
According to doc it should be easy: https://www.keycloak.org/docs-api/10.0/rest-api/index.html#_executeactionsemail
So before I’ll start codeing I want to prepare Postman call, so my url is
http://localhost:8080/auth/admin/realms/test/users/12345/execute-actions-email
in raw body I’m providing [‘UPDATE_PASSWORD’]
and what I get is 401 Unauthorized and I can’t get what I’m doing wrong?
Body:
Headers are default:
1 Like
Ok I’ve make this working.
I’ll post what I did.
Get token for master realm admin account:
Call reset password service in test realm
I’ve had wrong body so correct body for this request is [“UPDATE_PASSWORD”] and You can notice 204 in the right bottom corner.
The second question is, is it possible to have special user in a realm, not master realm admin for getting a token?
1 Like
divya
September 6, 2021, 7:25am
3
I have followed the same steps but still I am getting 500 error. I do not understand what I am doing wrong. Do I need to configure anything. Please help.
Here is a link of the post I have already posted earlier:
Details of the API are as follows:
API: https://{servername:port}/auth/admin/realms/{realm}/users/{userId}/execute-actions-email
Request body: [“UPDATE_PASSWORD”]
Screenshot of the error is attached as below:
[failed send email]
Please help me.
Thanks in advance.
Thanks in advance.
Is your smtp configuration good in Realm Settings > Email ? Did you check the server logs ? Does the targeted user have a defined email ?
divya
September 6, 2021, 12:29pm
5
Yes, I have configured SMTP settings (screenshot attached below), but the test connection also gives 500.
Also, the targeted user has a defined email.
I see that you want to use a gmail account and obviously you have not filled everything correctly, look at this article : GMail SMTP Server (Google) - How to Configure & Send Emails for Free? - SiteGround KB And you need Less secure app access on you google account. Less secure apps & your Google Account - Google Account Help
2 Likes