< prev index next >

## src/jdk.security.auth/share/classes/com/sun/security/auth/module/JndiLoginModule.java

Print this page

      1 /*
      2  * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
      3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      4  *
      5  * This code is free software; you can redistribute it and/or modify it
      6  * under the terms of the GNU General Public License version 2 only, as
      7  * published by the Free Software Foundation.  Oracle designates this
      8  * particular file as subject to the "Classpath" exception as provided
      9  * by Oracle in the LICENSE file that accompanied this code.
     10  *
     11  * This code is distributed in the hope that it will be useful, but WITHOUT
     12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     14  * version 2 for more details (a copy is included in the LICENSE file that
     15  * accompanied this code).
     16  *
     17  * You should have received a copy of the GNU General Public License version
     18  * 2 along with this work; if not, write to the Free Software Foundation,
     19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
     20  *
     21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
     22  * or visit www.oracle.com if you need additional information or have any
    134  *                   If the authentication fails, the failure is reported
    135  *                   back to the calling application.
    136  *
    137  *    storePass      if, true, this LoginModule stores the username and password
    138  *                   obtained from the CallbackHandler in the module's
    139  *                   shared state, using "javax.security.auth.login.name" and
    140  *                   "javax.security.auth.login.password" as the respective
    141  *                   keys.  This is not performed if existing values already
    142  *                   exist for the username and password in the shared state,
    143  *                   or if authentication fails.
    144  *
    145  *    clearPass     if, true, this {@code LoginModule} clears the
    146  *                  username and password stored in the module's shared state
    147  *                  after both phases of authentication (login and commit)
    148  *                  have completed.
    149  * </pre>
    150  *
    151  */
    152 public class JndiLoginModule implements LoginModule {
    153
    154     /** JNDI Provider */

    155     public final String USER_PROVIDER = "user.provider.url";

    156     public final String GROUP_PROVIDER = "group.provider.url";
    157
    158     // configurable options
    159     private boolean debug = false;
    160     private boolean strongDebug = false;
    161     private String userProvider;
    162     private String groupProvider;
    163     private boolean useFirstPass = false;
    164     private boolean tryFirstPass = false;
    165     private boolean storePass = false;
    166     private boolean clearPass = false;
    167
    168     // the authentication status
    169     private boolean succeeded = false;
    170     private boolean commitSucceeded = false;
    171
    172     // username, password, and JNDI context
    173     private String username;
    174     private char[] password;
    175     DirContext ctx;
      1 /*
      2  * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
      3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      4  *
      5  * This code is free software; you can redistribute it and/or modify it
      6  * under the terms of the GNU General Public License version 2 only, as
      7  * published by the Free Software Foundation.  Oracle designates this
      8  * particular file as subject to the "Classpath" exception as provided
      9  * by Oracle in the LICENSE file that accompanied this code.
     10  *
     11  * This code is distributed in the hope that it will be useful, but WITHOUT
     12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     14  * version 2 for more details (a copy is included in the LICENSE file that
     15  * accompanied this code).
     16  *
     17  * You should have received a copy of the GNU General Public License version
     18  * 2 along with this work; if not, write to the Free Software Foundation,
     19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
     20  *
     21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
     22  * or visit www.oracle.com if you need additional information or have any
    134  *                   If the authentication fails, the failure is reported
    135  *                   back to the calling application.
    136  *
    137  *    storePass      if, true, this LoginModule stores the username and password
    138  *                   obtained from the CallbackHandler in the module's
    139  *                   shared state, using "javax.security.auth.login.name" and
    140  *                   "javax.security.auth.login.password" as the respective
    141  *                   keys.  This is not performed if existing values already
    142  *                   exist for the username and password in the shared state,
    143  *                   or if authentication fails.
    144  *
    145  *    clearPass     if, true, this {@code LoginModule} clears the
    146  *                  username and password stored in the module's shared state
    147  *                  after both phases of authentication (login and commit)
    148  *                  have completed.
    149  * </pre>
    150  *
    151  */
    152 public class JndiLoginModule implements LoginModule {
    153
    154     /**
    155      * Directory service/path where this module can access the relevent
    156      * user information.
    157      */
    158     public final String USER_PROVIDER = "user.provider.url";
    159
    160     /**
    161      * Directory service/path where this module can access the relevent
    162      * group information.
    163      */
    164     public final String GROUP_PROVIDER = "group.provider.url";
    165
    166     // configurable options
    167     private boolean debug = false;
    168     private boolean strongDebug = false;
    169     private String userProvider;
    170     private String groupProvider;
    171     private boolean useFirstPass = false;
    172     private boolean tryFirstPass = false;
    173     private boolean storePass = false;
    174     private boolean clearPass = false;
    175
    176     // the authentication status
    177     private boolean succeeded = false;
    178     private boolean commitSucceeded = false;
    179
    180     // username, password, and JNDI context
    181     private String username;
    182     private char[] password;
    183     DirContext ctx;

< prev index next >