Skip to content

Commit 87885a9

Browse files
author
nigel.zheng
committed
chore: add references to README
1 parent 1b10f13 commit 87885a9

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ or
6565
@AttachClaims(value = {
6666
@Claim(name = "user_id", value = "6", type = Long.class),
6767
@Claim(name = "role_id", value = "1"),
68-
@Claim(name = "is_social_user", value = "false")
69-
}, claims = {"role_name:ADMIN", "user_name=ahunigel"})
68+
@Claim(name = "is_social_user", value = "false")},
69+
claims = {"email:[email protected]", "user_name=ahunigel"}
70+
)
7071
@WithMockUser()
7172
```
7273
or
@@ -76,10 +77,19 @@ or
7677
@Claim(name = "user_id", value = "6", type = Long.class),
7778
@Claim(name = "role_id", value = "1"),
7879
@Claim(name = "is_social_user", value = "false")},
79-
claims = {"role_name:ADMIN", "user_name=ahunigel"})
80+
claims = {"email:[email protected]", "user_name=ahunigel"}
81+
)
8082
)
8183
```
8284

85+
## References
86+
- [How to get @WebMvcTest work with OAuth?](https://stackoverflow.com/questions/48540152/how-to-get-webmvctest-work-with-oauth)
87+
- [Faking OAuth2 Single Sign-on in Spring](http://engineering.pivotal.io/post/faking_oauth_sso/)
88+
- [@WithSecurityContext](https://docs.spring.io/spring-security/site/docs/current/reference/html/test-method.html#test-method-withsecuritycontext)
89+
- [Spring MVC Test Integration](https://docs.spring.io/spring-security/site/docs/current/reference/html/test-mockmvc.html)
90+
- [OAuth2 Autoconfig](https://docs.spring.io/spring-security-oauth2-boot/docs/current/reference/htmlsingle/)
91+
- [Retrieve User Information in Spring Security](https://www.baeldung.com/get-user-in-spring-security)
92+
8393
## TODOs
8494

8595
- For oauth2 request, add ability to set ResourceServerSecurityConfigurer.stateless to false, maybe add an

0 commit comments

Comments
 (0)