spring-security

Explicitly secure a specific pattern instead of ignoring all non-secured patterns

帅比萌擦擦* 提交于 2019-12-25 08:47:35
问题 I have an application where I only need to secure /admin/ pages. All of the other pages have no login, account or other features that require security. According to other questions and tutorials, I have currently implemented this with explicitly ignoring all paths that don't require security, e.g. web .ignoring() .antMatchers("/js/**"); web .ignoring() .antMatchers("/static/**"); web .ignoring() .antMatchers("/images/**"); web .ignoring() .antMatchers("/css/**"); web .ignoring() .antMatchers(

Setting up new default Roles in jhipster

情到浓时终转凉″ 提交于 2019-12-25 08:39:50
问题 How can I set up default roles in jhipster ? (using angularjs and spring). I explain myself in the registration page I want to specify the role for the registred user. let's say by a checkbox or a list. (for exemple human and animal ) How can I do that in the angular controller and in spring ? What I can do now ? I added the roles I need in the database and in angular and I can specify the roles for the new registred users , only through the Admin's users management page. 回答1: There is some

Spring Security with JWT

旧街凉风 提交于 2019-12-25 08:33:05
问题 I am trying to develop Spring Security project with JWT. I want access Login api with out Spring Security (without JWT token). But with below configuration, every time (for login api as well) it is checking for JWT token giving me 403 error. Below is my WebSecurityConfig. @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private JwtAuthFilter jwtAuthFilter; @Autowired private TokenAuthenticationService jwtAuthenticationProvider;

Criteria based authorization check with spring security?

血红的双手。 提交于 2019-12-25 08:28:24
问题 How does spring security support dynamic role & permission? For example, the role can be generated at runtime by end users. Each role can include multiple permissions which can be created/updated at runtime. Each permission is base on criteria like delete topic if no activity for 3 months. The ACL of spring security can't support it since records of acl_entry are static instead of dynamic. How to customize spring security to support such requirement? 回答1: Spring Security 3 supports expression

Spring security and @PostFilter

有些话、适合烂在心里 提交于 2019-12-25 08:16:56
问题 I have this object: @Service public class myBr { @PostFilter("filterObject.cellule.getId()==2") public List<Bibliotheque> getB() { return super.getAll(); } public List<Bibliotheque> getA() { return getB(); } } When I call from a test that does myBr.getB() , the @PostFilter is applied, but when I call myBr.getA() , the postfilter is not working. Is there a way to handle this so that the filter is applied? 回答1: The issue is that the @PostFilter is applied through AOP techniques, yet you are

Authenticating rest endpoints and the UI using Okta

断了今生、忘了曾经 提交于 2019-12-25 08:04:28
问题 We have a Java 8 backend application using SprintBoot with an embedded Jetty server. The UI for the application is a Single Page Application built using React. Currently I have enabled authentication by integrating with Okta using the spring security SAML extension. When the assertion is posted by Okta to my app, I create a session and the JSESSIONID is sent in the cookie. This was fine until now when we had a very simple UI serving few UI components. However, now we have several REST

I can not load the CSS pages which can be accessed after a login carry with spring security. How can I fix it?

坚强是说给别人听的谎言 提交于 2019-12-25 08:01:33
问题 I should add CSS to two pages to which it is accessed after a login for which data are checked with spring security How do I add CSS to these two pages protected with spring security? task.jsp <link rel="stylesheet" href="<c:url value=" resources/css/bootstrap.responsive.css" />" type="text/css"> <link rel="stylesheet" href="<c:url value=" resources/css/bootstrap.css" />" type="text/css"> <link rel="stylesheet" href="<c:url value=" resources/css/fontello-ie7.css" />" type="text/css"> <link

No AuthenticationEntryPoint could be established. Please make sure you have a login mechanism configured through the namespace

喜欢而已 提交于 2019-12-25 08:00:07
问题 I am using Spring-security 4.0.4. I was trying to set the security configurations for the response headers as below- <sec:http use-expressions="true"> <sec:headers defaults-disabled="true"/> </sec:http> This setting is to disable the security components in the security header. However, if this setting is done then the following exception is thrown during the server startup. Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: No

spring security weird behaivior

随声附和 提交于 2019-12-25 07:59:46
问题 I am testing with spring security and MongoDB so I build a custom UserDetailService using MongoDB and I got it working but suddenly it started throwing an exception, I tried to solve the problem but I couldn't so I revert my code to a prior state before implementing the custom UserDetailService and it started working again, I re-implemented the UserDetailService and the exact same thing happened, it just stop working without even changing anything just stop and restart tomcat. Here is my web

Favoring LogBack over Log4j in spring-boot/ security

浪尽此生 提交于 2019-12-25 07:19:04
问题 Im having a problem with this version of spring-boot <version>1.3.3.RELEASE</version> Which I did not use to have in prior versions. Everything runs fine in intelij. however when i want to run the packaged version with mvn spring-boot:run I get a classpath hell error : LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.apache.logging.slf4j.Log4jLoggerFactory loaded from file:/Users/jstuartmilne/.m2