Was testing a hardcoded endpoint for my Calorie management API. I hardcoded some users in my UserService.java and mapped them in my UserController to the /users url.
With Tomcat running on localhost:8080 I assumed that when I go to localhost:8080/users I would be able to see the users I added
Instead it takes me to a login page created by spring. Even though I can login with 'user' as the username and the generated password is in the build I do not want this to be implemented as I will be doing my own authentication in the future.
When going through the build file information the login page is connected to this information:
2020-04-23 11:22:38.314 INFO 1548 --- [ restartedMain] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@150d0d25, org.springframework.security.web.context.SecurityContextPersistenceFilter@7c82be70, org.springframework.security.web.header.HeaderWriterFilter@3258c818, org.springframework.security.web.csrf.CsrfFilter@18dd2f3, org.springframework.security.web.authentication.logout.LogoutFilter@336c3f7a, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@641198db, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@7b7cd5a, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@1c801106, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@4b9896a8, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@77927c43, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@6861d187, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@d43945e, org.springframework.security.web.session.SessionManagementFilter@19cc57e5, org.springframework.security.web.access.ExceptionTranslationFilter@7b984a77, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@2521604c]
I have no dependency that is related to security or authentication? is this coming from another dependency that has this information. Ive attached my pom.xl
<?xml version="1.0" encoding="UTF-8"?>
<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 https://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.3.0.M4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.MS3.bootcamp</groupId>
<artifactId>healthDiary</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>healthDiary</name>
<description>Bootcamp project for MS3</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gurux</groupId>
<artifactId>gurux.dlms</artifactId>
<version>4.0.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
</project>