forked from ucsb-cs56-webapps/ucsb-cs56-kitchen-ingredients
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ucsb-cs56-f18/master
Updating ZH branch
- Loading branch information
Showing
10 changed files
with
130 additions
and
84 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
package com.kitchen.ingredients; | ||
|
||
import java.security.Principal; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso; | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@SpringBootApplication | ||
public class Application { | ||
@EnableOAuth2Sso | ||
public class Application extends WebSecurityConfigurerAdapter { | ||
|
||
|
||
@Override | ||
protected void configure(HttpSecurity http) throws Exception { | ||
http.antMatcher("/**") | ||
.authorizeRequests() | ||
.antMatchers("/login**", "/") | ||
.permitAll() | ||
.anyRequest() | ||
.authenticated(); | ||
} | ||
|
||
public static void main(String[] args) { | ||
public static void main(String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
} | ||
|
||
SpringApplication.run(Application.class, args); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.kitchen.ingredients; | ||
|
||
import java.security.Principal; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso; | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.stereotype.Controller; | ||
|
||
|
||
@EnableOAuth2Sso | ||
@Controller | ||
public class KitchenController { | ||
|
||
@RequestMapping("/login") | ||
public String login() { | ||
return "ingredients"; | ||
} | ||
|
||
@RequestMapping("/ingredients") | ||
public String ingridients() { | ||
return "ingredients"; | ||
} | ||
|
||
@RequestMapping("/recipes") | ||
public String recipes() { | ||
return "recipes"; | ||
} | ||
|
||
@RequestMapping("/page3") | ||
public String page3() { | ||
return "page3"; | ||
} | ||
|
||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.kitchen.ingredients; | ||
|
||
import java.security.Principal; | ||
|
||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class UserController { | ||
|
||
@RequestMapping("/user") | ||
public Principal user(Principal principal) { | ||
return principal; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters