Why is my MiitreId Spring Boot authentication returning anonymousUser?

I have adapted the code from here to call a MitreID OIDC server.

In my controller:

    public final String home(Principal p) {
    final String username = SecurityContextHolder.getContext().getAuthentication().getName();
...

returns `authorisedUser' as the name rather than the correct value. From similar questions, I have tried adding Principal as you can see.

I was thinking the authentication is failing but it is not throwing an error.

My application.properties is:

server.port=8080
oidc.clientId=anidthatisregisteredontheserver.
oidc.clientSecret=asecretthatisregisteredontheserver
oidc.accessTokenUri=http://myserver:8080/openid-connect-server-webapp/token
    oidc.userAuthorizationUri=http://myserver:8080/openid-connect-server-webapp/authorize
    oidc.redirectUri=http://localhost:8080/oidc/openid_connect_login
    oidc.issuer=http://myserver:8080/openid-connect-server-webapp/
    oidc.jwkUrl=http://myserver:8080/openid-connect-server-webapp/jwk

amd my security config:

@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
    @Autowired
    private OAuth2RestTemplate restTemplate;

    @Override
    public void configure(WebSecurity web) throws Exception {
        web.ignoring().antMatchers("/resources/**");
    }

    @Bean
    public OpenIdConnectFilter myFilter() {

        final OpenIdConnectFilter filter = new OpenIdConnectFilter("/openid_connect_login");
        filter.setRestTemplate(restTemplate);
        return filter;
    }

    @Override
    protected void configure(HttpSecurity http) throws Exception {

        // @formatter:off
        http
        .addFilterAfter(new OAuth2ClientContextFilter(), AbstractPreAuthenticatedProcessingFilter.class)
        .addFilterAfter(myFilter(), OAuth2ClientContextFilter.class)
        .httpBasic().authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/openid_connect_login"))
        .and()
        .authorizeRequests()
        .antMatchers("/","/index*").permitAll()
        .anyRequest().authenticated()
        ;

     // @formatter:on
    }
}

Most of the rest of the code is the same as the original, with 'google-login' replaced by 'openid_connect_login'.

So what am i doing wrong and how can I debug whether the authentication is happening correctly?

Messy pom.xml:

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>org.mitre</groupId>
    <artifactId>oidc</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>oidc</name>
    <description>Simple oidc app</description>
    <packaging>war</packaging>

    <properties>
        <java-version>1.8</java-version>
        <mitreid-connect-version>1.3.1</mitreid-connect-version>

<!--            <main.basedir>${basedir}/../..</main.basedir>
            <m2eclipse.wtp.contextRoot>/</m2eclipse.wtp.contextRoot> -->
        <spring-security-jwt.version>1.0.9.RELEASE</spring-security-jwt.version>
        <jwks-rsa.version>0.3.0</jwks-rsa.version>
    </properties>
    <build>
        <finalName>oidc</finalName>

        <resources>
            <resource>
                <directory>${basedir}/src/main/webapp</directory>
                <includes>
                    <include>**/**</include>
                </includes>
            </resource>
            <resource>
            <directory>src/main/webapp</directory>
          </resource>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <includes>
                    <include>**/**</include>
                </includes>
            </resource>
        </resources> 
        <plugins>
             <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.1.2.RELEASE</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>${start-class}</mainClass>
                    <!-- this is necessary as we're not using the Boot parent -->
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-war-plugin</artifactId>

<!--                <configuration>
                    <warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration> -->
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
<!--        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency> -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mitre</groupId>
            <artifactId>openid-connect-parent</artifactId>
            <version>${mitreid-connect-version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.mitre</groupId>
            <artifactId>openid-connect-client</artifactId>
            <version>1.3.1</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
             <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
              </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
                        <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.9.2</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.9.2</version>
            <scope>compile</scope>
        </dependency>
<!--        https://stackoverflow.com/questions/33207448/spring-security-in-spring-boot -->     
        <dependency>
          <groupId>org.springframework.security</groupId>
          <artifactId>spring-security-config</artifactId>
        </dependency>
                <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-jwt</artifactId>
            <version>${spring-security-jwt.version}</version>
        </dependency>

        <dependency>
            <groupId>com.auth0</groupId>
            <artifactId>jwks-rsa</artifactId>
            <version>${jwks-rsa.version}</version>
        </dependency>
    </dependencies>
</project>

UPDATE: removed .antMatchers("/","/index*").permitAll() and now it seems to call the server but user returns null.