Skip to content

Commit

Permalink
remove inmemory config
Browse files Browse the repository at this point in the history
  • Loading branch information
lor6 committed Mar 14, 2017
1 parent 2bf6a71 commit 35acd2c
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 120 deletions.
13 changes: 0 additions & 13 deletions spring-security-oauth-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
Expand Down Expand Up @@ -162,14 +157,6 @@
<profile>
<id>mvc</id>
<build>
<resources>
<resource>
<directory>main/resources</directory>
<excludes>
<exclude>schema.sql</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package org.baeldung.mvc.config;
package org.baeldung.config;

import java.util.ArrayList;
import java.util.List;

import org.baeldung.model.Employee;
import org.springframework.http.HttpStatus;
import org.baeldung.mvc.model.Employee;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung.mvc.config;
package org.baeldung.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
package org.baeldung.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

@Configuration
@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

@Autowired
public void globalUserDetails(final AuthenticationManagerBuilder auth) throws Exception {
// @formatter:off
auth.inMemoryAuthentication().withUser("john").password("123").roles("USER").and().withUser("tom")
.password("111").roles("ADMIN");
.password("111").roles("ADMIN")
.and().withUser("user1").password("pass").roles("USER")
.and().withUser("admin").password("nimda").roles("ADMIN");
// @formatter:on
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung.mvc.model;
package org.baeldung.model;

public class Employee {
private String email;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

import org.springframework.boot.json.JacksonJsonParser;
import org.springframework.boot.test.context.SpringBootTest;
import org.baeldung.mvc.config.AuthorizationServerMvcApplication;
import org.baeldung.config.AuthorizationServerApplication;

@RunWith(SpringRunner.class)
@WebAppConfiguration
@SpringBootTest(classes = AuthorizationServerMvcApplication.class)
@SpringBootTest(classes = AuthorizationServerApplication.class)
public class OAuthMvcTest {

@Autowired
Expand All @@ -37,7 +37,7 @@ public class OAuthMvcTest {

private MockMvc mockMvc;

private static final String CLIENT_ID = "sampleMvcClient";
private static final String CLIENT_ID = "fooClientIdPassword";
private static final String CLIENT_SECRET = "secret";

private static final String CONTENT_TYPE = "application/json;charset=UTF-8";
Expand Down

0 comments on commit 35acd2c

Please sign in to comment.