How to configure LDAP with Gitblit GO 1.1.0.

1,575 views
Skip to first unread message

sekar

unread,
Sep 14, 2012, 5:49:54 AM9/14/12
to git...@googlegroups.com
Hi,


I am new to Gitblit GO ,
I have installed Gitblit GO 1.1.0. on my windows pc as below and it is working fine. but  i am not succeed to configure ldap authentication .

Please let me know that what are the parameter I need to change/update in “gitblit.properties” file. Please help me.

   ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1. Download and unzip Gitblit GO 1.1.0.
    Its best to eliminate spaces in the path name.
  2. The server itself is configured through a simple text file.
    Open gitblit.properties in your favorite text editor and make sure to review and set:
    • git.repositoryFolder (path may be relative or absolute)
    • groovy.scriptsFolder (path may be relative or absolute)
    • groovy.grapeFolder (path may be relative or absolute)
    • server.tempFolder (path may be relative or absolute)
    • server.httpPort and server.httpsPort
    • server.httpBindInterface and server.httpsBindInterface
      https is strongly recommended because passwords are insecurely transmitted form your browser/git client using Basic authentication!
    • git.packedGitLimit (set larger than the size of your largest repository)
    • git.streamFileThreshold (set larger than the size of your largest committed file)
  3. Execute gitblit.cmd or java -jar gitblit.jar from a command-line
  4. Wait a minute or two while all dependencies are downloaded and your self-signed localhost certificate is generated.
    Please see the section titled Creating your own Self-Signed Certificate to generate a certificate for your hostname.
  5. Open your browser to http://localhost:8080 or https://localhost:8443 depending on your chosen configuration.
  6. Enter the default administrator credentials: admin / admin and click the Login button
    NOTE: Make sure to change the administrator username and/or password!!
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thank you
-sekar

John Crygier

unread,
Sep 14, 2012, 9:02:15 AM9/14/12
to git...@googlegroups.com
Hi-

Have you taken a look at the setup documentation:  http://gitblit.com/setup.html

It does a pretty good job at describing all of the settings and what you have to do.  You'll have to have good knowledge of your LDAP (or Active Directory) layout, as you need to provide the root nodes to start searching from, as well as the search criteria.

If you have specific questions, I'd be glad to help!

--John

sekar

unread,
Sep 14, 2012, 9:44:30 AM9/14/12
to git...@googlegroups.com
Hi Johan,

Thanks for replay.
yes, I followed the http://gitblit.com/setup.html
as per this link, i have changed/updated below parameter in “gitblit.properties”  file and restart the gitblit
after the restart, i am not able to login  as localuser account ( using admin/admin) as well as ldap user account (sekar) and getting below errors.
Please help me.
---------------------------------------------------------------------------------------------------------------------------
#LDAP configuration
---------------------------------------------------------------------------------------------------------------------------
realm.userService = com.gitblit.LdapUserService
realm.ldap.server = ldap://ldapserver.abc.com:3268
#"sekar" is a ldap  user and has persmission to read ldap database
realm.ldap.username = cn=sekar
realm.ldap.password = sekarloginpassword
realm.ldap.backingUserService = users.conf
# as idont want to use ldap group and i need to use ldap to check the authentication
realm.ldap.maintainTeams = false
realm.ldap.accountBase = DC=abc,DC=com
realm.ldap.accountPattern = (&(objectClass=person)(sAMAccountName=${username}))
realm.ldap.groupBase =
realm.ldap.groupMemberPattern = (&(objectClass=group)(member=${dn}))
# sekar is a user in ldap server
realm.ldap.admins = sekar
---------------------------------------------------------------------------------------------------------------------------
1. Error from browser
----------------------------------
Internal error

Return to home page
---------------------------------
1. Error from logs
E:\gitblit>java -jar gitblit.jar
INFO  ***********************************************************
INFO              _____  _  _    _      _  _  _
INFO             |  __ \(_)| |  | |    | |(_)| |
INFO             | |  \/ _ | |_ | |__  | | _ | |_
INFO             | | __ | || __|| '_ \ | || || __|
INFO             | |_\ \| || |_ | |_) || || || |_
INFO              \____/|_| \__||_.__/ |_||_| \__|
INFO                        Gitblit v1.1.0
INFO
INFO  ***********************************************************
INFO  Running on Windows 7 (6.1)
INFO  Setting up NIO SelectChannelConnector on port 8087
WARN  Binding connector on port 8087 to localhost.abc.com
INFO  Setting up NIO SslSelectChannelConnector on port 8443
INFO     allowing SSL renegotiation on Java 1.6.0_29
WARN  Binding ssl connector on port 8443 to localhost.abc.com
INFO  Reading configuration from E:\gitblit\gitblit.properties
INFO  Git repositories folder e:\git_rep
INFO  Identifying available repositories...
INFO  3 repositories identified with calculated folder sizes in 61 msecs
INFO  JVM timezone is Asia/Calcutta (IST +0530)
INFO  Gitblit timezone is Asia/Calcutta (IST +0530)
INFO  Setting up user service LdapUserService
INFO  LDAP User Service backed by ConfigUserService(E:\gitblit\users.conf)
INFO  Mail executor is scheduled to process the message queue every 2 minutes.
INFO  Lucene executor is scheduled to process indexed branches every 2 minutes.
WARN  Federation passphrase is blank! This server can not be PULLED from.
INFO  Shutdown Monitor listening on port 8082
INFO  jetty-7.4.3.v20110701
INFO  Extract jar:file:/E:/gitblit/gitblit.jar!/ to E:\gitblit\temp\webapp
INFO  NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
INFO  started o.e.j.w.WebAppContext{/,file:/E:/gitblit/temp/webapp/},file:/E:/gitblit/gitblit.jar
INFO  [GitBlitWebApp] init: Wicket core library initializer
INFO  [GitBlitWebApp] init: Wicket extensions initializer
INFO  [GitBlitWebApp] Started Wicket version 1.4.20 in deployment mode
INFO  Started SelectChann...@localhost.abc.com:8087 STARTING
INFO  Started SslSelectCha...@localhost.abc.com:8443 STARTING
INFO  0 repository models loaded for anonymous in 11 msecs
INFO  Loading properties files from

jar:file:/E:/gitblit/gitblit.jar!/com/gitblit/wicket/GitBlitWebApp.properties
INFO  0 repository models loaded for anonymous in 5 msecs
ERROR Method onFormSubmitted of interface org.apache.wicket.markup.html.form.IFormSubmitListener targeted at

component [Marku
pContainer [Component id = loginForm]] threw an exception
org.apache.wicket.WicketRuntimeException: Method onFormSubmitted of interface

org.apache.wicket.markup.html.form.IFormSubmitL
istener targeted at component [MarkupContainer [Component id = loginForm]] threw an exception
        at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:193)
        at org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents

(BookmarkableLi
stenerInterfaceRequestTarget.java:161)
        at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents

(AbstractRequestCycleProcessor.java:92)
        at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1279)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
        at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1323)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:476)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:937)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:871)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
        at org.eclipse.jetty.server.Server.handle(Server.java:346)
        at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:589)
        at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1065)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:823)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)
        at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:535)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)
        ... 29 more
Caused by: LDAPSDKUsageException(message='A null object was provided where a non-null object is required (non-

null index 0).
 Thread stack trace:  getStackTrace(Thread.java:1479) / ensureNotNull(Validator.java:119) / connect

(LDAPConnection.java:689)
/ connect(LDAPConnection.java:654) / <init>(LDAPConnection.java:486) / <init>(LDAPConnection.java:612) / <init>

(LDAPConnectio
n.java:513) / getLdapConnection(LdapUserService.java:87) / authenticate(LdapUserService.java:163) /

