New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CreatedTimestamp on REST import not used #14009
Comments
In // Import users just to user storage. Don't federate
UserModel user = UserStoragePrivateUtil.userLocalStorage(session).addUser(newRealm, userRep.getId(), userRep.getUsername(), false, false);
user.setEnabled(userRep.isEnabled() != null && userRep.isEnabled());
user.setCreatedTimestamp(userRep.getCreatedTimestamp()); Is the issue still relevant ? |
I'm dusting off the user migration again and will confirm. But LegacyExportImportManager and MapUserProvider are different things. The REST import should pass through this code. And keycloak/model/map/src/main/java/org/keycloak/models/map/user/MapUserProvider.java Line 360 in 6830735
|
No, the provided value from the REST import is not used. It still uses the time of import instead of the value provided in the import. |
I'm looking at |
Fixes keycloak#14009. Untested as I don't really have a good way to compile and test locally, but from looking at the code changes here, this _should_ fix the issue.
Just pushed up a PR that should at least start the conversation here. |
Closes keycloak#14009 Signed-off-by: Kamontat Chantrachirathumrong <14089557+kamontat@users.noreply.github.com>
Description
The CreatedTimestamp (if set on the user rest creation call) is always discarded in favor of
Time.currentTimeMillis()
. This shouldn't be the case for scenarios when someone is REST importing from a legacy system.Discussion
No response
Motivation
Handle graceful import of users from legacy systems.
Details
From
MapUserProvider
.The text was updated successfully, but these errors were encountered: