use of com.evolveum.midpoint.xml.ns._public.common.common_3.AuthenticationSequenceType in project midpoint by Evolveum.
the class TestAuthSequenceUtil method getSequences.
private List<AuthenticationSequenceType> getSequences() {
List<AuthenticationSequenceType> sequences = new ArrayList<>();
AuthenticationSequenceType sequence = new AuthenticationSequenceType();
sequence.setName("sequence1");
sequence.getNodeGroup().add(getReference("1"));
sequence.setChannel(getChannel("gui1"));
sequences.add(sequence);
sequence = new AuthenticationSequenceType();
sequence.setName("sequence2");
sequence.getNodeGroup().add(getReference("1"));
sequence.getNodeGroup().add(getReference("2"));
sequence.setChannel(getChannel("gui2"));
sequences.add(sequence);
sequence = new AuthenticationSequenceType();
sequence.setName("sequence3");
sequence.setChannel(getChannel("gui3"));
sequences.add(sequence);
return sequences;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AuthenticationSequenceType in project midpoint by Evolveum.
the class AbstractPageLogin method getSequenceName.
private String getSequenceName() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication instanceof MidpointAuthentication) {
MidpointAuthentication mpAuthentication = (MidpointAuthentication) authentication;
AuthenticationSequenceType sequence = mpAuthentication.getSequence();
if (sequence != null && sequence.getChannel() != null && !Boolean.TRUE.equals(sequence.getChannel().isDefault()) && SecurityPolicyUtil.DEFAULT_CHANNEL.equals(sequence.getChannel().getChannelId())) {
return sequence.getDisplayName() != null ? sequence.getDisplayName() : sequence.getName();
}
}
return null;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AuthenticationSequenceType in project midpoint by Evolveum.
the class TestAuthSequenceUtil method TestGetSequenceByEmptyNodeGroups.
@Test
public void TestGetSequenceByEmptyNodeGroups() {
AuthenticationsPolicyType authenticationPolicy = new AuthenticationsPolicyType();
authenticationPolicy.getSequence().addAll(getSequences());
List<AuthenticationSequenceType> sequences = AuthSequenceUtil.getSequencesForNodeGroups(new ArrayList<>(), authenticationPolicy);
assertEquals("Wrong sequences", 1, sequences.size());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AuthenticationSequenceType in project midpoint by Evolveum.
the class TestAuthSequenceUtil method TestGetSequenceByNodeGroups.
@Test
public void TestGetSequenceByNodeGroups() {
AuthenticationsPolicyType authenticationPolicy = new AuthenticationsPolicyType();
authenticationPolicy.getSequence().addAll(getSequences());
List<ObjectReferenceType> nodeGroups = new ArrayList<>();
nodeGroups.add(getReference("1"));
nodeGroups.add(getReference("2"));
List<AuthenticationSequenceType> sequences = AuthSequenceUtil.getSequencesForNodeGroups(nodeGroups, authenticationPolicy);
assertEquals("Wrong sequences", 3, sequences.size());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AuthenticationSequenceType in project midpoint by Evolveum.
the class TestAuthSequenceUtil method TestGetSequenceByNodeGroup.
@Test
public void TestGetSequenceByNodeGroup() {
AuthenticationsPolicyType authenticationPolicy = new AuthenticationsPolicyType();
authenticationPolicy.getSequence().addAll(getSequences());
List<ObjectReferenceType> nodeGroups = new ArrayList<>();
nodeGroups.add(getReference("2"));
List<AuthenticationSequenceType> sequences = AuthSequenceUtil.getSequencesForNodeGroups(nodeGroups, authenticationPolicy);
assertEquals("Wrong sequences", 2, sequences.size());
}
Aggregations