Issue Details (XML | Word | Printable)

Key: JRA-3907
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: joe dane
Votes: 2
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
JIRA

LDAP authentication

Created: 09/Jun/04 02:03 PM   Updated: 26/May/08 06:02 AM
Component/s: Extensions, User Management
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. GZip Archive hawaii-jira-ldap.tar.gz (9 kB)

Issue Links:
Reference
 

Participants: Amdocs Company and joe dane
Since last comment: 2 years, 8 weeks, 4 days ago
Support reference count: 5
Labels:


 Description  « Hide
attached is some code to do LDAP authentication in JIRA in an interesting way.

the idea is to use LDAP "lazily". Here's the text of a message to jira-user that describes the basic idea:

====================
the way we chose to manage this was to leave "external user
management" OFF, and to write a custom "credentials provider" that
worked the way we wanted.

it was not completely simple, because of how the osuser framework
works, but we managed to more or less get it working the way we
wanted.

our LDAP credentials provider contains a reference to an "underlying"
OfBiz (standard) credentials provider. it works by first
authenticating the user against LDAP, then:

if the authentication was successful
if the user exists in the underlying provider
succeed
else
create the user in the underlying provider, using info from LDAP,
and succeed
else
if the user exists in the underlying provider
if we can authenticate the user in the underlying provider
succeed
else
fail

this means that users are created in JIRA's database on-demand. it
also means that if our LDAP goes down, people with existing JIRA
accounts can still login to JIRA, using their passwords in the
underlying provider. which is nice since we use JIRA (among other
things) to report system/network problems with things like LDAP
servers.

one problem (and here my memory fails a bit, so I might get some
details wrong) is that we still can't use JIRA's Add User feature
directly. There should be no reason why this wouldn't work, but a
quirk in the OSUser framework prevents it. Basically (again, IIRC)
there is a "handles" method that providers need to implement, and
this method is called with the username before any other methods
(authenticate, create, etc.) are called. When adding a user (this is
assuming we're using the same uid as in LDAP) the framework first
checks if our provider handles that UID. since it does (the uid
already exists in LDAP) it doesn't make sense to create it, so the
Add User fails, even though the user doesn't exist in the underlying
provider.

this isn't a big deal, usually, since people can just login on their
own and everything will be created for them. the only problem is if
you (the admin) wanted to create a user and add them to some groups.

to get around this, we also wrote a "backdoor" action, accessible
from the web but not part of JIRA's main interface, that can
manipulate the ofbiz database more or less directly. we use this if
we need to add new users to specific groups.

====================



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
joe dane added a comment - 09/Jun/04 02:04 PM
the code, plus a maven project descriptor to build it.

joe dane added a comment - 09/Jun/04 02:06 PM
contributed code that implements a certain LDAP integration scheme

Amdocs Company added a comment - 09/Aug/06 06:13 AM
I tried to implement it on our Jira it didn't work for me
I got
2006-08-09 13:56:00,678 ERROR [opensymphony.user.util.ConfigLoader] Could not create instance of authenticator
java.lang.ClassCastException: com.opensymphony.module.user.authenticator.SmartAuthenticator

we have Jira 3.6, I suspect it can't be support for this version, am I right ?
Meir Ivgi