In this Oracle APEX Tutorial post, We will explore about the password validation in Oracle APEX with example.
As we know that most of the websites have their own password policy. This topic especially for beginners because whenever you create a signup or registration page you should knowledge of password policy. If you know about the password policy then you can easily implement password validation in Oracle APEX.
Password Validation in Oracle APEX with Example
Before the start, we give you a suggestion that you should learn REGEXP_LIKE first then started this implementation or if you already know about REGEXP_LIKE then you can easily understand Password Validation implementation.
In this implementation, we follow some patterns for password validation in Oracle APEX.
- ^.*[0-9]
- ^.*[a-z]
- ^.*[A-Z]
- ^.*[!@#$%^&*()_]
Now we are explaining the above regular expressions pattern.
- ^ This pattern used for Matches the beginning of the string.
- . This pattern used for Matches any character except NULL.
- * This pattern used for Matches zero or more occurrence.
- [] This pattern used for the specified matching list with the help of this pattern you can match any of the characters in the list.
- c This pattern used for matches case-sensitive.
- Password Length must be 8 characters and not more than 15 characters.
- The password must have one numeric value.
- The password must have one LowerCase.
- The password must have one UpperCase.
- The password must have one special character.
BEGIN
IF 8 <= LENGTH(:P22_PASSWORD) AND LENGTH(:P22_PASSWORD) <= 15 THEN
IF REGEXP_LIKE(:P22_PASSWORD, '^.*[0-9]') THEN
IF REGEXP_LIKE(:P22_PASSWORD, '^.*[a-z]', 'c') THEN
IF REGEXP_LIKE(:P22_PASSWORD, '^.*[A-Z]', 'c') THEN
IF REGEXP_LIKE(:P22_PASSWORD, '^.*[!@#$%^&*()_]', 'c') THEN
RETURN '';
ELSE
RETURN 'Password has not one special character';
END IF;
ELSE
RETURN 'Password has not one UpperCase';
END IF;
ELSE
RETURN 'Password has not one LowerCase';
END IF;
ELSE
RETURN 'Password has not a numeric value';
END IF;
ELSE
RETURN 'Password Length Must be min 8 char and max 15 char
and your password length is'||' '||LENGTH(:P22_PASSWORD);
END IF;
END;
4 Comments
very nice explanation
ReplyDeleteRETURN 'Password has not one LowerCase';
ReplyDeletenot work
it's work check with demo url
DeleteHi Javainhand,
ReplyDeleteAny chance for testing this out on 21.1 Ive tried it and it doesn't seem to work like you are showing it in the demo, its the perfect bit of code that I need right now, if you can help that would be brilliant, thank you in advance.
If you have any doubts, Please let me know