onCreate-user-set-default-fields.js revision b3ec0fd47cdcf8f64148a88ac62a7a68411c5c89
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * Copyright (c) 2011-2012 ForgeRock AS. All rights reserved.
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * The contents of this file are subject to the terms
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * of the Common Development and Distribution License
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * (the License). You may not use this file except in
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * compliance with the License.
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * You can obtain a copy of the License at
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * See the License for the specific language governing
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * permission and limitations under the License.
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * When distributing Covered Code, include this CDDL
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * Header Notice in each file and include the License file
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * If applicable, add the following below the CDDL Header,
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * with the fields enclosed by brackets [] replaced by
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * your own identifying information:
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * "Portions Copyrighted [year] [name of copyright owner]"
894623f06f0b765163c8593164cf1cdd2f725819Chad Kienle * @author jdabrowski
894623f06f0b765163c8593164cf1cdd2f725819Chad Kienle * This script sets default fields.
894623f06f0b765163c8593164cf1cdd2f725819Chad Kienle * It forces that user role is openidm-authorized and account status
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * is active.
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff * It is run every time new user is created.
894623f06f0b765163c8593164cf1cdd2f725819Chad KienleuiConfig = openidm.read("config/ui/configuration");
894623f06f0b765163c8593164cf1cdd2f725819Chad Kienle object.lastPasswordAttempt = (new Date()).toString();
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff//password and security answer are generated if missing just to keep those attributes filled
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff object.password = java.util.UUID.randomUUID().toString();
ad17b15404fe8bbc97c620669f32311567a9ab84Andi Egloff object.securityAnswer = java.util.UUID.randomUUID().toString();