[xwiki-users] adding a custom jar / code
Hi all, I'm trying to extend the XWikiAuthServiceImpl as described here[1][2] to make use of local SSO. Here are the steps I'm following but xwiki will not startup.. Do I have somethings out of place in my steps? 1. Place my jar in ${XWIKI_HOME}/WEB-INF/lib jar named org.my.authenticator 2. Edit ${XWIKI_HOME/WEB-INF/xwiki.cfg inserting xwiki.authentication.authclass=org.my.authenticator.UserAuth 3. Start xwiki .. this fails! Do I have the jar in the correct place? Do I need to tell xwiki to enable the use of this "new" jar? My code does not do anything of importance right now.. It gets a Log object and writes one entry. [1] http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Authentication [2] http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/j... ------ thanks kevin.foote
On Wed, Mar 2, 2011 at 19:17, Kevin P. Foote <[email protected]> wrote:
Hi all,
I'm trying to extend the XWikiAuthServiceImpl as described here[1][2] to make use of local SSO.
You can find several SSO authenticators on https://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/authenticators/ You should take one and modify it for you own SSO. The most recent ones are probably NTLM and puma.
Here are the steps I'm following but xwiki will not startup.. Do I have somethings out of place in my steps?
1. Place my jar in ${XWIKI_HOME}/WEB-INF/lib jar named org.my.authenticator
2. Edit ${XWIKI_HOME/WEB-INF/xwiki.cfg inserting xwiki.authentication.authclass=org.my.authenticator.UserAuth
3. Start xwiki .. this fails!
Do I have the jar in the correct place?
Do I need to tell xwiki to enable the use of this "new" jar?
My code does not do anything of importance right now.. It gets a Log object and writes one entry.
[1] http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Authentication [2] http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/j...
------ thanks kevin.foote _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Thanks Thomas.. The resulting jar then would be dropped in as my steps below indicated right? ------ thanks kevin.foote On Wed, 2 Mar 2011, Thomas Mortagne wrote: -> On Wed, Mar 2, 2011 at 19:17, Kevin P. Foote <[email protected]> wrote: -> > -> > Hi all, -> > -> > I'm trying to extend the XWikiAuthServiceImpl as described here[1][2] to -> > make use of local SSO. -> -> You can find several SSO authenticators on -> https://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/authenticators/ -> -> You should take one and modify it for you own SSO. The most recent -> ones are probably NTLM and puma. -> -> > -> > Here are the steps I'm following but xwiki will not startup.. Do I have -> > somethings out of place in my steps? -> > -> > 1. Place my jar in ${XWIKI_HOME}/WEB-INF/lib jar named org.my.authenticator -> > -> > 2. Edit ${XWIKI_HOME/WEB-INF/xwiki.cfg inserting -> > xwiki.authentication.authclass=org.my.authenticator.UserAuth -> > -> > 3. Start xwiki .. this fails! -> > -> > Do I have the jar in the correct place? -> > -> > Do I need to tell xwiki to enable the use of this "new" jar? -> > -> > My code does not do anything of importance right now.. It gets a Log -> > object and writes one entry. -> > -> > -> > [1] http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Authentication -> > [2] -> > http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/j... -> > -> > ------ -> > thanks -> > kevin.foote -> > _______________________________________________ -> > users mailing list -> > [email protected] -> > http://lists.xwiki.org/mailman/listinfo/users -> > -> -> -> -> -- -> Thomas Mortagne -> _______________________________________________ -> users mailing list -> [email protected] -> http://lists.xwiki.org/mailman/listinfo/users ->
On Wed, Mar 2, 2011 at 19:50, Kevin P. Foote <[email protected]> wrote:
Thanks Thomas..
The resulting jar then would be dropped in as my steps below indicated right?
Yes.
------ thanks kevin.foote
On Wed, 2 Mar 2011, Thomas Mortagne wrote:
-> On Wed, Mar 2, 2011 at 19:17, Kevin P. Foote <[email protected]> wrote: -> > -> > Hi all, -> > -> > I'm trying to extend the XWikiAuthServiceImpl as described here[1][2] to -> > make use of local SSO. -> -> You can find several SSO authenticators on -> https://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/authenticators/ -> -> You should take one and modify it for you own SSO. The most recent -> ones are probably NTLM and puma. -> -> > -> > Here are the steps I'm following but xwiki will not startup.. Do I have -> > somethings out of place in my steps? -> > -> > 1. Place my jar in ${XWIKI_HOME}/WEB-INF/lib jar named org.my.authenticator -> > -> > 2. Edit ${XWIKI_HOME/WEB-INF/xwiki.cfg inserting -> > xwiki.authentication.authclass=org.my.authenticator.UserAuth -> > -> > 3. Start xwiki .. this fails! -> > -> > Do I have the jar in the correct place? -> > -> > Do I need to tell xwiki to enable the use of this "new" jar? -> > -> > My code does not do anything of importance right now.. It gets a Log -> > object and writes one entry. -> > -> > -> > [1] http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Authentication -> > [2] -> > http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/j... -> > -> > ------ -> > thanks -> > kevin.foote -> > _______________________________________________ -> > users mailing list -> > [email protected] -> > http://lists.xwiki.org/mailman/listinfo/users -> > -> -> -> -> -- -> Thomas Mortagne -> _______________________________________________ -> users mailing list -> [email protected] -> http://lists.xwiki.org/mailman/listinfo/users -> _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
On 03/02/2011 07:17 PM, Kevin P. Foote wrote:
Hi all,
I'm trying to extend the XWikiAuthServiceImpl as described here[1][2] to make use of local SSO.
Here are the steps I'm following but xwiki will not startup.. Do I have somethings out of place in my steps?
1. Place my jar in ${XWIKI_HOME}/WEB-INF/lib jar named org.my.authenticator
2. Edit ${XWIKI_HOME/WEB-INF/xwiki.cfg inserting xwiki.authentication.authclass=org.my.authenticator.UserAuth
3. Start xwiki .. this fails!
Can you provide a stacktrace with more details?
Do I have the jar in the correct place?
Yes.
Do I need to tell xwiki to enable the use of this "new" jar?
Jars don't need to be registered, but the authenticator does (which you did, step 2 abouve).
My code does not do anything of importance right now.. It gets a Log object and writes one entry.
Can't help more without a stacktrace...
[1] http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Authentication [2] http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/j...
-- Sergiu Dumitriu http://purl.org/net/sergiu/
-> Can you provide a stacktrace with more details? Not really... catalina.out shows nothing.. just ends after these few entries.. I have to kill -9 the java process afterwords. INFO: Deploying configuration descriptor ROOT.xml Mar 3, 2011 9:07:13 AM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart Mar 3, 2011 9:07:13 AM org.apache.catalina.core.StandardContext start SEVERE: Context [] startup failed due to previous errors Mar 3, 2011 9:07:13 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. I've looked aimlessly for the xwiki.log file but can not locate it. I've installed the log4j.properties file but seems to give me no more logging than without it. Perhaps I should try trunk.. I'm using 2.7 now @Thomas .. basically my jar build follows just as any of the examples at the contrib/sandbox/authenticators.. It just wont load and the wiki never fully starts up. ------ thanks kevin.foote On Thu, 3 Mar 2011, Sergiu Dumitriu wrote: -> On 03/02/2011 07:17 PM, Kevin P. Foote wrote: -> > -> > Hi all, -> > -> > I'm trying to extend the XWikiAuthServiceImpl as described here[1][2] to -> > make use of local SSO. -> > -> > Here are the steps I'm following but xwiki will not startup.. Do I have -> > somethings out of place in my steps? -> > -> > 1. Place my jar in ${XWIKI_HOME}/WEB-INF/lib jar named org.my.authenticator -> > -> > 2. Edit ${XWIKI_HOME/WEB-INF/xwiki.cfg inserting -> > xwiki.authentication.authclass=org.my.authenticator.UserAuth -> > -> > 3. Start xwiki .. this fails! -> -> Can you provide a stacktrace with more details? -> -> > Do I have the jar in the correct place? -> -> Yes. -> -> > Do I need to tell xwiki to enable the use of this "new" jar? -> -> Jars don't need to be registered, but the authenticator does (which you -> did, step 2 abouve). -> -> > My code does not do anything of importance right now.. It gets a Log -> > object and writes one entry. -> -> Can't help more without a stacktrace... -> -> > -> > [1] http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Authentication -> > [2] -> > http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/j... -> > -> -> -- -> Sergiu Dumitriu -> http://purl.org/net/sergiu/ -> _______________________________________________ -> users mailing list -> [email protected] -> http://lists.xwiki.org/mailman/listinfo/users ->
Oh yea.. I do not get any of those entries in catalina.out when I remove my jar from WEB-INF/lib Could this be a catalina.policy thing? ------ thanks kevin.foote On Thu, 3 Mar 2011, Kevin P. Foote wrote: -> -> -> Can you provide a stacktrace with more details? -> -> Not really... catalina.out shows nothing.. just ends after these few -> entries.. I have to kill -9 the java process afterwords. -> -> -> -> INFO: Deploying configuration descriptor ROOT.xml -> Mar 3, 2011 9:07:13 AM org.apache.catalina.core.StandardContext start -> SEVERE: Error listenerStart -> Mar 3, 2011 9:07:13 AM org.apache.catalina.core.StandardContext start -> SEVERE: Context [] startup failed due to previous errors -> Mar 3, 2011 9:07:13 AM org.apache.catalina.loader.WebappClassLoader -> clearReferencesJdbc -> SEVERE: The web application [] registered the JDBC driver -> [com.mysql.jdbc.Driver] but failed to unregister it when the web -> application was stopped. To prevent a memory leak, the JDBC Driver has -> been forcibly unregistered. -> -> -> I've looked aimlessly for the xwiki.log file but can not locate it. -> I've installed the log4j.properties file but seems to give me no more -> logging than without it. -> -> Perhaps I should try trunk.. I'm using 2.7 now -> -> @Thomas .. basically my jar build follows just as any of the -> examples at the contrib/sandbox/authenticators.. It just wont load and -> the wiki never fully starts up. -> -> ------ -> thanks -> kevin.foote -> -> On Thu, 3 Mar 2011, Sergiu Dumitriu wrote: -> -> -> On 03/02/2011 07:17 PM, Kevin P. Foote wrote: -> -> > -> -> > Hi all, -> -> > -> -> > I'm trying to extend the XWikiAuthServiceImpl as described here[1][2] to -> -> > make use of local SSO. -> -> > -> -> > Here are the steps I'm following but xwiki will not startup.. Do I have -> -> > somethings out of place in my steps? -> -> > -> -> > 1. Place my jar in ${XWIKI_HOME}/WEB-INF/lib jar named org.my.authenticator -> -> > -> -> > 2. Edit ${XWIKI_HOME/WEB-INF/xwiki.cfg inserting -> -> > xwiki.authentication.authclass=org.my.authenticator.UserAuth -> -> > -> -> > 3. Start xwiki .. this fails! -> -> -> -> Can you provide a stacktrace with more details? -> -> -> -> > Do I have the jar in the correct place? -> -> -> -> Yes. -> -> -> -> > Do I need to tell xwiki to enable the use of this "new" jar? -> -> -> -> Jars don't need to be registered, but the authenticator does (which you -> -> did, step 2 abouve). -> -> -> -> > My code does not do anything of importance right now.. It gets a Log -> -> > object and writes one entry. -> -> -> -> Can't help more without a stacktrace... -> -> -> -> > -> -> > [1] http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Authentication -> -> > [2] -> -> > http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/j... -> -> > -> -> -> -> -- -> -> Sergiu Dumitriu -> -> http://purl.org/net/sergiu/ -> -> _______________________________________________ -> -> users mailing list -> -> [email protected] -> -> http://lists.xwiki.org/mailman/listinfo/users -> -> -> _______________________________________________ -> users mailing list -> [email protected] -> http://lists.xwiki.org/mailman/listinfo/users ->
Does the new jar need to be a registered component? As indicated on this page http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents I've even stripped out all of my single .java file to a single checkAuth function.. (which does nothing BTW) still same effect .. Tomcat won't start.. but, removing my jar tomcat starts right up. I set up the package using the mvn archetype:generate syntax on the above page. ------ thanks kevin.foote On Thu, 3 Mar 2011, Kevin P. Foote wrote: -> -> Oh yea.. I do not get any of those entries in catalina.out when I remove -> my jar from WEB-INF/lib -> -> Could this be a catalina.policy thing? -> -> ------ -> thanks -> kevin.foote -> -> On Thu, 3 Mar 2011, Kevin P. Foote wrote: -> -> -> -> -> -> Can you provide a stacktrace with more details? -> -> -> -> Not really... catalina.out shows nothing.. just ends after these few -> -> entries.. I have to kill -9 the java process afterwords. -> -> -> -> -> -> -> -> INFO: Deploying configuration descriptor ROOT.xml -> -> Mar 3, 2011 9:07:13 AM org.apache.catalina.core.StandardContext start -> -> SEVERE: Error listenerStart -> -> Mar 3, 2011 9:07:13 AM org.apache.catalina.core.StandardContext start -> -> SEVERE: Context [] startup failed due to previous errors -> -> Mar 3, 2011 9:07:13 AM org.apache.catalina.loader.WebappClassLoader -> -> clearReferencesJdbc -> -> SEVERE: The web application [] registered the JDBC driver -> -> [com.mysql.jdbc.Driver] but failed to unregister it when the web -> -> application was stopped. To prevent a memory leak, the JDBC Driver has -> -> been forcibly unregistered. -> -> -> -> -> -> I've looked aimlessly for the xwiki.log file but can not locate it. -> -> I've installed the log4j.properties file but seems to give me no more -> -> logging than without it. -> -> -> -> Perhaps I should try trunk.. I'm using 2.7 now -> -> -> -> @Thomas .. basically my jar build follows just as any of the -> -> examples at the contrib/sandbox/authenticators.. It just wont load and -> -> the wiki never fully starts up. -> -> -> -> ------ -> -> thanks -> -> kevin.foote -> -> -> -> On Thu, 3 Mar 2011, Sergiu Dumitriu wrote: -> -> -> -> -> On 03/02/2011 07:17 PM, Kevin P. Foote wrote: -> -> -> > -> -> -> > Hi all, -> -> -> > -> -> -> > I'm trying to extend the XWikiAuthServiceImpl as described here[1][2] to -> -> -> > make use of local SSO. -> -> -> > -> -> -> > Here are the steps I'm following but xwiki will not startup.. Do I have -> -> -> > somethings out of place in my steps? -> -> -> > -> -> -> > 1. Place my jar in ${XWIKI_HOME}/WEB-INF/lib jar named org.my.authenticator -> -> -> > -> -> -> > 2. Edit ${XWIKI_HOME/WEB-INF/xwiki.cfg inserting -> -> -> > xwiki.authentication.authclass=org.my.authenticator.UserAuth -> -> -> > -> -> -> > 3. Start xwiki .. this fails! -> -> -> -> -> -> Can you provide a stacktrace with more details? -> -> -> -> -> -> > Do I have the jar in the correct place? -> -> -> -> -> -> Yes. -> -> -> -> -> -> > Do I need to tell xwiki to enable the use of this "new" jar? -> -> -> -> -> -> Jars don't need to be registered, but the authenticator does (which you -> -> -> did, step 2 abouve). -> -> -> -> -> -> > My code does not do anything of importance right now.. It gets a Log -> -> -> > object and writes one entry. -> -> -> -> -> -> Can't help more without a stacktrace... -> -> -> -> -> -> > -> -> -> > [1] http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Authentication -> -> -> > [2] -> -> -> > http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/j... -> -> -> > -> -> -> -> -> -> -- -> -> -> Sergiu Dumitriu -> -> -> http://purl.org/net/sergiu/ -> -> -> _______________________________________________ -> -> -> users mailing list -> -> -> [email protected] -> -> -> http://lists.xwiki.org/mailman/listinfo/users -> -> -> -> -> _______________________________________________ -> -> users mailing list -> -> [email protected] -> -> http://lists.xwiki.org/mailman/listinfo/users -> -> -> _______________________________________________ -> users mailing list -> [email protected] -> http://lists.xwiki.org/mailman/listinfo/users ->
On 03/03/2011 10:36 PM, Kevin P. Foote wrote:
Does the new jar need to be a registered component?
As indicated on this page http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents
I've even stripped out all of my single .java file to a single checkAuth function.. (which does nothing BTW) still same effect ..
Tomcat won't start.. but, removing my jar tomcat starts right up.
I set up the package using the mvn archetype:generate syntax on the above page.
An authenticator must not be a component, but it has to correctly implement the com.xpn.xwiki.user.api.XWikiAuthService interface. The best way forward is to start by extending com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl without any actual method overrides, then try to put the resulting jar in place. If you get an error, then something is terribly messed up. If not, you can then override checkAuth and incrementally check if so far you get errors or not.
------ thanks kevin.foote
On Thu, 3 Mar 2011, Kevin P. Foote wrote:
-> -> Oh yea.. I do not get any of those entries in catalina.out when I remove -> my jar from WEB-INF/lib -> -> Could this be a catalina.policy thing? -> -> ------ -> thanks -> kevin.foote -> -> On Thu, 3 Mar 2011, Kevin P. Foote wrote: -> -> -> -> -> -> Can you provide a stacktrace with more details? -> -> -> -> Not really... catalina.out shows nothing.. just ends after these few -> -> entries.. I have to kill -9 the java process afterwords. -> -> -> -> -> -> -> -> INFO: Deploying configuration descriptor ROOT.xml -> -> Mar 3, 2011 9:07:13 AM org.apache.catalina.core.StandardContext start -> -> SEVERE: Error listenerStart -> -> Mar 3, 2011 9:07:13 AM org.apache.catalina.core.StandardContext start -> -> SEVERE: Context [] startup failed due to previous errors -> -> Mar 3, 2011 9:07:13 AM org.apache.catalina.loader.WebappClassLoader -> -> clearReferencesJdbc -> -> SEVERE: The web application [] registered the JDBC driver -> -> [com.mysql.jdbc.Driver] but failed to unregister it when the web -> -> application was stopped. To prevent a memory leak, the JDBC Driver has -> -> been forcibly unregistered. -> -> -> -> -> -> I've looked aimlessly for the xwiki.log file but can not locate it. -> -> I've installed the log4j.properties file but seems to give me no more -> -> logging than without it. -> -> -> -> Perhaps I should try trunk.. I'm using 2.7 now -> -> -> -> @Thomas .. basically my jar build follows just as any of the -> -> examples at the contrib/sandbox/authenticators.. It just wont load and -> -> the wiki never fully starts up. -> -> -> -> ------ -> -> thanks -> -> kevin.foote -> -> -> -> On Thu, 3 Mar 2011, Sergiu Dumitriu wrote: -> -> -> -> -> On 03/02/2011 07:17 PM, Kevin P. Foote wrote: -> -> -> > -> -> -> > Hi all, -> -> -> > -> -> -> > I'm trying to extend the XWikiAuthServiceImpl as described here[1][2] to -> -> -> > make use of local SSO. -> -> -> > -> -> -> > Here are the steps I'm following but xwiki will not startup.. Do I have -> -> -> > somethings out of place in my steps? -> -> -> > -> -> -> > 1. Place my jar in ${XWIKI_HOME}/WEB-INF/lib jar named org.my.authenticator -> -> -> > -> -> -> > 2. Edit ${XWIKI_HOME/WEB-INF/xwiki.cfg inserting -> -> -> > xwiki.authentication.authclass=org.my.authenticator.UserAuth -> -> -> > -> -> -> > 3. Start xwiki .. this fails! -> -> -> -> -> -> Can you provide a stacktrace with more details? -> -> -> -> -> -> > Do I have the jar in the correct place? -> -> -> -> -> -> Yes. -> -> -> -> -> -> > Do I need to tell xwiki to enable the use of this "new" jar? -> -> -> -> -> -> Jars don't need to be registered, but the authenticator does (which you -> -> -> did, step 2 abouve). -> -> -> -> -> -> > My code does not do anything of importance right now.. It gets a Log -> -> -> > object and writes one entry. -> -> -> -> -> -> Can't help more without a stacktrace... -> -> -> -> -> -> > -> -> -> > [1] http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Authentication -> -> -> > [2] -> -> -> > http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/j... -> -> -> > -> -> ->
-- Sergiu Dumitriu http://purl.org/net/sergiu/
participants (3)
-
Kevin P. Foote -
Sergiu Dumitriu -
Thomas Mortagne