Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] JAAS custom callbacks

    /* ------------------------------------------------------------ */
    public UserIdentity login(final String username,final Object credentials)
    {
        try
        {
            CallbackHandler callbackHandler = null;

            if (_callbackHandlerClass == null)
            {
               // shouldn't be the case so removed
            }
            else
            {
                Class clazz = Loader.loadClass(getClass(),
_callbackHandlerClass);
                callbackHandler =
(CallbackHandler)clazz.newInstance();   <-- your instance...
            }

sorry, still not following what you mean by an anonymous Callback
instance, that should be your handler

cheers,
jesse

--
jesse mcconnell
jesse.mcconnell@xxxxxxxxx



On Fri, Aug 5, 2011 at 13:10, Todor Boev <rinsvind@xxxxxxxxx> wrote:
> I looked up the source from http://download.eclipse.org/jetty/stable-7/xref/
>
> And I do set the callback handler class from the jetty configuration
> similarly to this:
>
> <Set name="CallbackHandlerClass">org.eclipse.jetty.plus.jaas.callback.DefaultCallbackHandler</Set>
>
> I know for a fact that the JAASLoginService is called. However
> breakpoints even in DefaultCallbackHandler when set like this are not
> hit.
>
>
> On Fri, Aug 5, 2011 at 8:58 PM, Jesse McConnell
> <jesse.mcconnell@xxxxxxxxx> wrote:
>> You should just have to call setCallBackHandlerClass(String name) on
>> the login service, and then on login it is instantiated and set as the
>> callback handler..
>>
>> where are you looking to see the behavior you are?
>>
>> cheers,
>> jesse
>>
>> --
>> jesse mcconnell
>> jesse.mcconnell@xxxxxxxxx
>>
>>
>>
>> On Fri, Aug 5, 2011 at 12:48, Todor Boev <rinsvind@xxxxxxxxx> wrote:
>>> Hi,
>>>
>>> I am trying to set a custom JAAS Callback as instructed in
>>>
>>> http://wiki.eclipse.org/Jetty/Tutorial/JAAS#Using_the_CallbackHandler
>>>
>>> My callback is never instantiated or called. I examined the code of
>>>
>>> org.eclipse.jetty.plus.jaas.JAASLoginService
>>>
>>> and discovered that it does not use the callback setting at all. In
>>> the login() method it simply creates an anonymous Callback instance
>>> and uses that. So it seems there is simply no way for me to use my
>>> callback and the documentation is wrong.
>>>
>>> Can you please tell me if there is a way to get my callback
>>> instantiated and called?
>>>
>>> Regards,
>>> Todor
>>> _______________________________________________
>>> jetty-users mailing list
>>> jetty-users@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>>
>> _______________________________________________
>> jetty-users mailing list
>> jetty-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>


Back to the top