[keycloak-user] AngularJS Example for execute-actions-email REST Request
Roger Turnau (US - Advisory)
roger.turnau at pwc.com
Wed Dec 14 21:50:46 EST 2016
Hi all,
Can someone show me a quick example of how to create (preferably in
AngularJS) the PUT request to send an execute-actions-email to a user?
I'm building a service in AngularJS to call the Admin REST service. I can
get the access token and make GET requests just fine, but the PUT request
on execute-actions-email is giving me errors.
Here's what I have so far:
$http.put("
http://localhost:8380/auth/admin/realms/realm1/users/bob/execute-actions-email
",
{
actions: 'VERIFY_EMAIL&UPDATE_PASSWORD'
},
{
headers: {
Authorization: "Bearer eyJhb...",
Content-type: "application/json"
}
});
But this gets the following error in Keycloak:
16:46:15,961 ERROR [org.jboss.resteasy.resteasy_jaxrs.i18n] (default
task-25) RESTEASY002005: Failed executing PUT
/admin/realms/realm1/users/bob/execute-actions-email:
org.jboss.resteasy.spi.ReaderException:
com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize
instance of java.util.ArrayList out of START_OBJECT token
at [Source: io.undertow.servlet.spec.ServletInputStreamImpl at 10fb0244;
line: 1,column: 1]
at
org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:184)
at
org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:91)
at
org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:114)
at
org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)
at
org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)
...
It seems not to like that second parameter, but I can't tell why. I
appreciate any help you can give on this one. I have no idea how this
request is supposed to look.
Thank you,
Roger Turnau
______________________________________________________________________
The information transmitted, including any attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited, and all liability arising therefrom is disclaimed. If you received this in error, please contact the sender and delete the material from any computer. PricewaterhouseCoopers LLP is a Delaware limited liability partnership. This communication may come from PricewaterhouseCoopers LLP or one of its subsidiaries.
More information about the keycloak-user
mailing list