You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Felix Meschberger <fm...@adobe.com> on 2011/11/04 11:13:16 UTC

Handling requests to .../j_security_check

Hi all,

Stipulated by the Servlet API specification saying, that FORM based authentication should use request URLs ending with /j_security_check with request parameters j_username and j_password, most of the Sling Authentication Handlers involving some form of FORM based authentication (for example the Form Based Authentication Handler or the OpenID Authentication Handler), actually use this form of request URLs.

Likewise these authentication handlers also generally require the POST request method to be used.

Sometimes, though an Authentication Handler might be misbehaving or by some other fact of dynamic life a .../j_security_check POST request might not be handled by the authentication system and fall through to some POST servlet, e.g. the Sling POST Servlet. To prevent storing login data in the repository, I implemented a workaround as of SLING-2120 [1].

Yet, it still is a workaround.

So I am contemplating the following change to the SlingAuthenticator.handleSecurity method: If the method would return with true (indicating regular request processing) but the request is POST to .../j_security_check, then the request should actually fail with a 403.

Advantage: No inadverted hanlding of this request in the Sling processing pipeline
Disadvantage: No POST request to any .../j_security_check URL will ever pass through Sling's Authentication mechanism

WDYT ?

Regards
Felix

[1] https://issues.apache.org/jira/browse/SLING-2120

Re: Handling requests to .../j_security_check

Posted by Alexander Klimetschek <ak...@adobe.com>.
On 04.11.11 22:03, "Justin Edelson" <ju...@justinedelson.com> wrote:

>On Fri, Nov 4, 2011 at 6:13 AM, Felix Meschberger <fm...@adobe.com>
>wrote:
>>So I am contemplating the following change to the
>>SlingAuthenticator.handleSecurity method: If the method would return
>>with true (indicating regular request processing) but the request is
>>POST to .../j_security_check, then the request should actually fail with
>>a 403.

+1

>But I'd suggest making this a configurable list of paths, defaulting
>to /j_security_check

+1

Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel





Re: Handling requests to .../j_security_check

Posted by Justin Edelson <ju...@justinedelson.com>.
On Fri, Nov 4, 2011 at 6:13 AM, Felix Meschberger <fm...@adobe.com> wrote:
> Hi all,
>
> Stipulated by the Servlet API specification saying, that FORM based authentication should use request URLs ending with /j_security_check with request parameters j_username and j_password, most of the Sling Authentication Handlers involving some form of FORM based authentication (for example the Form Based Authentication Handler or the OpenID Authentication Handler), actually use this form of request URLs.
>
> Likewise these authentication handlers also generally require the POST request method to be used.
>
> Sometimes, though an Authentication Handler might be misbehaving or by some other fact of dynamic life a .../j_security_check POST request might not be handled by the authentication system and fall through to some POST servlet, e.g. the Sling POST Servlet. To prevent storing login data in the repository, I implemented a workaround as of SLING-2120 [1].
>
> Yet, it still is a workaround.
>
> So I am contemplating the following change to the SlingAuthenticator.handleSecurity method: If the method would return with true (indicating regular request processing) but the request is POST to .../j_security_check, then the request should actually fail with a 403.
>
> Advantage: No inadverted hanlding of this request in the Sling processing pipeline
> Disadvantage: No POST request to any .../j_security_check URL will ever pass through Sling's Authentication mechanism
>
> WDYT ?

+1

But I'd suggest making this a configurable list of paths, defaulting
to /j_security_check

Justin

>
> Regards
> Felix
>
> [1] https://issues.apache.org/jira/browse/SLING-2120

Re: Handling requests to .../j_security_check

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

Thanks for the feedback. I have implemented this new feature as of SLING-2266 [1].

Regards
Felix


[1] https://issues.apache.org/jira/browse/SLING-2266

Am 04.11.2011 um 11:13 schrieb Felix Meschberger:

> Hi all,
> 
> Stipulated by the Servlet API specification saying, that FORM based authentication should use request URLs ending with /j_security_check with request parameters j_username and j_password, most of the Sling Authentication Handlers involving some form of FORM based authentication (for example the Form Based Authentication Handler or the OpenID Authentication Handler), actually use this form of request URLs.
> 
> Likewise these authentication handlers also generally require the POST request method to be used.
> 
> Sometimes, though an Authentication Handler might be misbehaving or by some other fact of dynamic life a .../j_security_check POST request might not be handled by the authentication system and fall through to some POST servlet, e.g. the Sling POST Servlet. To prevent storing login data in the repository, I implemented a workaround as of SLING-2120 [1].
> 
> Yet, it still is a workaround.
> 
> So I am contemplating the following change to the SlingAuthenticator.handleSecurity method: If the method would return with true (indicating regular request processing) but the request is POST to .../j_security_check, then the request should actually fail with a 403.
> 
> Advantage: No inadverted hanlding of this request in the Sling processing pipeline
> Disadvantage: No POST request to any .../j_security_check URL will ever pass through Sling's Authentication mechanism
> 
> WDYT ?
> 
> Regards
> Felix
> 
> [1] https://issues.apache.org/jira/browse/SLING-2120


Re: Handling requests to .../j_security_check

Posted by Antonio Sanso <as...@adobe.com>.
On Nov 4, 2011, at 11:13 AM, Felix Meschberger wrote:

> So I am contemplating the following change to the SlingAuthenticator.handleSecurity method: If the method would return with true (indicating regular request processing) but the request is POST to .../j_security_check, then the request should actually fail with a 403.
> 
> Advantage: No inadverted hanlding of this request in the Sling processing pipeline
> Disadvantage: No POST request to any .../j_security_check URL will ever pass through Sling's Authentication mechanism
> 
> WDYT ?

+1 

Regards

Antonio