355e5661379644c081271b23fa8b966a098a42d2Jon Branch * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Copyright (c) 2015 ForgeRock AS. All Rights Reserved
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * The contents of this file are subject to the terms
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * of the Common Development and Distribution License
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * (the License). You may not use this file except in
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * compliance with the License.
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * You can obtain a copy of the License at
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * See the License for the specific language governing
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * permission and limitations under the License.
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * When distributing Covered Code, include this CDDL
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Header Notice in each file and include the License file
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * If applicable, add the following below the CDDL Header,
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * with the fields enclosed by brackets [] replaced by
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * your own identifying information:
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * "Portions Copyrighted [year] [name of copyright owner]"
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Version {{version}}
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Author {{author}}
355e5661379644c081271b23fa8b966a098a42d2Jon Branchpackage org.forgerock.openicf.connectors.{{lower packageName}}
355e5661379644c081271b23fa8b966a098a42d2Jon Branchimport org.forgerock.openicf.connectors.{{lower packageName}}.{{packageName}}Configuration
355e5661379644c081271b23fa8b966a098a42d2Jon Branchimport org.forgerock.openicf.misc.scriptedcommon.OperationType
355e5661379644c081271b23fa8b966a098a42d2Jon Branchimport org.identityconnectors.framework.common.exceptions.InvalidPasswordException
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Built-in accessible objects
355e5661379644c081271b23fa8b966a098a42d2Jon Branch// OperationType is AUTHENTICATION for this script
355e5661379644c081271b23fa8b966a098a42d2Jon Branch// The configuration class created specifically for this connector
355e5661379644c081271b23fa8b966a098a42d2Jon Branchdef configuration = configuration as {{packageName}}Configuration
355e5661379644c081271b23fa8b966a098a42d2Jon Branch// Default logging facility
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Script action - Customizable
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Must either return an int or String convertible to a Uid object or throw an exception
355e5661379644c081271b23fa8b966a098a42d2Jon Branch/* Perform an action to authenticate against the external source. If no authentication is
355e5661379644c081271b23fa8b966a098a42d2Jon Branch required then allow authId to pass through by default. This script is required. */
355e5661379644c081271b23fa8b966a098a42d2Jon Branch throw new InvalidPasswordException("Authentication Failed")
355e5661379644c081271b23fa8b966a098a42d2Jon Branch/* Log something to demonstrate this script executed */
54507660fb2716977261f50e2ba31e6198e44319Jon Branchlog.info("Authenticate script, operation = " + operation.toString());