EMG
EMG

Reputation: 71

Keycloak email custom theme, get user ID

I'm creating a custom theme to emails on keycloak and I need to get the user Id who ask for password reset. I can get the Username, the Firs name etc by user.getUsername(),user.getFirstName() but I can't get the Id. I tried user.getUserId, user.getId, user.getID..but always get an error. Can anybody helps me?

Thanks

Upvotes: 2

Views: 912

Answers (1)

sventorben
sventorben

Reputation: 1912

Unfortunately, the id is not available out of the box. The user attribute is an instance of ProfileBean. You can only use the properties of that class.

You will need to either find a way to map it into an attribute or write a custom EmailTemplateProvider

Upvotes: 3

Related Questions