harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stepan Mishura" <stepan.mish...@gmail.com>
Subject Re: [classlib][auth]LoginContext should always invoke the LoginModules?
Date Tue, 03 Oct 2006 03:27:51 GMT
On 10/2/06, Tim Ellison wrote:
>
> Alex Astapchuk wrote:
> > Hi Stepan, all,
> >
> >> I think the spec. statement: "A LoginContext should not be used to
> >> authenticate more than one Subject." was taken too strict: reusing
> >> LoginContext object to get the same set of credentials seemed odd.
> >
> > The decision was mostly about resources.
> >
> > Indeed, the spec does not specify behavior of LoginContext.
> >
> > However, the spec is more or less clear in what should the
> > Login*Module*-s do in response to login/logout/etc.
> > It states 'login() saves result ...'. It does not warn with
> > anything like 'check previous state and clean up resources
> > from previous successful logins'.
> > The resource clean up is explicitly for abort() and logout().
>
> The spec might not say so explicitly, but cleaning up the resources
> before attempting another login would seem like a reasonable thing to do.


Hi Tim,

And if RI doesn't clean up resources should we do the same to be
"compatible"? :-)

I see two possible solutions here:
1) Revert the change and add javadoc comments that the second login() is
ignored if logout() is not ivoked before.
2) LoginContext calls logout() before the second login().

But both variants will be incompatible with RI (testing shows that it
doesn't invoke logout() before second login()).

Other variants?

Thanks,
Stepan.

>>> I consider RI's behavior is more reasonable.
> >
> > I would say it's more dangerous.
> > The invocation of login() on already logged LoginModule-s
> > may easily produce a resource leak.
> > Presuming the authentication is normally not a too frequent
> > task, such a leak would be really hard to discover and hunt.
>
> I don't see why we would have to suffer the leak -- if the state changes
> are made via API then we have the opportunity to fix things first.
>
> Regards,
> Tim
>
> --
>
> Tim Ellison (t.p.ellison@gmail.com)
> IBM Java technology centre, UK.
>
>
>
------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message