Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APIM Public] Validate the auth fail massege with the resourceBundle #7216

Open
wants to merge 1 commit into
base: 1.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,4 @@ error.user.not.found.smsotp=User not found in the directory. Cannot proceed furt
authenticate.button=Authenticate
please.enter.code=Please enter the code!
enter.phone.number=Enter Your Mobile Phone Number
federated.login=Federated Login
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,4 @@ error.user.not.found.smsotp=Utilisateur introuvable dans l'annuaire. Impossible
authenticate.button=S'uthentifier
please.enter.code=Veuillez entrer le code !
enter.phone.number=Entrez votre numéro de téléphone portable
federated.login=Connexion f�d�r�e
14 changes: 11 additions & 3 deletions apps/authentication-portal/src/main/webapp/domain.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,22 @@

<%
String domainUnknown = AuthenticationEndpointUtil.i18n(resourceBundle, "domain.unknown");
String errorMessage = AuthenticationEndpointUtil.i18n(resourceBundle, "authentication.failed");
String errorMessage = AuthenticationEndpointUtil.i18n(resourceBundle, "authentication.failed.please.retry");
boolean loginFailed = false;
if (Boolean.parseBoolean(request.getParameter("authFailure"))) {
loginFailed = true;
if (request.getParameter("authFailureMsg") != null) {
errorMessage = request.getParameter("authFailureMsg");
String error = Encode.forJava(request.getParameter("authFailureMsg"));
/*
* Only allowing error messages defined in the resourceBundle.
* AuthenticationEndpointUtil.i18n() will return the value of the provided key if the key is found
* in the resourceBundle. If the key is not found, it will return the key itself.
*/
if (!error.equalsIgnoreCase(AuthenticationEndpointUtil.i18n(resourceBundle, error))) {
errorMessage = AuthenticationEndpointUtil.i18n(resourceBundle, error);
}

if (domainUnknown.equalsIgnoreCase(errorMessage)) {
if (domainUnknown.equalsIgnoreCase(error)) {
errorMessage = AuthenticationEndpointUtil.i18n(resourceBundle, "domain.cannot.be.identified");
}
}
Expand Down