Skip to content

Commit

Permalink
Added Spring Security using the default behavior except for the gener…
Browse files Browse the repository at this point in the history
…ation of username and password.
  • Loading branch information
rommelmedina committed Mar 25, 2020
1 parent 2008155 commit 8ab9ce6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
17 changes: 17 additions & 0 deletions nbactions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath com.medinar.spring.springbootsecurity.SpringBootSecurityApplication</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
</actions>
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.medinar.spring.springbootsecurity.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
*
* @author rommelmedina
*/
@RestController
public class HomeController {

@GetMapping("/")
public String home(){
return "<h1>Welcome</h1>";
}
}
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@

spring.security.user.name=foo
spring.security.user.password=foo

0 comments on commit 8ab9ce6

Please sign in to comment.