2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster/**
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster *
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster *
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * The contents of this file are subject to the terms
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * of the Common Development and Distribution License
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * (the License). You may not use this file except in
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * compliance with the License.
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster *
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * You can obtain a copy of the License at
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * opensso/legal/CDDLv1.0.txt
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * See the License for the specific language governing
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * permission and limitations under the License.
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster *
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * When distributing Covered Code, include this CDDL
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * Header Notice in each file and include the License file
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * at opensso/legal/CDDLv1.0.txt.
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * If applicable, add the following below the CDDL Header,
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * with the fields enclosed by brackets [] replaced by
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * your own identifying information:
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster *
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * $Id: ClearTextTransform.java,v 1.2 2008/06/25 05:41:57 qcheng Exp $
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster *
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster */
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Fosterpackage com.sun.identity.authentication.modules.jdbc;
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Fosterimport com.sun.identity.authentication.spi.AuthLoginException;
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster/**
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * A very simple test implementation of the JDBC Password Syntax Transform.
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster */
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Fosterpublic class ClearTextTransform implements JDBCPasswordSyntaxTransform {
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster /**
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * Creates a new instance of <code>ClearTextTransform</code>.
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster */
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster public ClearTextTransform() {
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster }
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster /**
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * This simply returns the clear text format of the password.
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster *
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * @param input Password before transform
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * @return Password after transform in this case the same thing.
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster * @throws AuthLoginException
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster */
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster public String transform(String input) throws AuthLoginException {
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster if (input == null) {
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster throw new AuthLoginException(
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster "No input to the Clear Text Transform!");
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster }
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster return input;
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster }
2d0a88b18a041738cfe635b45bd1db56af469c91Allan Foster}