[keycloak-user] AngularJS Example for execute-actions-email REST Request
Sebastien Blanc
sblanc at redhat.com
Thu Dec 15 01:20:06 EST 2016
actions is expecting a string array , so maybe something like :
actions: ['VERIFY_EMAIL','UPDATE_PASSWORD'] ?
On Thu, Dec 15, 2016 at 3:50 AM, Roger Turnau (US - Advisory) <
roger.turnau at pwc.com> wrote:
> 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.
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>
More information about the keycloak-user
mailing list