spring-security-oauth2

Integrate Spring Security OAuth2 and Spring Social

瘦欲@ 提交于 2019-11-27 00:18:37
问题 I'm working with a Spring Boot + Spring Security OAuth2 application that I believe was inspired by examples from Dave Syer. The application is configured to be an OAuth2 authorization server, with a single public client using the Resource Owner Password Credentials flow. A successful token is configured to be a JWT. The public Angular client sends a POST request to /oauth/token with a basic auth header containing the client id and secret (this was the easiest way to get the client to

How can I revoke a JWT token?

删除回忆录丶 提交于 2019-11-26 22:01:40
I am using Spring Security OAuth2 and JWT tokens. My question is: How can I revoke a JWT token? As mentioned here http://projects.spring.io/spring-security-oauth/docs/oauth2.html , revocation is done by refresh token. But it does not seem to work. João Angelo In general the easiest answer would be to say that you cannot revoke a JWT token, but that's simply not true . The honest answer is that the cost of supporting JWT revocation is sufficiently big for not being worth most of the times or plainly reconsider an alternative to JWT. Having said that, in some scenarios you might need both JWT

Standalone Spring OAuth2 JWT Authorization Server + CORS

无人久伴 提交于 2019-11-26 21:41:20
So I have the following Authorization Server condensed from this example from Dave Syer @SpringBootApplication public class AuthserverApplication { public static void main(String[] args) { SpringApplication.run(AuthserverApplication.class, args); } /* added later @Configuration @Order(Ordered.HIGHEST_PRECEDENCE) protected static class MyWebSecurity extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http //.csrf().disable() .authorizeRequests() .antMatchers(HttpMethod.OPTIONS, "/oauth/token").permitAll(); } }*/ @Configuration

jhipster oauth : How can i get the access_token via CURL

无人久伴 提交于 2019-11-26 20:58:31
问题 i'm trying to use the jhipster tool in order to create a new project with the oauth2 authentication. The project example work fine, i can login with the angularjs interface, but can't understand how can i create a new user and then get the access token via Curl command line for this new user. Thanks for your help 回答1: Step #1: Register the user. Register a user at http://localhost:8080/#/register and make sure you can log in via the web interface. Step #2: Obtain an OAuth2 token. Information

Spring Security 5 : There is no PasswordEncoder mapped for the id “null”

亡梦爱人 提交于 2019-11-26 20:46:09
I am migrating from Spring Boot 1.4.9 to Spring Boot 2.0 and also to Spring Security 5 and I am trying to do authenticate via OAuth 2. But I am getting this error: java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null From the documentation of Spring Security 5 , I get to know that storage format for password is changed. In my current code I have created my password encoder bean as: @Bean public BCryptPasswordEncoder passwordEncoder() { return new BCryptPasswordEncoder(); } However it was giving me below error: Encoded password does not look like BCrypt So I

can I include user information while issuing an access token?

馋奶兔 提交于 2019-11-26 19:47:41
I have seen in some oauth2 implementations additional information on the response returned by the authorization server when it issues access tokens. I'm wondering if there is a way to accomplish this using spring-security-oauth2. I would love to be able to include some user authorities on the access token response so that my consuming applications don't need to manage the user authorities but can still set the user on their own security contexts and apply any of their own spring-security checks. How would I get that information on the access token response? How would I intercept that

Spring OAuth2.0: Getting User Roles based on Client Id

旧时模样 提交于 2019-11-26 18:27:14
问题 I have multiple clients registered for my oauth2 auth server. lets say user1 have roles such as ROLE_A , ROLE_B for client1 , same user has roes such as ROLE_C , ROLE_D for client2 . now when the user logins either using client1 or client2 he is able to see all the four roles ie. ROLE_A , ROLE_B , ROLE_C and ROLE_D . My requirement was when the user1 logins to client1 it should return only the roles ROLE_A and ROLE_B . when he logins using client2 it should return only ROLE_C and ROLE_D For

Spring Security OAuth 2.0 - client secret always required for authorization code grant

大憨熊 提交于 2019-11-26 17:13:18
问题 According to the spec, requests for a token using the authorization code grant are not required to be authenticated as long as the client_id is included in the request and the client_id is the same one used to generate the code. However, with the Spring Security OAuth 2.0 implementation, it appears that basic auth is always required on the /oauth/token endpoint even if the client was never assigned a secret. It looks like there is support for allowing clients without a secret due to the

can I include user information while issuing an access token?

北慕城南 提交于 2019-11-26 07:26:55
问题 I have seen in some oauth2 implementations additional information on the response returned by the authorization server when it issues access tokens. I\'m wondering if there is a way to accomplish this using spring-security-oauth2. I would love to be able to include some user authorities on the access token response so that my consuming applications don\'t need to manage the user authorities but can still set the user on their own security contexts and apply any of their own spring-security

Standalone Spring OAuth2 JWT Authorization Server + CORS

霸气de小男生 提交于 2019-11-26 07:23:47
问题 So I have the following Authorization Server condensed from this example from Dave Syer @SpringBootApplication public class AuthserverApplication { public static void main(String[] args) { SpringApplication.run(AuthserverApplication.class, args); } /* added later @Configuration @Order(Ordered.HIGHEST_PRECEDENCE) protected static class MyWebSecurity extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http //.csrf().disable()