AnsweredAssumed Answered

Database - Windows authentication support

Question asked by Shashi Kumar N G on Dec 20, 2016
Latest reply on Dec 21, 2016 by Hiren

I am facing an issue using windows integrated authentication for MS SQLServer using JTDS.

 

Installation details:

 

Openfire version:  3.9.3

Conf file entry  :  openfire.xml.

 

 

<?xml version="1.0" encoding="UTF-8"?>

<jive>

  <adminConsole>

    <!-- Disable either port by setting the value to -1 --> 

    <port>9090</port> 

    <securePort>9091</securePort>

  </adminConsole> 

  <locale>en</locale> 

  <connectionProvider>

    <className>org.jivesoftware.database.DefaultConnectionProvider</className>

  </connectionProvider> 

  <database>

    <defaultProvider>

      <driver>net.sourceforge.jtds.jdbc.Driver</driver> 

      <serverURL>jdbc:jtds:sqlserver://localhost/ChatDB;appName=jive;ssl=request;useN TLMv2=true</serverURL>  

      <testSQL>select 1</testSQL> 

      <testBeforeUse>false</testBeforeUse> 

      <testAfterUse>false</testAfterUse> 

      <minConnections>5</minConnections> 

      <maxConnections>25</maxConnections> 

      <connectionTimeout>1.0</connectionTimeout>

    </defaultProvider>

  </database> 

  <setup>true</setup> 

  <hybridAuthProvider>

    <primaryProvider/> 

    <secondaryProvider/>

  </hybridAuthProvider> 

  <provider>

    <auth/>

  </provider> 

  <xmpp>

    <auth>

      <autoadd>true</autoadd>

    </auth>

  </xmpp>

</jive>

 

 

Observation: When I value username/password with valid user in “openfire.xml” openfire starts fine, though , I see database user as windows user in  Admin page.

If I remove entries for username/password  OR make it empty OR make entry for wrong username/password “openfire.xml”, I see below error.

Need your help in fixing the same.  

 

  1. 2016.12.20 20:07:35 org.jivesoftware.util.JiveProperties - Violation of PRIMARY KEY constraint 'ofProperty_pk'. Cannot insert duplicate key in object 'dbo.ofProperty'. The duplicate key value is (xmpp.session.conflict-limit).
  2. java.sql.SQLException: Violation of PRIMARY KEY constraint 'ofProperty_pk'. Cannot insert duplicate key in object 'dbo.ofProperty'. The duplicate key value is (xmpp.session.conflict-limit).

at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)

at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)

at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)

at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)

at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)

at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)

at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedState ment.java:505)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100)

at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57)

at $java.sql.Statement$$EnhancerByProxool$$8ebad043.executeUpdate(<generated>)

at org.jivesoftware.util.JiveProperties.insertProperty(JiveProperties.java:293)

at org.jivesoftware.util.JiveProperties.put(JiveProperties.java:234)

at org.jivesoftware.util.JiveGlobals.setProperty(JiveGlobals.java:734)

at org.jivesoftware.openfire.SessionManager.initialize(SessionManager.java:1300)

at org.jivesoftware.openfire.XMPPServer.initModules(XMPPServer.java:591)

at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:477)

at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:197)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:113)

at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:58)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)

at com.exe4j.runtime.WinLauncher$2.run(Unknown Source)

 

 

Outcomes