On 03/04/2014 02:12 PM, Daniel Ebanja wrote:
  Hallo xwiki-users,
 i have a webapplication from which i direct users to XWIKI through a link.
 The idea i have now is using basic Authentication:
 http://
 username:password@mywiki.xwiki.com/xwiki/bin/view/Main/WebHome?basicauth=1
 The problem here is i am using username:OID in the url above.
 I will like to customize the basic authentication such that i can use the
 OID to get userpassword from a database. Register the user in xwiki if it's
 the first time getting to xwiki and login if user already exist.
 The two apps are running in tomcat and on debian OS.
 I tried to write a java class(with eclipse on windows) extending the
 XWikiAuthServiceImpl class. Eclipse did not recognise the packages.Could i
 get the packages from somewhere? Is there a way to test an implementation?
  
Yes, you can ;)
The best way (IMO) to do that is to add XWiki as a maven dependency,
i.e. adding to your pom.xml something like:
        <dependencies>
                <dependency>
                        <!-- XWikiAuthServiceImpl is in this package -->
                        <groupId>org.xwiki.platform</groupId>
                        <artifactId>xwiki-platform-oldcore</artifactId>
                        <version>5.4.2</version>
                </dependency>
                [...]
But you probably did not set up your project with maven, because all you want
is to write that single auth-class ... so for a "quick and dirty" approach ...
what you can do is:
  - get the "standalone" distribution,
  - unzip it somewhere
  - inside the unzipped xwiki-enterprise-jetty-hsqldb-x.y.z
    add all files in the webapps/xwiki/WEB-INF/lib to the eclipse classpath
    (just add all for simplicity, as we talk about "quick and dirty" ;)
Afterwards you should be able to compile your custom XWikiAuthServiceImpl class,
and place the generated class-file in the WEB-INF/classes folder