[keycloak-user] use custom FormAction implementation on "edit account" page

Łukasz Dywicki luke at code-house.org
Wed May 15 11:33:51 EDT 2019


Dear Markus,
FormActions are valid for registration and login purposes but as far I
know they do not cover account editing.

Main difficulty is extension of validation because AccountProvider is
called by AccountFormService (you hit it with browser). There is also
AccountRestService used when you work with account using HTTP directly.
Both are embedded in Keycloak and have no "extension" points.
In order to have more customized processing of tempaltes for account
edit you need to implement AccountProvider SPI.
There are several pages which are covered by it. Base implementation is
FreeMarkerAccountProvider.

Sadly at this stage the only way to get custom REST resource. For
reference I just leave account handling logic which is available out of
the box:
org.keycloak.services.resources.RealmsResource#getAccountService
org.keycloak.services.resources.account.AccountLoader#getAccountService
org.keycloak.services.resources.account.AccountRestService
org.keycloak.services.resources.account.AccountFormService

Kind regards,
Łukasz
--
http://code-house.org

On 14.05.2019 10:57, Markus Schulz wrote:
> hello,
> 
> I've implemented an "extended profile validation" FormAction provider 
> which validates (required fields, field-format) some additional user 
> attributes (contained in our custom theme). 
> 
> But now there is a major problem, i don't know how i can use this 
> provider for the "edit account" page. 
> Currently the user needs to enter some additional fields on the 
> registration page, but after this, he can freely choose to edit/delete 
> the content on the "edit account" page. 
> 
> How can i prevent this?
> 
> regards,
> msc
> 
> _______________________________________________
> 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