Questions tagged [security-context]

104 questions
2
votes
2 answers

Context injected SecurityContext is null

I have created a Javae EE app using JAX-RS 2.0 and JPA. I created a special provider of my User entity (using Qualifiers) to provide the current user (logged in) as entity from applications user database. To get current user i use @Context private…
dermoritz
  • 12,519
  • 25
  • 97
  • 185
2
votes
1 answer

User token in Symfony2 Integration Tests

I'm doing integration testing of Symfony2 controllers, inheriting my test classes from this: class InsecureWebTestCase extends WebTestCase { protected $client = null; public function setUp() { $this->client =…
Andy Preston
  • 779
  • 4
  • 9
  • 23
2
votes
1 answer

Spring SecurityContext gets "lost"

I'm working on a legacy app (Spring 2.2.5, Spring Security 2.0.8). Authentication is achieved by custom PreAuthenticationProcessingFilter, where SecurityContext is populated with Authentication object. This authentication is available in most places…
Jacek Prucia
  • 1,026
  • 2
  • 12
  • 22
2
votes
1 answer

What does the @Secure annotation do and what package is it apart of

I'm writing an API using Java EE, JAX-RS, Jersey. In doing this I've implemented my own security context and security filter. Looking at questions like this one (How to get MIME type of uploaded file in Jersey) I've seen the @Secure annotation but…
Peter Fox
  • 1,809
  • 2
  • 20
  • 34
1
vote
0 answers

init container in AKS with non root User

Im trying to deploy the Splunk Otel collector helm chart into our k8s cluster. The problem is that we have some internal security policies and containers can´t run as root or have access to the root fyle system. for example this error when I run it…
Zucoa
  • 55
  • 8
1
vote
0 answers

Windows thread impersonation is lost after log off / fast startup

There is a Windows service with a running thread that impersonates a security context of a logged-on user. Then there is system shutdown -> fast startup sequence that performs the user log off. After that the thread continues its execution but…
arabesc
  • 337
  • 1
  • 13
1
vote
1 answer

Helm Conditional resource creation if installing on Openshift

I am trying to create a Helm chart conditional template for a SecurityContextConstraint / SCC based whether I'm installing on an Openshift cluster or not. Because SCCs are Openshift-specific resources. So that, on executing helm install…
lprakashv
  • 1,121
  • 10
  • 19
1
vote
0 answers

How can I Integrate SpringSecuirty to My SpringBootTest?

I'm trying to test a comment_post method. Comment has many - to - one relationship with User Entity which comes from Spring Security. I connected this relationship by using Principal. I think I made it working properly, but having trouble applying…
1
vote
1 answer

SCC apply to all services and not only to specific service

when I apply my custom-scc on my Openshift cluster my service which has the right serviceAccount : My-service-name will retrieve it correctly. However if a pod in another service comes to restart with default as serviceAccount it will also get my…
1
vote
2 answers

Hibernate Envers : How to inject SecurityContext (REST) in RevisionListener?

I have a REST API (using wildfly 20 with microprofile-jwt) so I would like to audit changes with Hibernate Envers. Unfortunately I can't get my Principal object : the javax.ws.rs.core.SecurityContext is null. So my question is : how can I inject the…
1
vote
0 answers

How can I do to my spring boot resource server oauth 2 get user's extra data from api when user authenticate e keep it into security context?

I have a resource server done with Spring Boot. I'm using Spring Security 5.3 to authenticate and authorize the frontend exchange data. I've configured a authorization server "issuer-uri" in application.yml that provides and validates the…
1
vote
0 answers

C# SeviceSecurityContext.Current is not preseved QueueUserWorkItem

When delegating a thread using ThreadPool.QueueuserWorkItem the ServiceSecurityContext.Current does not persist (returns null). Several of the methods I am calling require that the security context be valid prior to returning information. Is there…
user809196
  • 11
  • 1
1
vote
1 answer

Getting git to work in a kubernetes container when using runAsUser

I'd like to run git as part of an initContainer in a Kubernetes pod. I'd also like the containers to run as an arbitrary non-root user. Is there any way to make this happen? The problem is that if I include something like this in the pod…
larsks
  • 277,717
  • 41
  • 399
  • 399
1
vote
0 answers

Integration Testing for manual Spring Security Login

I am trying to do an integration test for my manual Spring Security Login. Below is the test class: @RunWith(SpringRunner.class) @ContextConfiguration @WebAppConfiguration @SpringBootTest @DirtiesContext(methodMode =…
1
vote
0 answers

Unable to authenticate with UsernameAndPasswordToken and set Cookie with Spring Security

I am building Spring Boot/ReactJS app and i have following issue in authenticating the user and generating JSSESSIONID. My SecurityConfig class looks like this: @Configuration @EnableWebSecurity public class SecurityConfig extends…