<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:security="http://www.springframework.org/schema/security"
       xsi:schemaLocation="http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"
       default-autowire="byType">

    <context:component-scan base-package="eu.dnetlib.openaire.user"/>
    <context:annotation-config></context:annotation-config>

    <bean id="entryPoint" class="eu.dnetlib.openaire.usermanagement.authorization.EntryPoint"/>
    <bean id="openIdConnectAuthenticationProvider" class="org.mitre.openid.connect.client.OIDCAuthenticationProvider">
    </bean>
    <security:authentication-manager alias="authenticationManager">
        <security:authentication-provider ref="openIdConnectAuthenticationProvider" />
    </security:authentication-manager>
    <security:global-method-security pre-post-annotations="enabled" secured-annotations="enabled" authentication-manager-ref="authenticationManager" />
    <security:http auto-config="true" use-expressions="true">
        <security:csrf disabled="true"/>
        <security:http-basic entry-point-ref="entryPoint"/>
        <!-- Permit all requests -->
        <security:intercept-url pattern="/**" access="permitAll" />
    </security:http>
    <context:annotation-config/>
</beans>
