spring-security

Spring Security 5 Replacement for OAuth2RestTemplate

喜夏-厌秋 提交于 2020-02-26 13:07:28
问题 In spring-security-oauth2:2.4.0.RELEASE classes such as OAuth2RestTemplate , OAuth2ProtectedResourceDetails and ClientCredentialsAccessTokenProvider have all been marked as deprecated. From the javadoc on these classes it points to a spring security migration guide that insinuates that people should migrate to the core spring-security 5 project. However I'm having trouble finding how I would implement my use case in this project. All of the documentation and examples talk about integrating

Spring Security 5 Replacement for OAuth2RestTemplate

谁说胖子不能爱 提交于 2020-02-26 13:06:41
问题 In spring-security-oauth2:2.4.0.RELEASE classes such as OAuth2RestTemplate , OAuth2ProtectedResourceDetails and ClientCredentialsAccessTokenProvider have all been marked as deprecated. From the javadoc on these classes it points to a spring security migration guide that insinuates that people should migrate to the core spring-security 5 project. However I'm having trouble finding how I would implement my use case in this project. All of the documentation and examples talk about integrating

How to disable csrf in Spring using application.properties?

爱⌒轻易说出口 提交于 2020-02-26 12:03:06
问题 The following property exists: security.enable-csrf=false BUT csrf protection is still on if I add the property to application.properties . What works is to disable it programatically. But I'd prefer properties configuration. Why could it not be working? @Configuration public class AuthConfig extends WebSecurityConfigurerAdapter { @Autowired private UserDetailsService userDetailsService; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth

How to disable csrf in Spring using application.properties?

坚强是说给别人听的谎言 提交于 2020-02-26 12:03:06
问题 The following property exists: security.enable-csrf=false BUT csrf protection is still on if I add the property to application.properties . What works is to disable it programatically. But I'd prefer properties configuration. Why could it not be working? @Configuration public class AuthConfig extends WebSecurityConfigurerAdapter { @Autowired private UserDetailsService userDetailsService; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth

How to disable csrf in Spring using application.properties?

匆匆过客 提交于 2020-02-26 12:02:32
问题 The following property exists: security.enable-csrf=false BUT csrf protection is still on if I add the property to application.properties . What works is to disable it programatically. But I'd prefer properties configuration. Why could it not be working? @Configuration public class AuthConfig extends WebSecurityConfigurerAdapter { @Autowired private UserDetailsService userDetailsService; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth

Unable to start Tomcat server with two SpringMVC webapps that are created from same maven archetype

旧城冷巷雨未停 提交于 2020-02-25 07:28:08
问题 I have created two Spring MVC applications using spring-mvc-quickstart-archetype (includes spring mvc, spring security, hibernate) , I could run each of this application seperately on tomcat but not able to together. when I add both the projects on to Tomcat, server will not comeup, I get Aug 30, 2013 8:14:48 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'appServlet' then the next line is error in red text as below and then server gets

Thymeleaf not interpreting sec tags

佐手、 提交于 2020-02-25 05:27:45
问题 I've ran into an issue where thymleaf is not recognising the sec tag in my spring boot project. e.g. the below the sec:authentication is not being intepreted and appears as is in the html in the browser <!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security"> <head th:replace="fragments/header"> </head> <body> <div id="container"> Roles <span sec:authentication="principal.authorities"></span> </div> <footer> <div th:replace=

how to do a GET request using retrofit2?

老子叫甜甜 提交于 2020-02-24 14:10:10
问题 I have a restfull web service which is running on a localhost. I would like to make a retrofit2 GET request on that rest URL. MainActivity.java private void requestData() { public static final String BASE_URL = "http://192.168.0.103:8080/SpringWithHibernate/users/"; Toast.makeText(MainActivity.this, "In requestData() :: " + "ddd", Toast.LENGTH_LONG).show(); Gson gson = new GsonBuilder().create(); Retrofit retrofit = new Retrofit.Builder() .baseUrl(BASE_URL) .addConverterFactory

how to do a GET request using retrofit2?

帅比萌擦擦* 提交于 2020-02-24 14:09:32
问题 I have a restfull web service which is running on a localhost. I would like to make a retrofit2 GET request on that rest URL. MainActivity.java private void requestData() { public static final String BASE_URL = "http://192.168.0.103:8080/SpringWithHibernate/users/"; Toast.makeText(MainActivity.this, "In requestData() :: " + "ddd", Toast.LENGTH_LONG).show(); Gson gson = new GsonBuilder().create(); Retrofit retrofit = new Retrofit.Builder() .baseUrl(BASE_URL) .addConverterFactory

Validate the user in the resource server spring security

血红的双手。 提交于 2020-02-24 11:04:39
问题 I have a Authorization server and a resource server implemented using spring boot with oauth2. In the resource server I have configured the check_token endpoint and relevant information to validate the requests from authorization server. security: oauth2: resource: token-info-uri: http://localhost:9191/auth-service/oauth/check_token client: client-id: mobile client-secret: secret So now when a request is comes with a bearer token it allows to access the resource server. But if a token is