Skip to content

Commit

Permalink
Merge pull request #6889 from wso2/improve-login-jsp-custom-local-aut…
Browse files Browse the repository at this point in the history
…h-support

Improve login.jsp file to handle custom local authenticators
  • Loading branch information
sadilchamishka authored Sep 12, 2024
2 parents 1278056 + 8f8f890 commit 49b8f0c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-paws-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/identity-apps-core": patch
---

Improve login.jsp to handle custom local authenticators
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@
boolean hasLocalLoginOptions = false;
boolean isBackChannelBasicAuth = false;
List<String> localAuthenticatorNames = new ArrayList<String>();
List<String> registeredLocalAuthenticators = Arrays.asList(
BACKUP_CODE_AUTHENTICATOR, TOTP_AUTHENTICATOR, EMAIL_OTP_AUTHENTICATOR,
MAGIC_LINK_AUTHENTICATOR,SMS_OTP_AUTHENTICATOR,OPEN_ID_AUTHENTICATOR,
IDENTIFIER_EXECUTOR,JWT_BASIC_AUTHENTICATOR,BASIC_AUTHENTICATOR,
IWA_AUTHENTICATOR,X509_CERTIFICATE_AUTHENTICATOR,FIDO_AUTHENTICATOR
);
if (idpAuthenticatorMapping != null && idpAuthenticatorMapping.get(Constants.RESIDENT_IDP_RESERVED_NAME) != null) {
String authList = idpAuthenticatorMapping.get(Constants.RESIDENT_IDP_RESERVED_NAME);
Expand Down Expand Up @@ -1052,6 +1059,37 @@
<br>
<%
}
for (String localAuthenticator : localAuthenticatorNames) {
if (registeredLocalAuthenticators.contains(localAuthenticator)) {
continue;
}
%>
<div class="social-login blurring social-dimmer">
<div class="field">
<button
type="button"
id="icon-<%=iconId%>"
class="ui button secondary"
data-testid="login-page-sign-in-with-<%=localAuthenticator%>"
onclick="handleNoDomain(this,
'<%=Encode.forJavaScriptAttribute(Encode.forUriComponent(idpEntry.getKey()))%>',
'<%=localAuthenticator%>')"
>
<img
class="ui image"
src="libs/themes/default/assets/images/authenticators/<%=localAuthenticator%>.svg"
alt="<%=localAuthenticator%> Logo"
role="presentation">
<span>
<%=AuthenticationEndpointUtil.i18n(resourceBundle, "sign.in.with")%>
<%=localAuthenticator%>
</span>
</button>
</div>
</div>
<br>
<%
}
}
}
if (isOrgEnterpriseUserLogin) { %>
Expand Down

0 comments on commit 49b8f0c

Please sign in to comment.