You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Scott Kub <ws...@gmail.com> on 2010/07/09 05:36:06 UTC
Gathering Windows logon credentials
I haven't read anywhere that Shiro attempts to tackle this problem but it
seems a great place to ask the question to get advice and on the surface
seems like it might be very helpful functionality that could be built into
Shiro.
So the question is: Can you use Shiro (or do you have guidance to some other
text or Java code) that can retrieve the currently logged on user credential
for someone that has logged into a Windows network via Active Directory? I
haven't been able to find good documentation on how to do this anywhere,
though maybe my Google skills are just lacking. A typical example would be
that a user at his company logs on to their Windows XP or 7 machine and
enters their user name and password for a particular domain. That domain is
usually controlled by an Active Directory - I know Shiro handles Active
Directory authentication if you pass in a user name and password. From what
I've found so far it seems like prior to Java 6 you would need to
communicate with a DLL via JNI or JNA to find such info out. Then with Java
6 the GSS API is supposed to help handle this type of situation but I
haven't found out how to use it yet. The System.getProperty("user.name") is
a poor way to do it since anyone can change the environment variable.
Hope that makes sense and any advise or thoughts are greatly appreciated!
Scott
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5272872.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Les Hazlewood <lh...@apache.org>.
Hi Scott,
Yep, the easiest thing to do would be to check out the trunk and make
any additions (classes, tests, etc) that you may need and ensure the
project builds. Then the best thing to do is to create a patch from
the root of the codebase and attach that patch to a Jira issue.
Thanks!
Les
On Wed, Jan 5, 2011 at 10:19 PM, Scott Kub <ws...@gmail.com> wrote:
>
> Hey Les,
>
> I transferred the code over to my home computer now, so I can either start
> working on integrating it into Shiro or I can give you the snippets I have.
> Which way works best?
>
> If it's for me to checkout the source and add the code, is this still your
> advice:
>
> The easiest thing to do is subclass the
>
> org.apache.shiro.realm.AuthorizingRealm and implement the
>
> 'doGetAuthenticationInfo' method (just return null for now for the
>
> remaining doGetAuthorizationInfo method).
>
>
>> That method will give you an AuthenticationToken (probably a
>
> UsernamePasswordToken). You take that and use it to perform the
>
> Kerberos login. In other words, all integration to get this to work
>
> should stem from 'doGetAuthenticationInfo' only - you don't need to
>
> worry about anything else in Shiro.
>
>
>> The question is - if you can contribute this, can you please post it
>
> as a .zip to Jira? As an ASF project, we can't accept anything that
>
> is not considered an ASL 2.0-compatible contribution. Posting to Jira
>
> acts as a provenance mechanism that allows us to accept code from the
>
> community.
>
>
>> Perhaps the easiest thing to do is to create a new Maven module under
>
> the <project source root>/support directory and upload only that
>
> module to Jira.
>
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5894462.html
> Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Les Hazlewood <lh...@apache.org>.
Just a quick note - Scott's code (while appreciated!) doesn't have any
Shiro integration (at least from what I saw). If someone can
translate this to Shiro's APIs and provide a patch, things will move a
little faster (I personally don't have time to do this at the moment,
as things are work are pretty crazy time-wise).
Cheers,
Les
On Thu, Mar 8, 2012 at 11:39 AM, Ryan McKinley <ry...@gmail.com> wrote:
> Thanks Scott -- hopefully this can grow into something generally useful!
>
>
> On Wed, Mar 7, 2012 at 6:59 AM, Scott Kub <ws...@gmail.com> wrote:
>> Check out https://issues.apache.org/jira/browse/SHIRO-346.
>>
>> Scott
>>
>> On Mon, Mar 5, 2012 at 5:09 PM, Ryan McKinley [via Shiro User] <
>> ml-node+s582556n7346928h12@n2.nabble.com> wrote:
>>
>>> Hi Scott-
>>>
>>> I don't think the java files made it though the tubes. Can you post
>>> the files to a JIRA issue?
>>> https://issues.apache.org/jira/browse/SHIRO
>>>
>>> thanks
>>> ryan
>>>
>>>
>>>
>>> On Thu, Mar 1, 2012 at 7:09 PM, Scott Kub <[hidden email]<http://user/SendEmail.jtp?type=node&node=7346928&i=0>>
>>> wrote:
>>>
>>> > The classes needed are attached. You can ignore references to
>>> > "capabilities" - those are things specific to the problem I was solving,
>>> > and are attributes assigned to the Active Directory user. Let me know if
>>> > you don't see the five attached Java files.
>>> >
>>> > Scott
>>> >
>>> > On Thu, Mar 1, 2012 at 12:29 AM, JohnnyBekkestad [via Shiro User] <
>>> > [hidden email] <http://user/SendEmail.jtp?type=node&node=7346928&i=1>>
>>> wrote:
>>> >
>>> >> Hey Scot!
>>> >> Thanks, that would be awesome. I am working with a project that has the
>>> >> need to do just this.
>>> >>
>>> >> ------------------------------
>>> >> If you reply to this email, your message will be added to the
>>> discussion
>>> >> below:
>>> >>
>>> >>
>>> >> .
>>> >> NAML<
>>> http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>
>>> >>
>>> >
>>> >
>>> > --
>>> > View this message in context:
>>> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7335297.html
>>> > Sent from the Shiro User mailing list archive at Nabble.com.
>>>
>>>
>>> ------------------------------
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7346928.html
>>> To unsubscribe from Gathering Windows logon credentials, click here<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5272872&code=d3NrdWJpbmFAZ21haWwuY29tfDUyNzI4NzJ8LTExMTMyNjEwMQ==>
>>> .
>>> NAML<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>
>>
>>
>> --
>> View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7352030.html
>> Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Ryan McKinley <ry...@gmail.com>.
Thanks Scott -- hopefully this can grow into something generally useful!
On Wed, Mar 7, 2012 at 6:59 AM, Scott Kub <ws...@gmail.com> wrote:
> Check out https://issues.apache.org/jira/browse/SHIRO-346.
>
> Scott
>
> On Mon, Mar 5, 2012 at 5:09 PM, Ryan McKinley [via Shiro User] <
> ml-node+s582556n7346928h12@n2.nabble.com> wrote:
>
>> Hi Scott-
>>
>> I don't think the java files made it though the tubes. Can you post
>> the files to a JIRA issue?
>> https://issues.apache.org/jira/browse/SHIRO
>>
>> thanks
>> ryan
>>
>>
>>
>> On Thu, Mar 1, 2012 at 7:09 PM, Scott Kub <[hidden email]<http://user/SendEmail.jtp?type=node&node=7346928&i=0>>
>> wrote:
>>
>> > The classes needed are attached. You can ignore references to
>> > "capabilities" - those are things specific to the problem I was solving,
>> > and are attributes assigned to the Active Directory user. Let me know if
>> > you don't see the five attached Java files.
>> >
>> > Scott
>> >
>> > On Thu, Mar 1, 2012 at 12:29 AM, JohnnyBekkestad [via Shiro User] <
>> > [hidden email] <http://user/SendEmail.jtp?type=node&node=7346928&i=1>>
>> wrote:
>> >
>> >> Hey Scot!
>> >> Thanks, that would be awesome. I am working with a project that has the
>> >> need to do just this.
>> >>
>> >> ------------------------------
>> >> If you reply to this email, your message will be added to the
>> discussion
>> >> below:
>> >>
>> >>
>> >> .
>> >> NAML<
>> http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>> >>
>> >
>> >
>> > --
>> > View this message in context:
>> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7335297.html
>> > Sent from the Shiro User mailing list archive at Nabble.com.
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7346928.html
>> To unsubscribe from Gathering Windows logon credentials, click here<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5272872&code=d3NrdWJpbmFAZ21haWwuY29tfDUyNzI4NzJ8LTExMTMyNjEwMQ==>
>> .
>> NAML<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7352030.html
> Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Scott Kub <ws...@gmail.com>.
Check out https://issues.apache.org/jira/browse/SHIRO-346.
Scott
On Mon, Mar 5, 2012 at 5:09 PM, Ryan McKinley [via Shiro User] <
ml-node+s582556n7346928h12@n2.nabble.com> wrote:
> Hi Scott-
>
> I don't think the java files made it though the tubes. Can you post
> the files to a JIRA issue?
> https://issues.apache.org/jira/browse/SHIRO
>
> thanks
> ryan
>
>
>
> On Thu, Mar 1, 2012 at 7:09 PM, Scott Kub <[hidden email]<http://user/SendEmail.jtp?type=node&node=7346928&i=0>>
> wrote:
>
> > The classes needed are attached. You can ignore references to
> > "capabilities" - those are things specific to the problem I was solving,
> > and are attributes assigned to the Active Directory user. Let me know if
> > you don't see the five attached Java files.
> >
> > Scott
> >
> > On Thu, Mar 1, 2012 at 12:29 AM, JohnnyBekkestad [via Shiro User] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=7346928&i=1>>
> wrote:
> >
> >> Hey Scot!
> >> Thanks, that would be awesome. I am working with a project that has the
> >> need to do just this.
> >>
> >> ------------------------------
> >> If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> >> .
> >> NAML<
> http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> > --
> > View this message in context:
> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7335297.html
> > Sent from the Shiro User mailing list archive at Nabble.com.
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7346928.html
> To unsubscribe from Gathering Windows logon credentials, click here<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5272872&code=d3NrdWJpbmFAZ21haWwuY29tfDUyNzI4NzJ8LTExMTMyNjEwMQ==>
> .
> NAML<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7352030.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Ryan McKinley <ry...@gmail.com>.
Hi Scott-
I don't think the java files made it though the tubes. Can you post
the files to a JIRA issue?
https://issues.apache.org/jira/browse/SHIRO
thanks
ryan
On Thu, Mar 1, 2012 at 7:09 PM, Scott Kub <ws...@gmail.com> wrote:
> The classes needed are attached. You can ignore references to
> "capabilities" - those are things specific to the problem I was solving,
> and are attributes assigned to the Active Directory user. Let me know if
> you don't see the five attached Java files.
>
> Scott
>
> On Thu, Mar 1, 2012 at 12:29 AM, JohnnyBekkestad [via Shiro User] <
> ml-node+s582556n7331833h67@n2.nabble.com> wrote:
>
>> Hey Scot!
>> Thanks, that would be awesome. I am working with a project that has the
>> need to do just this.
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7331833.html
>> To unsubscribe from Gathering Windows logon credentials, click here<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5272872&code=d3NrdWJpbmFAZ21haWwuY29tfDUyNzI4NzJ8LTExMTMyNjEwMQ==>
>> .
>> NAML<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7335297.html
> Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Scott Kub <ws...@gmail.com>.
The classes needed are attached. You can ignore references to
"capabilities" - those are things specific to the problem I was solving,
and are attributes assigned to the Active Directory user. Let me know if
you don't see the five attached Java files.
Scott
On Thu, Mar 1, 2012 at 12:29 AM, JohnnyBekkestad [via Shiro User] <
ml-node+s582556n7331833h67@n2.nabble.com> wrote:
> Hey Scot!
> Thanks, that would be awesome. I am working with a project that has the
> need to do just this.
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7331833.html
> To unsubscribe from Gathering Windows logon credentials, click here<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5272872&code=d3NrdWJpbmFAZ21haWwuY29tfDUyNzI4NzJ8LTExMTMyNjEwMQ==>
> .
> NAML<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7335297.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by JohnnyBekkestad <jo...@gmail.com>.
Hey Scot!
Thanks, that would be awesome. I am working with a project that has the need
to do just this.
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7331833.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Scott Kub <ws...@gmail.com>.
Hey Johnny, no I never did get this put into the baseline. I'll try to
remember to grab the code that does this when I'm at work tomorrow though,
and post it to the forum.
On Wed, Feb 29, 2012 at 8:21 AM, JohnnyBekkestad [via Shiro User] <
ml-node+s582556n7329551h25@n2.nabble.com> wrote:
> Any updates on this?
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7329551.html
> To unsubscribe from Gathering Windows logon credentials, click here<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5272872&code=d3NrdWJpbmFAZ21haWwuY29tfDUyNzI4NzJ8LTExMTMyNjEwMQ==>
> .
> NAML<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7331505.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by JohnnyBekkestad <jo...@gmail.com>.
Any updates on this?
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p7329551.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Scott Kub <ws...@gmail.com>.
Hey Les,
I transferred the code over to my home computer now, so I can either start
working on integrating it into Shiro or I can give you the snippets I have.
Which way works best?
If it's for me to checkout the source and add the code, is this still your
advice:
The easiest thing to do is subclass the
org.apache.shiro.realm.AuthorizingRealm and implement the
'doGetAuthenticationInfo' method (just return null for now for the
remaining doGetAuthorizationInfo method).
> That method will give you an AuthenticationToken (probably a
UsernamePasswordToken). You take that and use it to perform the
Kerberos login. In other words, all integration to get this to work
should stem from 'doGetAuthenticationInfo' only - you don't need to
worry about anything else in Shiro.
> The question is - if you can contribute this, can you please post it
as a .zip to Jira? As an ASF project, we can't accept anything that
is not considered an ASL 2.0-compatible contribution. Posting to Jira
acts as a provenance mechanism that allows us to accept code from the
community.
> Perhaps the easiest thing to do is to create a new Maven module under
the <project source root>/support directory and upload only that
module to Jira.
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5894462.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Les Hazlewood <lh...@apache.org>.
No worries Scott - it was the holidays after all ;)
Anyway, we're grateful for whatever you might be able to contribute!
Cheers,
Les
P.S. Any contribution should be an attachment in a Jira issue. Thanks!
On Tue, Jan 4, 2011 at 7:52 PM, Scott Kub <ws...@gmail.com> wrote:
>
> Hey Minas and Les,
>
> Yep, I'll grab the code tomorrow. Expect an e-mail tomorrow night
> (MST). I apologize for dropping the ball on that, hopefully not many
> needed it and had to go without.
>
> Scott
>
> On Tue, Jan 4, 2011 at 3:03 PM, Les Hazlewood-2 [via Shiro User]
> <ml...@n2.nabble.com> wrote:
>> Hi Scott,
>>
>> Is there a possibility that you might be able to contribute the code for
>> this?
>>
>> Cheers,
>>
>> Les
>>
>> On Tue, Dec 21, 2010 at 1:05 PM, Minas Manthos <[hidden email]> wrote:
>>>
>>> Any news on this?
>>> --
>>> View this message in context:
>>> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5855767.html
>>> Sent from the Shiro User mailing list archive at Nabble.com
>>
>>
>> ________________________________
>> View message @
>> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5889967.html
>> To unsubscribe from Gathering Windows logon credentials, click here.
>
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5890661.html
> Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Scott Kub <ws...@gmail.com>.
Hey Minas and Les,
Yep, I'll grab the code tomorrow. Expect an e-mail tomorrow night
(MST). I apologize for dropping the ball on that, hopefully not many
needed it and had to go without.
Scott
On Tue, Jan 4, 2011 at 3:03 PM, Les Hazlewood-2 [via Shiro User]
<ml...@n2.nabble.com> wrote:
> Hi Scott,
>
> Is there a possibility that you might be able to contribute the code for
> this?
>
> Cheers,
>
> Les
>
> On Tue, Dec 21, 2010 at 1:05 PM, Minas Manthos <[hidden email]> wrote:
>>
>> Any news on this?
>> --
>> View this message in context:
>> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5855767.html
>> Sent from the Shiro User mailing list archive at Nabble.com
>
>
> ________________________________
> View message @
> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5889967.html
> To unsubscribe from Gathering Windows logon credentials, click here.
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5890661.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Les Hazlewood <lh...@apache.org>.
Hi Scott,
Is there a possibility that you might be able to contribute the code for this?
Cheers,
Les
On Tue, Dec 21, 2010 at 1:05 PM, Minas Manthos <mi...@gmail.com> wrote:
>
> Any news on this?
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5855767.html
> Sent from the Shiro User mailing list archive at Nabble.com
Re: Gathering Windows logon credentials
Posted by Scott Kub <ws...@gmail.com>.
Hey Minas and Les,
Yep, I'll grab the code tomorrow. Expect an e-mail tomorrow night
(MST). I apologize for dropping the ball on that, hopefully not many
needed it and had to go without.
Scott
On Tue, Jan 4, 2011 at 3:03 PM, Les Hazlewood-2 [via Shiro User]
<ml...@n2.nabble.com> wrote:
> Hi Scott,
>
> Is there a possibility that you might be able to contribute the code for
> this?
>
> Cheers,
>
> Les
>
> On Tue, Dec 21, 2010 at 1:05 PM, Minas Manthos <[hidden email]> wrote:
>>
>> Any news on this?
>> --
>> View this message in context:
>> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5855767.html
>> Sent from the Shiro User mailing list archive at Nabble.com
>
>
> ________________________________
> View message @
> http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5889967.html
> To unsubscribe from Gathering Windows logon credentials, click here.
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5890660.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Minas Manthos <mi...@gmail.com>.
Any news on this?
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5855767.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Scott Kub <ws...@gmail.com>.
I haven't looked at the Shiro architecture or code yet but I imagine that,
yes, it'd be straightforward to add as a realm. I'll send you a message to
see how I can help.
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5657443.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by Les Hazlewood <lh...@apache.org>.
Hi Scott,
Thanks for the details - it was an interesting read. Hopefully this
will help for anyone needing to do similar in the future.
Is this something that can be contributed to Shiro as a Realm? I
don't know the details of what was involved, but if it's possible, I'd
be interested for sure.
Cheers,
Les
Re: Gathering Windows logon credentials
Posted by Scott Kub <ws...@gmail.com>.
Hey DJ,
Thanks for the pointers, it was great advice!
I did end up Kerberizing the thick client with JAAS and GSSAPI using SPNEGO.
It wasn't immediately obvious to me how helpful the JAAS Authentication
Tutorial at
http://download.oracle.com/javase/1.4.2/docs/guide/security/jaas/tutorials/GeneralAcnOnly.html
was going to be, but they have the majority of the code and config files
needed listed on that page. The thick client was actually pretty easy once I
wrapped my head around it. The most unfortunate drawback is that Microsoft
decided to tighten security as of Windows XP SP2 and the current
implementation (Java 6) of JAAS isn't able to grab all the information
necessary in the Kerberos ticket cache. The workaround is to edit a registry
key called AllowTgtSessionKey, which is a bummer.
The thin client ended up being a bit more tricky. I started off with JBoss'
Picket Link project and they document on their site that to use SPNEGO you
should use their Negotiate library. I was amazed that it actually had
documentation to follow for the setup and a couple of examples. A bit hasty
though - I followed the procudures to a T and it didn't work. Google'ing
around I found that a lot of others had suggestions on the correct way to
that library, but I didn't get those working quickly so I switched gears to
a library named SPNEGO, whose site is spnego.sourceforge.net. It seems like
a one man show, but the guy did a great job of documenting the setup, his
code is clean (it's open source), he wrote the library to do exactly what I
wanted, and... it works. It looks like CAS is more extensible, but there's
also also a lot more setup.
If anybody's struggling through this stuff and wants more detail on what I
did feel free to shout.
Thanks!
Scott
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Gathering-Windows-logon-credentials-tp5272872p5657209.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Gathering Windows logon credentials
Posted by "Daniel J. Lauk" <da...@gmail.com>.
Hi Scott
Active Directory uses Kerberos (V5, if I'm not mistaken) for
authentication. As Active Directory also offers an LDAP service, you
can of course also authenticate using LDAP.
As far as I know, the realms provided by Shiro hook up to the Active
Directory LDAP service. Therefore the credentials that the user
obtained when logging onto the computer are not available.
I therefore guess, that you want to "kerberize" your application,
which will give you the benefit of SSO (not only Web-SSO), or as
Microsoft calls it "Integrated Windows Authentication" (IIRC).
If you are developing a client application for the JVM, you'll need to
obtain the TGT from the ticket cache. I suggest to search the web for
combinations of the keywords "SPNEGO", "GSSAPI", "kerberos", "TGT"
(and "Java", of course).
If you want to kerberize a web-application instead, I suggest you put
your application server behind an Apache web server and kerberize the
web server. There are Apache httpd modules available, that do the hevy
lifting for you. Your application server and Apache httpd will
communicate using HTTP authentication mechanisms.
What might be even more appealing, if you have to do this for multiple
web applications, is installing a single Web-SSO provider (e.g. CAS),
kerberizing that, and hooking the web apps up to the Web-SSO provider.
I hope I could help you out a bit.
Cheers,
DJ