SAML plugin available?

Hi all,
I would like to know if people are still using the SAML plugin provided by GitHub - xwiki-contrib/authenticator-saml: XWiki authentication using SAML

Is it still working with the current version? Are there any other alternatives ?

Thanks.

it seems I cannot compile the plugin with Maven…

What error do you get? Did you follow https://dev.xwiki.org/xwiki/bin/view/Community/Building/ ?

I compile it inside a docker container, and this is the error when mvn clean install

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.575 s
[INFO] Finished at: 2019-01-21T15:05:00Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project xwiki-authenticator-saml: Could not resolve dependencies for project org.xwiki.contrib.authentication:xwiki-authenticator-saml:jar:1.0-SNAPSHOT: Could not find artifact org.xwiki.platform:xwiki-platform-oldcore:jar:5.4.6 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
root@21bad658572f:/auth#

I think this error matches what I mentioned above, you need to read https://dev.xwiki.org/xwiki/bin/view/Community/Building/ and setup Maven properly (see the settings.xml info there to add the XWiki maven repo).

But you are right, I didn’t have the settings.xml properly configured. Now I am compiling it with it and it succeed.

Now I have set up a local maven repo to install extensions from, as per the instructions:

but I get this error:


Could not find artifact org.xwiki.contrib.authentication:xwiki-authenticator-saml:jar:jar:1.0-SNAPSHOT in local (file:///usr/local/repo)
class org.xwiki.extension.repository.LocalExtensionRepositoryException: Failed to save extension [org.xwiki.contrib.authentication:xwiki-authenticator-saml:jar/1.0-SNAPSHOT] descriptor
    at org.xwiki.extension.repository.internal.local.DefaultLocalExtensionRepository.storeExtension(DefaultLocalExtensionRepository.java:188)
    at org.xwiki.extension.job.internal.InstallJob.storeExtension(InstallJob.java:186)
    at org.xwiki.extension.job.internal.InstallJob.store(InstallJob.java:171)
    at org.xwiki.extension.job.internal.InstallJob.runInternal(InstallJob.java:140)
    at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
    at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: class java.io.IOException: Failed to resolve artifact
    at org.xwiki.extension.repository.aether.internal.AetherExtensionFile.openStream(AetherExtensionFile.java:124)
    at org.xwiki.extension.repository.internal.local.DefaultLocalExtensionRepository.storeExtension(DefaultLocalExtensionRepository.java:175)
    at org.xwiki.extension.job.internal.InstallJob.storeExtension(InstallJob.java:186)
    at org.xwiki.extension.job.internal.InstallJob.store(InstallJob.java:171)
    at org.xwiki.extension.job.internal.InstallJob.runInternal(InstallJob.java:140)
    at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
    at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: class org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact org.xwiki.contrib.authentication:xwiki-authenticator-saml:jar:jar:1.0-SNAPSHOT in local (file:///usr/local/repo)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:294)
    at org.xwiki.extension.repository.aether.internal.AetherExtensionFile.openStream(AetherExtensionFile.java:122)
    at org.xwiki.extension.repository.internal.local.DefaultLocalExtensionRepository.storeExtension(DefaultLocalExtensionRepository.java:175)
    at org.xwiki.extension.job.internal.InstallJob.storeExtension(InstallJob.java:186)
    at org.xwiki.extension.job.internal.InstallJob.store(InstallJob.java:171)
    at org.xwiki.extension.job.internal.InstallJob.runInternal(InstallJob.java:140)
    at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
    at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: class org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.xwiki.contrib.authentication:xwiki-authenticator-saml:jar:jar:1.0-SNAPSHOT in local (file:///usr/local/repo)
    at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:39)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
    at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:294)
    at org.xwiki.extension.repository.aether.internal.AetherExtensionFile.openStream(AetherExtensionFile.java:122)
    at org.xwiki.extension.repository.internal.local.DefaultLocalExtensionRepository.storeExtension(DefaultLocalExtensionRepository.java:175)
    at org.xwiki.extension.job.internal.InstallJob.storeExtension(InstallJob.java:186)
    at org.xwiki.extension.job.internal.InstallJob.store(InstallJob.java:171)
    at org.xwiki.extension.job.internal.InstallJob.runInternal(InstallJob.java:140)
    at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
    at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Finished job of type [install] with identifier [extension/action/org.xwiki.contrib.authentication:xwiki-authenticator-saml:jar/wiki:xwiki]

Hi, either you have an error in your xwiki.properties file for the def of the extension repos (can you paste what you have?) or the artifact has not been installed in your local repo (can you “ls” to see if the artifact is there and where?).

Hi,
thanks. Here is the repo:

root@5e75cb47d40b:/usr/local/repo/org/xwiki/contrib/authentication/xwiki-authenticator-saml/1.0-SNAPSHOT# ls -l
total 44
-rw-r--r-- 1 root root   228 Jan 21 17:07 _remote.repositories
-rw-r--r-- 1 root root   736 Jan 21 17:07 maven-metadata-local.xml
-rw-r--r-- 1 root root 26070 Jan 21 17:07 xwiki-authenticator-saml-1.0-SNAPSHOT.jar
-rw-r--r-- 1 root root  2295 Jan 21 17:07 xwiki-authenticator-saml-1.0-SNAPSHOT.pom

and the xwiki.properties (just a bit, it exceed the max characters limit):

# cat /usr/local/xwiki/data/xwiki.properties 
#-------------------------------------------------------------------------------------
# Extension Manager
#-------------------------------------------------------------------------------------

#-# [Since 2.5]
#-# Repositories to use when searching and downloading extensions.
#-# Repositories will be checked in the same order they have in this configuration file.
#-#
#-# The format is <id>:<type>:<url> where
#-# * id can be anything as long as there is only one
#-# * type is the type of the repository (maven, xwiki, etc.)
#-# * url is the URL or the root of the repository
#-#
#-# [Since 4.3] It's also possible to associate various properties to each repository.
#-# Here are the standard properties:
#-# * user: the user to use to authenticate to the repository
#-# * password: the password to use to authenticate to the repository
#-#
#-# Here is an example:
# extension.repositories=privatemavenid:maven:http://host.com/private/maven/
# extension.repositories.privatemavenid.auth.user=someuser
# extension.repositories.privatemavenid.auth.password=thepassword
#-#
#-# Here's an example to add your local Maven Repository
# extension.repositories=maven-local:maven:file://${sys:user.home}/.m2/repository
#-#
#-# And an example to add the XWiki Maven Snapshot Repository
# extension.repositories=maven-xwiki-snapshot:maven:http://nexus.xwiki.org/nexus/content/groups/public-snapshots
#-#
#-# When not set the following is taken (in this order): SAML
extension.repositories=local:maven:file:///usr/local/repo
extension.repositories=maven-xwiki:maven:http://nexus.xwiki.org/nexus/content/groups/public
# extension.repositories=store.xwiki.com:xwiki:https://store.xwiki.com/xwiki/rest/
 extension.repositories=extensions.xwiki.org:xwiki:http://extensions.xwiki.org/xwiki/rest/
#-#
#-# To not have any repository enabled (including disabling default repositories) you can explicitly make this list empty:
# extension.repositories=

#-# [Since 2.5]
#-# The directory where extensions are stored after being downloaded.
#-#
#-# The default is extension/repository in whatever is the general persistent directory.
#-# See container.persistentDirectory.
# extension.localRepository=extension/repository

#-# [Since 3.4]
#-# The user agent to use when communication with external services (generally repositories).
#-#
#-# The default is:
# extension.userAgent=XWikiExtensionManager

#-# [Since 7.1RC1]
#-# Some extensions considered now as flavor but released before the category exists
#-#
extension.oldflavors=org.xwiki.enterprise:xwiki-enterprise-ui-mainwiki
extension.oldflavors=org.xwiki.enterprise:xwiki-enterprise-ui-wiki
extension.oldflavors=org.xwiki.manager:xwiki-enterprise-ui
extension.oldflavors=org.xwiki.manager:xwiki-manager-wiki-administrator
extension.oldflavors=org.xwiki.manager:xwiki-enterprise-manager-wiki-administrator
extension.oldflavors=com.xpn.xwiki.products:xwiki-enterprise-manager-wiki-administrator

#-# [Since 8.3]
#-# Indicate if XWiki should try to find more informations about the core extension in the repositories.
#-#
#-# The default is:
# extension.core.resolve=true

#-# [Since 9.6]
#-# Indicate a list of pattern extension ids and the corresponding recommended version.
#-# This version will be used for dependencies matching the pattern and fallback on the version declared by the extension in case of failure.
#-#
#-# Here is an example:
# extension.recommendedVersions=org.xwiki.commons:.*/[9.6]
# extension.recommendedVersions=org.xwiki.rendering:.*/[9.6]
# extension.recommendedVersions=org.xwiki.platform:.*/[9.6]
# extension.recommendedVersions=com.mygroupid:.*/[1.9]

#-# [Since 9.9]
#-# Indicate whether the server should automatically check for new available environment versions.
#-#
#-# The default is:
# extension.versioncheck.environment.enabled=false
#-#
#-# If the version check is enabled (through extension.versioncheck.environment.enabled), the following properties
#-# can be used to customize how the version check is performed.
#-#
#-# Indicate the number of seconds between each check for a new version of the server.
#-# The default is:
# extension.versioncheck.environment.interval=3600
#-#
#-# Indiicate a pattern that will be used to filter which version should be considered as a new version.
#-# By default, no pattern is given an the pattern is not applied.
#-# Example:
# extension.versioncheck.environment.allowedVersions=9.*

#-------------------------------------------------------------------------------------
# Distribution Wizard
#-------------------------------------------------------------------------------------

#-# [Since 7.1RC1] Enable or disable the automatic start of Distribution Wizard on empty/outdated wiki.
#-#
#-# The default is:
# distribution.automaticStartOnMainWiki=true
# distribution.automaticStartOnWiki=true


Looks good.

By default Maven will find the local repository at ~/.m2 (i.e in user home directory). Where did you tell Maven to use /usr/local/repo?

Here, actually the only 3 lines I’ve modified

Yes you’re right, this should be enough from XWiki’s POV.

Now there seems to be something strange in the artifact “id”: `org.xwiki.contrib.authentication:xwiki-authenticator-saml:jar:jar:1.0-SNAPSHOT``

Maybe you made a mistake and added a <qualifier> in your pom.xml using this dependency?

Pom.xml is directly pulled from the github repo:

But I have noticed that .jar appears twice in the artifact id, but I am not familiar with java/mvn…

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.xwiki.commons</groupId>
    <artifactId>xwiki-commons-pom</artifactId>
    <version>5.4.6</version>
  </parent>
  <groupId>org.xwiki.contrib.authentication</groupId>
  <artifactId>xwiki-authenticator-saml</artifactId>
  <name>xwiki-authentication-saml</name>
  <version>1.0-SNAPSHOT</version>
  <description>XWiki authentication using SAML</description>
  <dependencies>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-oldcore</artifactId>
      <version>${project.parent.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.opensaml</groupId>
      <artifactId>opensaml</artifactId>
      <version>2.6.1</version>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>

This is the pom.xml to build xwiki-authenticator-saml. What do you install in XWiki and how you do that? Using Advanced Search? Using another extension that depends on this one?

Right, this is what I am trying to build, and yes, I am trying to install it using advanced search , as per the docs.

Can you tell us what you input in the 2 fields of “advanced search”?

org.xwiki.contrib.authentication:xwiki-authenticator-saml:jar
1.0-SNAPSHOT

And then I can see the plugin and hit install.

image

ok that’s the problem! :slight_smile:

You need to use org.xwiki.contrib.authentication:xwiki-authenticator-saml.

Thanks! I am going to check it. I just installed it and worked, but upper right corner drops this error.

Installed but not valid

Let see if it still works.

image