[keycloak-user] Email verification and get admin-client exception entitiy

Marek Posolda mposolda at redhat.com
Fri Apr 24 02:52:41 EDT 2015


On 23.4.2015 14:41, Benjamin Hansmann [alphaApps] wrote:
> Greetings once again. Two more questions:
>
> - Is there any way to trigger/send a verification email other than
> logging in through the web frontend? I created the user through the
> admin-client and the user will use the direct grant api to login.
I think it's not possible. That's one of the limitations of Direct Grant 
API.

There is admin endpoint to remove required action from the user though, 
so you as admin can remove the required action for verify email from the 
user. But user himself needs to use frontend to verify email AFAIK.
>
> - When using the admin-client to create a user I want to handle/forward
> the response body. E.g. when a username already exists a
> ClientErrorException is thrown which includes a
> javax.ws.rs.core.Response with Status.CONFLICT. But there does not seem
> to be an entitiy/body in this Response. When I use the Admin REST API
> directly I will get: { "errorMessage" : "User exists with
> same username" }. Is there a way to obtain it when using the
> admin-client?
I think you're right. It looks that most of POST methods in admin-client 
return "void" instead of Response, so there is no possibility to check 
the details. Feel free to create JIRA for that.

Btv. If you have Keycloak sources and you want to give it a try, then 
you can try to change this line: 
https://github.com/keycloak/keycloak/blob/master/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UsersResource.java#L34 
to return "Response" instead of void. Then from the Response, you should 
be able to retrieve entity as ErrorRepresentation with the proper error 
method attached.

Marek
>
> Thanks and best wishes,
> Benjamin



More information about the keycloak-user mailing list