Questions tagged [security-context]
104 questions
0
votes
1 answer
Wildfly, JAAS and SecurityContext
I'm still playin with Wildfly-9.0.1.Final and JAAS (see my previous question Wildfly and JAAS login module) in a web application that use a BASIC auth-method. While my custom login module works I got some problems about authorization. I use a…

Francesco
- 1,742
- 5
- 44
- 78
0
votes
2 answers
SecurityContext->isGranted() working in controller but not in service
I have a public area of my app accesible with no login or authentication, and when I run this code in a controller if ($securityContext->isGranted('IS_AUTHENTICATED_ANONYMOUSLY')) I get a true as expected.
Then I have a service defined like…

K. Weber
- 2,643
- 5
- 45
- 77
0
votes
1 answer
ejb in session context is allways null
i have created sigleton session bean which keeps one connection to my mongo database. It works well in jax-rs class when using @EJB annotation - after controller is contructed and bean is injected it calls init method anotated with @PostConstruct.…

murban
- 3
- 2
0
votes
1 answer
Spring Security Custom Authentication
I have a a custom authentication provider implemented in my spring MVC project. In my own over-riding authenticate() method I implement my own authentication where I construct my own UserPasswordAuthenticationToken() and return the object.
Now the…

Ace
- 1,501
- 4
- 30
- 49
0
votes
1 answer
symfony 2.3 Call to a member function get() on a non-object in __construct function
My project runs on symfony 2.3 with fosuserbundle.
I want to get the current user in the controller
$securityContext = $this->get('security.context');
$this->currentUser = $securityContext->getToken()->getUser();
and it works if I do it in…

Kable
- 117
- 5
- 13
0
votes
1 answer
How to access user information from view in Symfony2
How can I access to user information (security-context) from view in symfony2. Using PHP, not twig templates.
Thanks in advance.

user2794692
- 361
- 2
- 10
- 24
0
votes
2 answers
An Authentication object was not found in the SecurityContext
I have an application exporting web services, with a configured Spring Security SecurityFilterChain (with SecurityContextPersistenceFilter among others, which is required for the rest).
My application also uses Spring Security to secure method…

logoff
- 3,347
- 5
- 41
- 58
0
votes
2 answers
Several SecurityContexts in one HttpSession
I have been working on application that is using spring security. I am quite new to spring security and ended up with problem similar to this and this. But it is a bit different.
I do manual authentication this way:…

Vytautas Alkimavičius
- 554
- 5
- 8
0
votes
0 answers
How can I make an Ajax call using a different set of credentials / security context
I am looking to see if it's possible to make AJAX calls to a given website using a different authentication/security/session context than the page making the AJAX call, but ideally using/accessing the same web application on the server (and…

Code Jockey
- 6,611
- 6
- 33
- 45
0
votes
1 answer
I don't know what SecurityContextHolder strategy to use
I use such code for authentication:
@PreAuthorize("isAnonymous()")
@RequestMapping(value = "/login", method = RequestMethod.POST)
public String doLogin(HttpServletRequest request) {
try {
Authentication req = new…

Vladyslav Lubenskyi
- 527
- 1
- 7
- 17
-1
votes
1 answer
Running Spark on EKS 1.25 in Restricted Namespace
We are currently running Spark jobs on EKS 1.24. The jobs run in a PSS restricted namespace. We specify the securityContext settings in a pod template file. These settings provide a seccompProfile which is required by the PSS restricted policy.…

Conrad Mukai
- 1
- 2
-1
votes
1 answer
NullPointer trying to get user info with Keycloak in Spring Boot
I am using Keycloak in my REST application with spring-boot.
It works correctly, I have defined roles in Keycloak, then in my Config.class I allow access to the end-points that interest me according to the role of each user. I have the problem when…

Talenel
- 422
- 2
- 6
- 25
-1
votes
2 answers
How do I check if a user has certain role and therefore allow some actions?
I need to check if logged in user has certain roles on the system so I allow or not some actions. I'm using JMSSecurityExtraBundle and I check the docs for Expression Based Authorization but I'm doing something wrong since code is not working. Take…

ReynierPM
- 17,594
- 53
- 193
- 363