Skip to content

Commit

Permalink
Bugfix for impersonation
Browse files Browse the repository at this point in the history
As a superuser you can impersonate other institution admins. However in
the overview for MFA and secureID the current IdP was used and not the
impersonated IdP.
  • Loading branch information
oharsta committed Jan 31, 2024
1 parent a64b053 commit 9c042bb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dashboard-gui/src/javascripts/components/app_list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export default function AppList({apps, currentUser, facets: remoteFacets, connec
})
if (!currentUser.guest) {
facets.push(strongAuthenticationFacet)
const mfaEntities = currentUser.currentIdp.mfaEntities
const mfaEntities = currentUser.getCurrentIdp().mfaEntities
const mfaLevels = [
'https://refeds.org/profile/mfa',
'http://schemas.microsoft.com/claims/multipleauthn'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export default function AuthorizationPolicyDetail({ app, type, onPolicyChange })
if (e.response && e.response.json) {
e.response.json().then((json) => {
let message = 'error'
if (json.exception && json.exception.indexOf('PolicyNameNotUniqueException') > 0) {
if (json.exception && (
json.exception.indexOf('PolicyNameNotUniqueException') > 0 ||
json.exception.indexOf('DuplicateEntityIdException') > 0)) {
message = I18n.t('policies.policy_name_not_unique_exception')
}
setFlash(message, 'error')
Expand Down
2 changes: 1 addition & 1 deletion dashboard-gui/src/javascripts/pages/mfa.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ConnectModalContainer from "../components/connect_modal_container";

export default function MFA({app}) {
const {currentUser} = useContext(CurrentUserContext)
const mfaEntity = (currentUser.currentIdp.mfaEntities || []).find((e) => e.name === app.spEntityId)
const mfaEntity = (currentUser.getCurrentIdp().mfaEntities || []).find((e) => e.name === app.spEntityId)
const initialAuthnContextLevel = mfaEntity && mfaEntity.level || ''
const [authnContextLevel, setAuthnContextLevel] = useState(initialAuthnContextLevel)
const [showStepUpModal, setShowStepUpModal] = useState(false)
Expand Down
2 changes: 1 addition & 1 deletion dashboard-gui/src/javascripts/pages/stats.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ class Stats extends React.Component {
const spSelected = sp !== this.allServiceProviderOption.value
const noResult = (data.length === 1 && data[0] === 'no_results') || (loaded && data.length === 0)
const results = loaded && data.length > 0 && !noResult
const idp = this.context.currentUser.currentIdp
const idp = this.context.currentUser.getCurrentIdp()
const identityProvidersDict = {}
identityProvidersDict[idp.id] =
I18n.locale === 'en'
Expand Down
2 changes: 1 addition & 1 deletion dashboard-gui/src/javascripts/pages/surf_secure_id.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ConnectModalContainer from "../components/connect_modal_container";

export default function SurfSecureID({ app }) {
const { currentUser } = useContext(CurrentUserContext)
const stepEntity = (currentUser.currentIdp.stepupEntities || []).find((e) => e.name === app.spEntityId)
const stepEntity = (currentUser.getCurrentIdp().stepupEntities || []).find((e) => e.name === app.spEntityId)
const initialLoaLevel = app.minimalLoaLevel || (stepEntity && stepEntity.level) || ''

const [loaLevel, setLoaLevel] = useState(initialLoaLevel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.google.common.base.MoreObjects;
import dashboard.domain.Action;
import dashboard.domain.Change;
import dashboard.domain.Settings;
import dashboard.manage.ChangeRequest;
import org.springframework.util.CollectionUtils;
Expand All @@ -11,7 +10,6 @@
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Objects;

import static com.google.common.base.Preconditions.checkNotNull;
import static dashboard.domain.Action.Type.*;
Expand All @@ -26,7 +24,9 @@ static SummaryAndDescription build(final Action action) {
final StringBuilder summary = new StringBuilder();

if (!CollectionUtils.isEmpty(action.getManageUrls())) {
description.append("A change request in manage has been created to merge this user request.See:\n" +
String changeRequestDescriiption = "A change request in manage has been created to merge this user request.";
String warning = action.getManageUrls().size() > 1 ? " NOTE: there are multiple Manage URL's." : "";
description.append(changeRequestDescriiption + warning + " See:\n" +
String.join("\n", action.getManageUrls()) + "\n\n");
}

Expand Down

0 comments on commit 9c042bb

Please sign in to comment.