Skip to content

Commit

Permalink
chore: show terms and conditions on every login if enabled (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjferguson21 authored Jul 17, 2024
1 parent 8d3fe5f commit 035e519
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void authenticate(final AuthenticationFlowContext context) {

if (groupsAttribute == null || groupsAttribute.isEmpty()) {
LOGGER.infof("No groups detected for client %s", client.getName());
context.success();
success(context, user);
return;
}

Expand All @@ -55,7 +55,7 @@ public void authenticate(final AuthenticationFlowContext context) {
if (group.isPresent()) {
if (isMemberOfExactGroup(user, group.get())) {
LOGGER.infof("User %s is authorized for group %s", user.getUsername(), groupName);
context.success();
success(context, user);
return;
}
foundGroup = true;
Expand Down Expand Up @@ -109,6 +109,11 @@ private String buildGroupPath(GroupModel group) {
return path.toString();
}

private void success(final AuthenticationFlowContext context, final UserModel user) {
user.addRequiredAction("TERMS_AND_CONDITIONS");
context.success();
}

private boolean isMemberOfExactGroup(UserModel user, GroupModel group) {
return user.getGroupsStream()
.anyMatch(userGroup -> buildGroupPath(userGroup).equals(buildGroupPath(group)));
Expand Down
12 changes: 6 additions & 6 deletions src/theme/login/terms.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@
<li>This IS includes security measures (e.g., authentication and access controls) to protect USG
interests--not for your personal benefit or privacy.
</li>
<li>NOTICE: There is the potential that information presented and exported from the Platform One
<li>NOTICE: There is the potential that information presented and exported from the UDS Platform
contains FOUO or Controlled Unclassified Information (CUI). It is the responsibility of all
users to ensure information extracted from Platform One is appropriately marked and properly
users to ensure information extracted from UDS Platform is appropriately marked and properly
safeguarded. If you are not sure of the safeguards necessary for the information, contact your
functional lead or Information Security Officer.
</li>
<li>As a user of this IS, you may have access to USG’s Platform One. Third-party software publishers
<li>As a user of this IS, you may have access to USG’s UDS Platform. Third-party software publishers
(“Vendors”) provide proprietary software, applications, and/or source code (including any proprietary
data made available through such third-party software) (collectively, “Third-Party Software”) to the USG
solely in order for the USG to harden such Third-Party Software and make such hardened versions of the
Third Party Software available to users of Platform One. In the event you use the IS
(including Platform One) to access, download, execute, display and/or otherwise use (collectively, “Use”)
such Third-Party Software, by Using the IS (including Platform One) and/or such Third-Party Software,
Third Party Software available to users of UDS Platform. In the event you use the IS
(including UDS Platform) to access, download, execute, display and/or otherwise use (collectively, “Use”)
such Third-Party Software, by Using the IS (including UDS Platform) and/or such Third-Party Software,
you, on behalf of your organization, hereby agree that all Use of such Third-Party Software is governed by
the Vendor’s end user license agreement (“Vendor EULA”), which may be enforced directly by Vendor and/or USG.
If you do not agree to the entirety of the applicable vendor eula, you are prohibited from using all or any
Expand Down

0 comments on commit 035e519

Please sign in to comment.