Skip to content

Commit

Permalink
Updates for Crowd 3.3 and phpBB 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Noxwizard committed Feb 24, 2020
1 parent 2d3be33 commit ae6aed6
Show file tree
Hide file tree
Showing 5 changed files with 249 additions and 114 deletions.
10 changes: 7 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# phpBB Directory Server for Atlassian Crowd
The phpBB Directory Server is in com.phpbb.crowd.phpBBDirectoryServer. It implements com.atlassian.crowd.integration.directory.RemoteDirectory and can easily be configured as a Directory in Crowd. It does not support any write operations.
The phpBB Directory Server is in `com.phpbb.crowd.phpBBDirectoryServer`. It implements `com.atlassian.crowd.integration.directory.RemoteDirectory` and can easily be configured as a Directory in Crowd. It does not support any write operations.

## Requirements
* Crowd: 3.3.3+
* phpBB: 3.3.0+

## Installing and Configuring the phpBB Directory Server
Install the Atlassian SDK. Using its atlas-package command you can easily build the phpbbauth jar file from the crowd-phpbb-auth directory. Place this jar file into crowd/webapp/WEB-INF/lib. Make sure to export the CROWD_PHPBB_ROOT_URL environment variable, it needs to contain the URL to the root of your phpBB board. Install the phpBB External Authentication API. In Crowd there is a top level Directories tab. Here you can add a new directory. In the "Implementation Class" field you have to fill in "com.phpbb.crowd.phpBBDirectoryServer". You should disable all possible write operations in the Permissions tab - even if you don't, all write operations will throw Exceptions. The directory server also does not support any attributes. So even if they show up in the GUI they will not be saved by phpBB.
Install the Atlassian SDK. Using its `atlas-package` command you can easily build the phpbbauth jar file from the `crowd-phpbb-auth` directory. Place this jar file into `crowd/webapp/WEB-INF/lib`. Make sure to export the `CROWD_PHPBB_ROOT_URL` environment variable, it needs to contain the URL to the root of your phpBB board. Install the phpBB External Authentication API. In Crowd there is a top level Directories tab. Here you can add a new directory. In the "Implementation Class" field you have to fill in "`com.phpbb.crowd.phpBBDirectoryServer`". You should disable all possible write operations in the Permissions tab - even if you don't, all write operations will throw Exceptions. The directory server also does not support any attributes. So even if they show up in the GUI they will not be saved by phpBB.

# phpBB External Authentication API
The API is rather simple for now. It consists of a single PHP file, to be placed in the phpBB root directory. The file replies to a number of POST requests. You can ask it to authenticate a user, password pair against the selected authentication method. You can query the user and group tables individually or join them to retrieve information about group memberships. The interface needs to be cleaned up after which it will make more sense to document all the functionality.
The API is rather simple for now. It consists of a single PHP file, to be placed in the phpBB root directory. Copy the values from `config.dist.php` into your board's `config.php`. The file replies to a number of POST requests. You can ask it to authenticate a user, password pair against the selected authentication method. You can query the user and group tables individually or join them to retrieve information about group memberships. The interface needs to be cleaned up after which it will make more sense to document all the functionality.
76 changes: 55 additions & 21 deletions crowd-phpbb-directory-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,87 @@
<modelVersion>4.0.0</modelVersion>
<groupId>phpbb</groupId>
<artifactId>phpbbauth</artifactId>
<version>1.2-SNAPSHOT</version>
<version>1.3-SNAPSHOT</version>

<organization>
<name>phpBB</name>
<url>http://www.phpbb.com/</url>
<url>https://www.phpBB.com/</url>
</organization>

<name>phpbbauth</name>
<description>This is the phpbb:phpbbauth plugin for Atlassian Crowd.</description>
<packaging>jar</packaging>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.atlassian.crowd</groupId>
<artifactId>atlassian-crowd</artifactId>
<version>${crowd.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.atlassian.crowd</groupId>
<artifactId>crowd-api</artifactId>
<version>2.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.crowd</groupId>
<artifactId>crowd-integration-api</artifactId>
<version>2.4.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>crowd-maven-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<source>1.6</source>
<target>1.6</target>
<productVersion>${crowd.version}</productVersion>
<productDataVersion>${crowd.data.version}</productDataVersion>
<enableQuickReload>true</enableQuickReload>

<!-- See here for an explanation of default instructions: -->
<!-- https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins -->
<instructions>
<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>

<!-- Add package to export here -->
<Export-Package>
com.phpbb.crowd,
</Export-Package>

<Import-Package>
*
</Import-Package>
</instructions>
<compilerArgument>-Xlint:all</compilerArgument>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<!--plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgument>-Xlint:all</compilerArgument>
</configuration>
</plugin-->
</plugins>
</build>

<properties>
<crowd.version>2.4.0</crowd.version>
<crowd.data.version>2.4.0</crowd.data.version>
<crowd.version>3.3.3</crowd.version>
<crowd.data.version>3.3.3</crowd.data.version>
<amps.version>8.0.0</amps.version>
<!-- This property ensures consistency between the key in atlassian-plugin.xml and the OSGi bundle's key. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

</project>
Loading

0 comments on commit ae6aed6

Please sign in to comment.