How to compare the LDAP password

Hello

I am able to bind to the LDAP connection using the program java and able to search the DN of the user and get the userPassword attribute. I get encrypted password. My question is what is the encryption algorithm should I use to convert my password in plain text to compare with the password LDAP attribute?

You do not compare the password entered with the LDAP password. You try to authenticate to the LDAP server as long as that user with the entered password. If you succeed, the password is correct. This is what is called an LDAP "bind" operation, not to be confused with the JNDI 'bind '. In JNDI, it's a reconnect().

Tags: Java

Similar Questions

  • How to compare the current password encrypted pasword enter APEX4.1

    Hi all
    In my application uses the following package
    create or replace PACKAGE BODY app_security_pkg
    AS
    PROCEDURE login 
              (
               p_uname IN VARCHAR2
              ,p_password IN VARCHAR2
              ,p_session_id IN VARCHAR2
              ,p_flow_page IN VARCHAR2
              )
    IS
     lv_goto_page NUMBER DEFAULT 1;
    BEGIN
     
     -- This logic is a demonstration of how to redirect 
     -- to different pages depending on who successfully 
     -- authenticates. In my example, it simply demonstrates 
     -- the ADMIN user going to page 1 and all other users going
     -- to page 2. Add you own logic here to detrmin which page 
     -- a user should be directed to post authentication.
     IF UPPER(p_uname) = 'ADMIN'
     THEN
      lv_goto_page := 1;
     ELSE
      lv_goto_page := 2;
     END IF;
    
    APEX_UTIL.SET_SESSION_STATE('FSP_AFTER_LOGIN_URL');
    
     wwv_flow_custom_auth_std.login 
     (
      p_uname => p_uname,
      p_password => p_password,
      p_session_id => p_session_id,
      p_flow_page => p_flow_page || ':' || lv_goto_page
      );
    
    EXCEPTION
    WHEN OTHERS
    THEN 
     RAISE;
    END login;
    
    PROCEDURE add_user 
    (
     p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    )
    AS
    BEGIN
    INSERT INTO app_users (username, PASSWORD)
        VALUES (UPPER (p_username),
            get_hash (TRIM (p_username), p_password));
    
    COMMIT;
    
    EXCEPTION
    WHEN OTHERS
    THEN 
     ROLLBACK; 
     RAISE;
    END add_user;
    
    -- Function to Perform a oneway hash of the users 
    -- passwords. This cannot be reversed. This exmaple 
    -- is a very week hash and if been used on a production 
    -- system, you may want to use a stronger hash algorithm.
    -- Read the Documentation for more info on DBMS_CRYPTO as 
    -- this is the supported package from Oracle and 
    -- DBMS_OBFUSCATION_TOOLKIT is now depricated.
    FUNCTION get_hash (p_username IN VARCHAR2, p_password IN VARCHAR2)
    RETURN VARCHAR2
    AS
    BEGIN
    RETURN DBMS_OBFUSCATION_TOOLKIT.md5 (
    input_string => UPPER (p_username) 
                    || '/' 
                    || UPPER (p_password));
    END get_hash;
    
    PROCEDURE valid_user2 (p_username IN VARCHAR2, p_password IN VARCHAR2)
    AS
    v_dummy VARCHAR2 (1);
    BEGIN
    SELECT '1'
    INTO v_dummy
    FROM app_users
    WHERE UPPER (username) = UPPER (p_username)
    AND PASSWORD = get_hash (p_username, p_password);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN raise_application_error (-20000, 'Invalid username / password.');
    END valid_user2;
    
    FUNCTION valid_user (p_username IN VARCHAR2, p_password IN VARCHAR2)
    RETURN BOOLEAN
    AS
    BEGIN
    valid_user2 (UPPER (p_username), p_password);
    RETURN TRUE;
    EXCEPTION
    WHEN OTHERS
    THEN RETURN FALSE;
    END valid_user;
    
    END app_security_pkg;
    Here the ADD_USER procedure will convert the password and stores in the Table app_users in encrypted form.

    In my application, users can change their password,
    So I need to compare the password entering the Current_password field with the password encrypted in the app_users table.
    So I used the following code,
    declare
      l_x varchar2(30);
    begin
      select username into l_x
            from app_users
        where upper(username) = upper(:P7_USERNAME)
          and password = :P7_CURRENT_PASSWORD;
      return (true);
    exception
      when no_data_found then
        return (false);
    end;
    This code works fine when the password is stored without encryption, but it displays error, after encryption

    because the password entered is simply password and not encrypted if the two are different even if the user enters the correct password.

    Please tel me how encrypt the entered password to compare with the encrypted password.

    Thank you
    Kind regards
    gurujothi.

    Hi guru,.

    When you say comparing it is obvious that both must be in the same format, so either you have to compare both encrypted or not encrypted.

    Do you have an example on apex.oracle.com?

    Thank you

  • How to compare the 2 versions of the same document in Pages?

    How to compare the 2 versions of the same document on Pages?

    There is no OS X Visual tool which can open two Pages document and show the differences between them - other than the human eye.

    What information are you interested in identify as different between the two documents? What specific version of Pages?

  • Satellite A110-260 - how to remove the BIOS password

    Hello

    I have a password for the Toshiba Satellite A110-260, but I can't reset the password of the battery

    Please help me!

    How to reset the bios password

    You cannot remove the BIOS password. Something like that is not possible on Toshiba laptops.
    A special procedure is required and this can be done ONLY by a (certified partner) ASP.

    So my advice is to contact the ASP in your country and ask for help!

  • Compaq mini 110 [redacted]: how to reset the bios password...

    How to reset the bios password...

    Hello

    The password screen, press enter 3 times and you will receive a 'code to stop' - enter this code on the site below.

    https://BIOS-PW.org/

    Kind regards

    DP - K

  • How to recover the bios password hp mini 110-1144NR cnu938553m

    Help, please

    Need help how to recover the bios password hp mini 110-1144NR

    Series # cnu938553m

    Hello

    What is the code stopped? Please try (all in small character):

    e9lofuqqf4 (3rd tank is a tiny character of the letter L).

    Kind regards.

  • How to configure the LDAP connector in windows server 2012 R2 Active Directory?

    How to configure the LDAP connector in windows server 2012 R2 Active Directory?

    Hello

    Please post your question in Server TechNet Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • How to disable the administrator password

    Need to know how to disable the adminastrator password

    Go to control panel, user accounts.

    You will see the options there.  You must be logged on to this account and/or have the available password of course.
    FYI-for your own PC security, it is often recommended that you keep a password for the user account at the time you need, but for everyday use, you use a standard user account.
  • How to remove the shared password for XP?

    I have a XP computer on my network. I am connected to a Windows 7 computer through it. Now instead of asking the password, when I click on the computer icon, it automatically opens the computer windows 7. How to clear the saved password?

    If the user of the XP machine is connected to Windows XP with the same user name and password as a valid user on the Windows 7 computer, then it will automatically authenticate without asking for a password.

    HTH,
    JW

  • How to compare the content of two Wordpad / documents notebook without reading them line by line?

    How to compare the content of two Wordpad / documents notebook without reading them line by line?

    Hello

    Without this feature is included in the operating system.

    However, you can use your favorite search engine to look for software that needs to perform these tasks.

    WARNING of THIRD PARTY SOFTWARE: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    Hope this information helps.

  • How to recover the "administrator password" on laptop Vista Home Premium?

    Hello, someone knows how to recover the "Administrator password" window? I have a Vista Home Premium laptop. I will appreciate any suggestion. Thank you very much.

    Hello

    This is the information from microsoft on you assist on passwords

    http://support.Microsoft.com/kb/940765

    except that we cannot help you

    read this microsoft's policy NOT to provide assistance to crack passwords:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-security/keeping-passwords-secure-Microsoft-policy-on/a5839e41-b80e-48c9-9d46-414bc8a8d9d4

  • Lost admin password, how to retrieve the current password to change it?

    I forgot my Admin password, I connect on my laptop using the scanner print finger all the time and when I try to change the password for Admin it ask the password which I do not remember. How to retrieve the current password and change it in Windows 7 Home premium?

    It's a laptop Acer 5738 G

    You can change your current password as follows:

    1. click on start.
    2. type the three letters cmd in the search box.
    3. press on Ctrl + Shift + Enter
    4. click on "run as Administrator".
    5. type the following command and press ENTER after each:
    NET user "user %%nom" 123456

    Now the password is 123456. While dealing with accounts and passwords: having a single admin account on a PC is about the same as having a unique key for your car. What happens if you lose? He lost? Break it? A robust Windows Setup requires at least the following:

    • Two admin accounts fully tested, with their passwords to record on paper.
    • A password key file. Click Start / Help, then search for help on "password". Follow the instructions to create a key on your USB flash drive file so that you'll never find yourself in this uncomfortable situation.
  • HP Compaq Mini 700EP - how to reset the bios password?

    Help, how to remove the bios password, so I can boot the system.

    Thank you

    Hello

    You are welcome

    Enter: e9luq11odn (3rd character is a lowercase L)

    Kind regards

    DP - K

  • How to jump the connection password re-boot...

    How to ignore the connection password re-boot while it self-connections me?

    In XP, TweakUI was a setting to do this, but it comes to Windows 7?

    There is an option for her, but it's pretty hidden, because it leaves your unsecured computer (anyone who circulated happens not only to all your files, but they can also get to any Web page you visited, like facebook or even your bank).

    If you are sure you want to do, here's how:
    1 - Press Windows-R to open the run, and then type the following command and press ENTER: control userpasswords2
    2 - clear the check box at the top (users must enter a password...) and then click OK
    3. set the default account, you want to connect to from the context menu that appears, and then click OK once more
    All together.
  • How to recover the lost password windows 7

    original title: password windows 7

    How to recover the lost password windows 7

    Hi Karrah,

    You can try to check if you have any other user account on the computer and try to connect to this account and change the password for your user account.

    You can also access the link below to learn more about Microsoft's strategy concerning lost or forgotten passwords.

    http://support.Microsoft.com/kb/189126

    If you do not have any other user account on the computer, you may need to back up your data and contact the manufacturer of the computer for restore to factory settings or reinstall the operating system.

    I hope this helps.

    Thank you and best regards,

     

    Srinivas R Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

Maybe you are looking for

  • Is is possible to retrieve a deleted phone number?

    I have an iPhone 6s, and I just got a robocall.  Without thinking, I deleted the number. Is it possible to retrieve this number? This number isn't in my contacts. This number never received before.

  • On the meeting

    I want to meet soon. But I do not know how to approach them. And I have no understanding. If you give me advice?

  • I lost my disc of windows 7 Home premium and my phone asks me to insert

    My phone asks me to insert the disc from my windows 7, but I lost. I have the product key I can download windows 7 Home premium and burn it to a disk. Or what should I do...

  • Re-edition of MSWMM files... HOW?

    I creator of film to windows Vista... edited several and unfortunately, hit publish... now, they are. MSWMM files.   I can not open them or modify the code... I would like to re - edit these files... but I can't open them to all the windowsmovie Make

  • Secret tapping (while only typed text will not appear in the EditField)

    I'm a rookie developer, then I would be happy if you can also provide an example of code for my problem. So I make an app that has say EditField EditField and while typing, when the user holds the LEFT SHIFT, the characters are typed are stored in th