seiffert / crowd-rest-bundle
This bundle provides a simple API for Atlassian Crowd's REST API.
dev-master
2014-07-28 21:43 UTC
Requires
- php: >=5.3.3
- guzzle/guzzle: *
- symfony/symfony: >=2.2.0,<2.3
Requires (Dev)
- pdepend/pdepend: 1.1.0
- phpmd/phpmd: 1.4.0
- phpunit/php-code-coverage: 1.2.*
- phpunit/php-timer: 1.0.4
- phpunit/phpunit: 3.7.*
- squizlabs/php_codesniffer: *
This package is not auto-updated.
Last update: 2024-12-21 15:18:56 UTC
README
This bundle provides a simple API for Atlassian Crowd's REST API.
Installation
Require the package via composer:
composer.json
:
"require": {
...
"seiffert/crowd-rest-bundle": "dev-master",
...
}
Activate the bundle in your AppKernel:
app/AppKernel.php
:
public function registerBundles()
{
$bundles = array(
...
new Seiffert\CrowdRestBundle\SeiffertCrowdRestBundle(),
...
);
...
}
Configuration
To connect to your organization's Crowd instance, you have to add some entries to your project configuration (e.g. in
app/config/config.yml
):
seiffert_crowd_rest:
url: https://<crowd-url>/crowd/rest/usermanagement/1
application:
name: <application-name>
password: <application-password>
- crowd-url: Your Crowd instance's Url/Hostname.
- application-name: The name of your application registered in Crowd.
- application-password: The password of your application registered in Crowd.
Usage
After installing and configuring the bundle, you can use the Crowd API by injecting the service seiffert.crowd
into
each client object. The injected object is of type Seiffert\CrowdRestBundle\Crowd
and currently provides the following
methods:
getUser($username)
: Returns an instance ofSeiffert\CrowdRestBundle\Crowd\UserInterface
if the username matches a user record in Crowd. If not, aUserNotFoundException
is being thrown.isAuthenticationValid($username, $password)
: Returns true if the username and password match a user record in Crowd, false otherwise.