Skip to content

Token issuer is null in executeActionsEmail and sendVerifyEmail if no clientId is passed #35317

@simse07

Description

@simse07

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

admin/api

Describe the bug

I checked the implementation of the executeActionsEmail, especially

private SendEmailParams verifySendEmailParams(String redirectUri, String clientId, Integer lifespan) {
and found out that the issuer for the generated ExecuteActionsActionToken is null, if no clientId is passed.

It should take the clientId from the client found by

ClientModel client = clientId != null ? realm.getClientByClientId(clientId) : SystemClientUtil.getSystemClient(realm);
and passing it to the SendEmailParams return new SendEmailParams(redirectUri, client.getClientId(), lifespan);

Afterwards, the clientId is used in result.clientId to generate the token

ExecuteActionsActionToken token = new ExecuteActionsActionToken(user.getId(), user.getEmail(), expiration, actions, result.redirectUri, result.clientId);

This was introduced in 02d64d9

Version

26.0.6

Regression

  • The issue is a regression

Expected behavior

Token issuer is the clientId of the passed client or default client.

Actual behavior

Token issuer is null if no clientId is passed

How to Reproduce?

Call the api endpoint without passing a clientId and check the token.

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions