Skip to content

Commit

Permalink
MID-7687: changing name of attribute for focus behavior update after …
Browse files Browse the repository at this point in the history
…login
  • Loading branch information
skublik committed Feb 28, 2022
1 parent 0bc2f3a commit 426a3de
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,11 @@
<xsd:appinfo>
<a:container/>
<a:since>4.1</a:since>
<a:schemaMigration>
<a:element>tns:network</a:element>
<a:version>4.5</a:version>
<a:operation>removed</a:operation>
</a:schemaMigration>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexContent>
Expand Down Expand Up @@ -515,6 +520,37 @@
<xsd:appinfo>
<a:container/>
<a:since>4.1</a:since>
<a:schemaMigration>
<a:element>tns:defaultDigest</a:element>
<a:version>4.5</a:version>
<a:operation>removed</a:operation>
</a:schemaMigration>
<a:schemaMigration>
<a:element>tns:wantAssertionsSigned</a:element>
<a:version>4.5</a:version>
<a:operation>removed</a:operation>
</a:schemaMigration>
<a:schemaMigration>
<a:element>tns:singleLogoutEnabled</a:element>
<a:version>4.5</a:version>
<a:operation>removed</a:operation>
</a:schemaMigration>
<a:schemaMigration>
<a:element>tns:nameId</a:element>
<a:version>4.5</a:version>
<a:operation>removed</a:operation>
</a:schemaMigration>
<a:schemaMigration>
<a:element>tns:provider</a:element>
<a:version>4.5</a:version>
<a:operation>moved</a:operation>
<a:replacement>tns:identityProvider</a:replacement>
</a:schemaMigration>
<a:schemaMigration>
<a:element>tns:metadata</a:element>
<a:version>4.5</a:version>
<a:operation>removed</a:operation>
</a:schemaMigration>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
Expand Down Expand Up @@ -700,6 +736,11 @@
<xsd:appinfo>
<a:container/>
<a:since>4.5</a:since>
<a:schemaMigration>
<a:element>tns:name</a:element>
<a:version>4.5</a:version>
<a:operation>removed</a:operation>
</a:schemaMigration>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
Expand Down Expand Up @@ -770,6 +811,21 @@
<xsd:appinfo>
<a:container/>
<a:since>4.1</a:since>
<a:schemaMigration>
<a:element>tns:alias</a:element>
<a:version>4.5</a:version>
<a:operation>removed</a:operation>
</a:schemaMigration>
<a:schemaMigration>
<a:element>tns:skipSslValidation</a:element>
<a:version>4.5</a:version>
<a:operation>removed</a:operation>
</a:schemaMigration>
<a:schemaMigration>
<a:element>tns:metadataTrustCheck</a:element>
<a:version>4.5</a:version>
<a:operation>removed</a:operation>
</a:schemaMigration>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
Expand Down Expand Up @@ -1313,7 +1369,7 @@
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="updatingFocusBehavior" type="tns:UpdatingFocusBehaviorType" minOccurs="0" maxOccurs="1">
<xsd:element name="focusBehaviorUpdate" type="tns:FocusBehaviorUpdateType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:appinfo>
<a:since>4.5</a:since>
Expand All @@ -1328,7 +1384,7 @@
</xsd:sequence>
</xsd:complexType>

<xsd:simpleType name="UpdatingFocusBehaviorType">
<xsd:simpleType name="FocusBehaviorUpdateType">
<xsd:annotation>
<xsd:documentation>
Option for updating focus authentication behaviour attributes. We can enable/disable updating of focus
Expand Down Expand Up @@ -1361,15 +1417,15 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="onlyUnsuccessfulLogin">
<xsd:enumeration value="failureOnly">
<xsd:annotation>
<xsd:documentation>
Authentication behaviour attributes will be updated when login failed and when login will be success,
but previous login was unsuccessful and midPoint need update attributes as is number of login fails
but previous login was failed and midPoint need update attributes as is number of login fails
and lockout state.
</xsd:documentation>
<xsd:appinfo>
<jaxb:typesafeEnumMember name="ONLY_UNSUCCESSFUL_LOGIN"/>
<jaxb:typesafeEnumMember name="FAILURE_ONLY"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:enumeration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,12 +590,12 @@ public static void doRemoteFilter(ServletRequest req, ServletResponse res, Filte
public static boolean isAllowUpdatingAuthBehavior(boolean isUpdatingDuringUnsuccessfulLogin){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication instanceof MidpointAuthentication && ((MidpointAuthentication)authentication).getSequence() != null) {
UpdatingFocusBehaviorType actualOption = ((MidpointAuthentication) authentication).getSequence().getUpdatingFocusBehavior();
if (actualOption == null && UpdatingFocusBehaviorType.ENABLED.equals(actualOption)) {
FocusBehaviorUpdateType actualOption = ((MidpointAuthentication) authentication).getSequence().getFocusBehaviorUpdate();
if (actualOption == null && FocusBehaviorUpdateType.ENABLED.equals(actualOption)) {
return true;
} else if (UpdatingFocusBehaviorType.DISABLED.equals(actualOption)) {
} else if (FocusBehaviorUpdateType.DISABLED.equals(actualOption)) {
return false;
} else if (UpdatingFocusBehaviorType.ONLY_UNSUCCESSFUL_LOGIN.equals(actualOption)) {
} else if (FocusBehaviorUpdateType.FAILURE_ONLY.equals(actualOption)) {
return isUpdatingDuringUnsuccessfulLogin;
}
}
Expand Down

0 comments on commit 426a3de

Please sign in to comment.