Skip to content

Commit

Permalink
fix(jans-auth-server): white/blank screen after device flow authn #4237
Browse files Browse the repository at this point in the history
… (#4243)

* fix(jans-auth-server): white/blank screen after device flow authn #4237

* fix: skip script identification when it's not needed  #4237
  • Loading branch information
yuriyz committed Mar 20, 2023
1 parent 794374b commit 89f744d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ public class AppConfiguration implements Configuration {
@DocProperty(description = "Enable/Disable redirect uris validation using regular expression", defaultValue = "false")
private Boolean redirectUrisRegexEnabled = false;

@DocProperty(description = "Enable/Disable usage of highest level script in case ACR script does not exist", defaultValue = "true")
private Boolean useHighestLevelScriptIfAcrScriptNotFound = true;
@DocProperty(description = "Enable/Disable usage of highest level script in case ACR script does not exist", defaultValue = "false")
private Boolean useHighestLevelScriptIfAcrScriptNotFound;

@DocProperty(description = "Boolean value specifying whether to enable user authentication filters")
private Boolean authenticationFiltersEnabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@
import io.jans.model.custom.script.conf.CustomScriptConfiguration;
import io.jans.orm.exception.EntryPersistenceException;
import io.jans.service.net.NetworkService;
import io.jans.util.OxConstants;
import io.jans.util.StringHelper;
import io.jans.util.ilocale.LocaleUtil;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.logging.log4j.util.Strings;
Expand Down Expand Up @@ -283,9 +285,11 @@ public void checkPermissionGranted() throws IOException {

String redirectTo = "/login.xhtml";

List<String> acrValuesList = sessionIdService.acrValuesList(this.acrValues);
boolean useExternalAuthenticator = externalAuthenticationService.isEnabled(AuthenticationScriptUsageType.INTERACTIVE);
if (useExternalAuthenticator) {
List<String> acrValuesList = sessionIdService.acrValuesList(this.acrValues);
boolean skipScript = acrValuesList.isEmpty() && BooleanUtils.isFalse(appConfiguration.getUseHighestLevelScriptIfAcrScriptNotFound())
&& OxConstants.SCRIPT_TYPE_INTERNAL_RESERVED_NAME.equalsIgnoreCase(defaultAuthenticationMode.getName());
if (useExternalAuthenticator && !skipScript) {
if (acrValuesList.isEmpty()) {
acrValuesList = Arrays.asList(defaultAuthenticationMode.getName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
"staticKid": "%(static_kid)s",
"forceOfflineAccessScopeToEnableRefreshToken" : false,
"redirectUrisRegexEnabled": false,
"useHighestLevelScriptIfAcrScriptNotFound": true,
"useHighestLevelScriptIfAcrScriptNotFound": false,
"blockWebviewAuthorizationEnabled": false,
"dateFormatterPatterns": {
"birthdate": "yyyy-MM-dd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@
"deviceAuthzTokenPollInterval": 5,
"deviceAuthzResponseTypeToProcessAuthz": "code",
"redirectUrisRegexEnabled": true,
"useHighestLevelScriptIfAcrScriptNotFound": true,
"useHighestLevelScriptIfAcrScriptNotFound": false,
"agamaConfiguration": {
"enabled": true,
"templatesPath": "/ftl",
Expand Down

0 comments on commit 89f744d

Please sign in to comment.