jsr196

How to override j_security_check in glassfish?

可紊 提交于 2019-12-18 16:50:03
问题 I'm currently using FORM based authentication in glassfish v2.1 to log users in and it works fine. I want to switch to ProgrammaticLogin and I want to be able to get the initially requested URL (i.e. before redirecting to login page) and use it in my programmatic login code so that the user is redirected back to the requested page after authentication. I've seen the source code for j_security_check - in my case that's FormAuthenticator (catalina codebase) and it saves the initial request in a

Jaspic module not propagating principal to local EJB in JBoss 7.4

安稳与你 提交于 2019-12-06 10:23:29
问题 I have a custom, JSR-196 module, that basically delegates to a service that delegates roles to a OAuth "grants" call. It does work from a servlet (request.getUserPrincipal() works fine). It does not propagate to EJB calls, where SessionContext.getCallerPrincipal() returns a SimplePrincipal with "anonymous" instead of expected username / roles. MycompanyPrincipal is a simple class, with a simple getName() and some custom properties. It seems that SubjectInfo.getAuthenticatedSubject() has no

How to save an authenticated user in JASPIC?

不羁的心 提交于 2019-12-06 08:47:27
问题 I have developed a Security Authentication Module (SAM) and implemented the validateRequest method. I also have a simple webapp configured to use this SAM. In my validateRequest method, I check the clientSubject and set a CallerPrincipalCallback with a hardcoded username and a GroupPrincipalCallback with a hardcoded group name: final CallerPrincipalCallback callerPrincipalCallback = new CallerPrincipalCallback(clientSubject, "anonymous"); final GroupPrincipalCallback groupPrincipalCallback =

Jaspic module not propagating principal to local EJB in JBoss 7.4

倖福魔咒の 提交于 2019-12-04 17:17:58
I have a custom, JSR-196 module, that basically delegates to a service that delegates roles to a OAuth "grants" call. It does work from a servlet (request.getUserPrincipal() works fine). It does not propagate to EJB calls, where SessionContext.getCallerPrincipal() returns a SimplePrincipal with "anonymous" instead of expected username / roles. MycompanyPrincipal is a simple class, with a simple getName() and some custom properties. It seems that SubjectInfo.getAuthenticatedSubject() has no principal. I managed to make an ugly workaround for that, see "// WORKAROUND" below. Still, I'd want to

How to save an authenticated user in JASPIC?

自作多情 提交于 2019-12-04 12:47:15
I have developed a Security Authentication Module (SAM) and implemented the validateRequest method. I also have a simple webapp configured to use this SAM. In my validateRequest method, I check the clientSubject and set a CallerPrincipalCallback with a hardcoded username and a GroupPrincipalCallback with a hardcoded group name: final CallerPrincipalCallback callerPrincipalCallback = new CallerPrincipalCallback(clientSubject, "anonymous"); final GroupPrincipalCallback groupPrincipalCallback = new GroupPrincipalCallback(clientSubject, new String[] {"user"}); try { this.handler.handle(new