apiVersion: v1
kind: ConfigMap
metadata:
  name: mp-demo-poi-120-flexible-auth
  namespace: mp-demo
data:
  120-flexible-auth.xml: |-
    <s:search xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
              xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
              xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
              xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
              xmlns:s="http://midpoint.evolveum.com/xml/ns/public/model/scripting-3"
              xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
              xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
              xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3">
        <s:options>
            <option>
                <options>
                    <raw>true</raw>
                </options>
            </option>
        </s:options>
        <s:type>c:SecurityPolicyType</s:type>
        <s:action>
            <s:type>modify</s:type>
            <s:parameter>
                <s:name>delta</s:name>
                <c:value>
                    <s:itemDelta>
                        <t:modificationType>add</t:modificationType>
                        <t:path>authentication</t:path>
                        <t:value>
                            <modules>
                                <loginForm>
                                    <name>internalLoginForm</name>
                                    <description>Internal username/password authentication, default user password, login form</description>
                                </loginForm>
                                <httpBasic>
                                    <name>internalBasic</name>
                                    <description>Internal username/password authentication, using HTTP basic auth</description>
                                </httpBasic>
                            </modules>
                            <sequence>
                                <name>admin-gui-emergency</name>
                                <description>Special GUI authentication sequence that is using just the internal user password.</description>
                                <channel>
                                    <channelId>http://midpoint.evolveum.com/xml/ns/public/common/channels-3#user</channelId>
                                    <default>false</default>
                                    <urlSuffix>emergency</urlSuffix>
                                </channel>
                                <requireAssignmentTarget oid="00000000-0000-0000-0000-000000000004" relation="org:default" type="c:RoleType">
                                </requireAssignmentTarget>
                                <module>
                                    <name>internalLoginForm</name>
                                    <order>30</order>
                                    <necessity>sufficient</necessity>
                                </module>
                            </sequence>
                            <sequence>
                                <name>admin-gui-default</name>
                                <description>Default GUI authentication sequence</description>
                                <channel>
                                    <channelId>http://midpoint.evolveum.com/xml/ns/public/common/channels-3#user</channelId>
                                    <default>true</default>
                                    <urlSuffix>default</urlSuffix>
                                </channel>
                                <module>
                                    <name>internalLoginForm</name>
                                    <order>30</order>
                                    <necessity>sufficient</necessity>
                                </module>
                            </sequence>
                            <sequence>
                                <name>rest</name>
                                <description>Authentication sequence for REST service.</description>
                                <channel>
                                    <channelId>http://midpoint.evolveum.com/xml/ns/public/common/channels-3#rest</channelId>
                                    <default>true</default>
                                    <urlSuffix>rest-default</urlSuffix>
                                </channel>
                                <module>
                                    <name>internalBasic</name>
                                    <order>10</order>
                                    <necessity>sufficient</necessity>
                                </module>
                            </sequence>
                            <sequence>
                                <name>actuator</name>
                                <description>Authentication sequence for actuator.</description>
                                <channel>
                                    <channelId>http://midpoint.evolveum.com/xml/ns/public/common/channels-3#actuator</channelId>
                                    <default>true</default>
                                    <urlSuffix>actuator-default</urlSuffix>
                                </channel>
                                <module>
                                    <name>internalBasic</name>
                                    <order>10</order>
                                    <necessity>sufficient</necessity>
                                </module>
                            </sequence>
                            <ignoredLocalPath>/actuator</ignoredLocalPath>
                            <ignoredLocalPath>/actuator/health</ignoredLocalPath>
                        </t:value>
                    </s:itemDelta>
                </c:value>
            </s:parameter>
        </s:action>
    </s:search>
