How to trigger Application Initiated Actions from Javascript?

984 views
Skip to first unread message

Tim Court

unread,
Mar 26, 2021, 1:40:55 PM3/26/21
to Keycloak User
After following the conversation in this thread I am lead to believe that I can trigger user account actions from my javascript SPA. The last comment suggests that this should be possible with the JS adapter, but I'm not seeing any documentation that describes how to do so.

Specifically, I am trying to initiate a password change flow using Keycloak v11.

Can anyone point me to docs or examples of how to do this correctly? Thanks!

- Tim

Stan Silvert

unread,
Mar 29, 2021, 1:56:28 PM3/29/21
to keyclo...@googlegroups.com
The original design document is here and I believe it pretty much turned out as designed:
https://github.com/keycloak/keycloak-community/blob/master/design/application-initiated-actions.md

Code used in the new account console to initiate AIA password change is here:
https://github.com/keycloak/keycloak/blob/master/themes/src/main/resources/theme/keycloak.v2/account/src/app/content/signingin-page/SigningInPage.tsx#L228-L249
https://github.com/keycloak/keycloak/blob/master/themes/src/main/resources/theme/keycloak.v2/account/src/app/util/AIACommand.ts

It's probably not that clear from the code because this code supports more than just password change.  But if you spy on the requests sent from the new account console you should be able to make out what it is doing.
--
You received this message because you are subscribed to the Google Groups "Keycloak User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keycloak-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keycloak-user/1d41a106-0a77-4454-937a-ded0bbc3ffdfn%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages