spring-security

Spring Security OAuth2: Purge TokenStore

走远了吗. 提交于 2020-08-05 19:28:14
问题 Is there any way to configure Spring Security OAuth2 so it automatically purge TokenStore? I want to remove the expired tokens from time to time. I've seen the InMemoryTokenStore code and it performs a flush every now and again. But JdbcTokenStore does not perform any purge, so Who is in charge of removing the expried tokens from the storage? I've implemented a TokenStore that uses MongoDB as storage, but I have the same problem. Nobody is removing the expired tokens from the storage. 回答1:

How do I configure @PreAuthorize to recognize the ID of my logged in user?

十年热恋 提交于 2020-07-31 04:01:03
问题 I'm trying to create a Spring Boot 2.1 application. I have created the following rest controller ... @RestController @RequestMapping("/api/users") public class UserController { ... @PutMapping("/{id}") @PreAuthorize("authentication.principal.id == #id") public ResponseEntity<User> update(@RequestBody User user, @PathVariable UUID id) { final User updatedUser = userService.update(id, user); if (updatedUser == null) { return ResponseEntity.notFound().build(); } else { return ResponseEntity.ok

How do I configure @PreAuthorize to recognize the ID of my logged in user?

无人久伴 提交于 2020-07-31 04:00:23
问题 I'm trying to create a Spring Boot 2.1 application. I have created the following rest controller ... @RestController @RequestMapping("/api/users") public class UserController { ... @PutMapping("/{id}") @PreAuthorize("authentication.principal.id == #id") public ResponseEntity<User> update(@RequestBody User user, @PathVariable UUID id) { final User updatedUser = userService.update(id, user); if (updatedUser == null) { return ResponseEntity.notFound().build(); } else { return ResponseEntity.ok

How do I configure @PreAuthorize to recognize the ID of my logged in user?

落花浮王杯 提交于 2020-07-31 03:59:28
问题 I'm trying to create a Spring Boot 2.1 application. I have created the following rest controller ... @RestController @RequestMapping("/api/users") public class UserController { ... @PutMapping("/{id}") @PreAuthorize("authentication.principal.id == #id") public ResponseEntity<User> update(@RequestBody User user, @PathVariable UUID id) { final User updatedUser = userService.update(id, user); if (updatedUser == null) { return ResponseEntity.notFound().build(); } else { return ResponseEntity.ok

Who is responsible to create login form to get accessToken? Authorization server or Angular? [closed]

僤鯓⒐⒋嵵緔 提交于 2020-07-23 08:48:05
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 months ago . Improve this question I am recently learning about OAuth2. Basically I am using Angular client side, and Backend Spring Boot Rest API. I am having some little confusion regarding login form. Normally when we use 3rd party REST Api like Facebook or Google Rest API, these APIs

Who is responsible to create login form to get accessToken? Authorization server or Angular? [closed]

被刻印的时光 ゝ 提交于 2020-07-23 08:46:28
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 months ago . Improve this question I am recently learning about OAuth2. Basically I am using Angular client side, and Backend Spring Boot Rest API. I am having some little confusion regarding login form. Normally when we use 3rd party REST Api like Facebook or Google Rest API, these APIs

Who is responsible to create login form to get accessToken? Authorization server or Angular? [closed]

两盒软妹~` 提交于 2020-07-23 08:46:13
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 months ago . Improve this question I am recently learning about OAuth2. Basically I am using Angular client side, and Backend Spring Boot Rest API. I am having some little confusion regarding login form. Normally when we use 3rd party REST Api like Facebook or Google Rest API, these APIs

why Spring Security firewall rejects WebDav methods like “PROPFIND”?

那年仲夏 提交于 2020-07-23 08:04:43
问题 I've written a project by spring boot, now I'm using Milton Project to add webdav support. there is some simple example that works well. but when I add this example to my project, Spring Security Firewall rejects requests. thank you in advance for your answers. pom <dependency> <groupId>io.milton</groupId> <artifactId>milton-server-ce</artifactId> <version>2.7.2.4</version> </dependency> filter configuration @Configuration @ImportResource({"classpath*:applicationContext.xml"}) public class

why Spring Security firewall rejects WebDav methods like “PROPFIND”?

爱⌒轻易说出口 提交于 2020-07-23 08:04:06
问题 I've written a project by spring boot, now I'm using Milton Project to add webdav support. there is some simple example that works well. but when I add this example to my project, Spring Security Firewall rejects requests. thank you in advance for your answers. pom <dependency> <groupId>io.milton</groupId> <artifactId>milton-server-ce</artifactId> <version>2.7.2.4</version> </dependency> filter configuration @Configuration @ImportResource({"classpath*:applicationContext.xml"}) public class

why Spring Security firewall rejects WebDav methods like “PROPFIND”?

烂漫一生 提交于 2020-07-23 08:02:20
问题 I've written a project by spring boot, now I'm using Milton Project to add webdav support. there is some simple example that works well. but when I add this example to my project, Spring Security Firewall rejects requests. thank you in advance for your answers. pom <dependency> <groupId>io.milton</groupId> <artifactId>milton-server-ce</artifactId> <version>2.7.2.4</version> </dependency> filter configuration @Configuration @ImportResource({"classpath*:applicationContext.xml"}) public class