authenticate(GitBlit.java
:481) / onSubmit(RootPage.java:132) / delegateSubmit(Form.java:1595) / process(Form.java:960) / onFormSubmitted

(Form.java:922
) / invoke0(NativeMethodAccessorImpl.java) / invoke(NativeMethodAccessorImpl.java:39) / invoke

(DelegatingMethodAccessorImpl.j
ava:25) / invoke(Method.java:597) / invoke(RequestListenerInterface.java:182) / processEvents

(BookmarkableListenerInterfaceRe
questTarget.java:161) / processEvents(AbstractRequestCycleProcessor.java:92) / processEventsAndRespond

(RequestCycle.java:1279
) / step(RequestCycle.java:1358) / steps(RequestCycle.java:1465) / request(RequestCycle.java:545) / doGet

(WicketFilter.java:4
86) / doFilter(WicketFilter.java:319) / doFilter(ServletHandler.java:1323) / doHandle(ServletHandler.java:476) /

handle(Scope
dHandler.java:119) / handle(SecurityHandler.java:517) / doHandle(SessionHandler.java:225) / doHandle

(ContextHandler.java:937)
 / doScope(ServletHandler.java:406) / doScope(SessionHandler.java:183) / doScope(ContextHandler.java:871) /

handle(ScopedHand
ler.java:117) / handle(HandlerWrapper.java:110) / handle(Server.java:346) / handleRequest

(HttpConnection.java:589) / content(
HttpConnection.java:1065) / parseNext(HttpParser.java:823) / parseAvailable(HttpParser.java:220) / handle

(HttpConnection.java
:411) / handle(SelectChannelEndPoint.java:535) / run(SelectChannelEndPoint.java:40) / run

(QueuedThreadPool.java:529) / run(Th
read.java:662)')
        at com.unboundid.util.Validator.ensureNotNull(Validator.java:119)
        at com.unboundid.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:689)
        at com.unboundid.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:654)
        at com.unboundid.ldap.sdk.LDAPConnection.<init>(LDAPConnection.java:486)
        at com.unboundid.ldap.sdk.LDAPConnection.<init>(LDAPConnection.java:612)
        at com.unboundid.ldap.sdk.LDAPConnection.<init>(LDAPConnection.java:513)
        at com.gitblit.LdapUserService.getLdapConnection(LdapUserService.java:87)
        at com.gitblit.LdapUserService.authenticate(LdapUserService.java:163)
        at com.gitblit.GitBlit.authenticate(GitBlit.java:481)
        at com.gitblit.wicket.pages.RootPage$1.onSubmit(RootPage.java:132)
        at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1595)
        at org.apache.wicket.markup.html.form.Form.process(Form.java:960)
        at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:922)
        ... 34 more
----------------------------------------------------------------------------------------------------------------

John Crygier

unread,
Sep 14, 2012, 11:53:03 AM9/14/12
to git...@googlegroups.com
Hi-

From the looks of it, you're blowing up with parsing the URL (the host name and port).  It's more than likely the host name, as the port is defaulted.  This information comes from the realm.ldap.server property, and it uses the java URI API to pick it apart into a host name and port.  It then passes that to unboundid, and that's the part that's blowing up, it thinks that either the Host or Port is null.  You should review the entire properties file, and make sure you don't have repeating properties, or anything else strange like that.  The snippet you put above looks like it would work to me.

Hope this helps!
--John

sekar

unread,
Sep 17, 2012, 5:59:52 AM9/17/12
to git...@googlegroups.com
Hi John,
 

Thanks for your help!

I update the IP address instead of fully qualified name for  realm.ldap.server  value and now it is working fine.

 

 realm.ldap.server = ldap://10.11.12.13:1234

 realm.ldap.username = domainname\\userid

 

Thank you.

-sekar

 

Reply all
Reply to author
Forward
0 new messages