@@ -0,0 +1,2690 @@
+/*%0A * JBoss, Home of Professional Open Source.%0A * Copyright 2017 Red Hat, Inc., and individual contributors%0A * as indicated by the @author tags.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.wildfly.security.auth.callback;%0A%0Aimport java.io.Serializable;%0Aimport java.util.Arrays;%0A%0Aimport org.wildfly.common.Assert;%0A%0A/**%0A * A callback used when a password reset is required.  Interactive callback handlers should have the user enter the%0A * password two times, comparing them for equality.%0A *%0A * @author %3Ca href=%22mailto:david.lloyd@redhat.com%22%3EDavid M. Lloyd%3C/a%3E%0A */%0Apublic final class PasswordResetCallback implements ExtendedCallback, Serializable%7B%0A    private static final long serialVersionUID = - 8789058459408593766L;%0A%0A    private final String prompt;%0A%0A    private char%5B%5D password;%0A%0A    /**%0A     * Construct a new instance.%0A     *%0A     * @param prompt the password reset prompt (must not be %7B@code null%7D or empty)%0A     */%0A    public PasswordResetCallback(final String prompt) %7B%0A        Assert.checkNotNullParam(%22prompt%22, prompt);%0A        Assert.checkNotEmptyParam(%22prompt%22, prompt);%0A        this.prompt = prompt;%0A    %7D%0A%0A    /**%0A     * Get the password reset prompt.%0A     *%0A     * @return the password reset prompt%0A     */%0A    public String getPrompt() %7B%0A        return prompt;%0A    %7D%0A%0A    /**%0A     * Get the new password.%0A     *%0A     * @return the new password, or %7B@code null%7D if it was not set%0A     */%0A    public char%5B%5D getPassword() %7B%0A        final char%5B%5D password = this.password;%0A        return password == null ? null : password.clone();%0A    %7D%0A%0A    /**%0A     * Set the new password.%0A     *%0A     * @param password the new password%0A     */%0A    public void setPassword(final char%5B%5D password) %7B%0A        this.password = password == null ? null : password.clone();%0A    %7D%0A%0A    /**%0A     * Clear the stored password bytes by setting them to %7B@code ' '%7D.%0A     */%0A    public void clearPassword() %7B%0A        final char%5B%5D password = this.password;%0A        if (password != null) %7B%0A            Arrays.fill(password, ' ');%0A        %7D%0A    %7D%0A%0A    public boolean isOptional() %7B%0A        return false;%0A    %7D%0A%0A    public boolean needsInformation() %7B%0A        return true;%0A    %7D%0A%7D%0A

Introduce password-reset callback