On 10/24/13 9:59 AM, John wrote:
> In lib/Pmp/Sdk/AuthClient.php:
>
>> +        if (!isset($options['username']) || !isset($options['password'])) {
>> +            throw new Exception("username and password required");
>> +        }
>> +        $username = $options['username'];
>> +        $password = $options['password'];
>> +        $scope    = isset($options['scope']) ? $options['scope'] : 'read';
>> +        $expires  = isset($options['expires']) ? $options['expires'] : 86400;
>> +        $label    = isset($options['label']) ? $options['label'] : 'null';
>> +
>> +        $uri      = $this->authUri . '/auth/credentials';
>> +        $hash     = base64_encode($username . ':' . $password);
>> +        $request  = new Request();
>> +        $response = $request->header('Authorization', 'Basic ' . $hash)
>> +                            ->header('Content-Type', 'application/x-www-form-urlencoded')
>> +                            ->header('Accept', 'application/json')
>> +                            ->data('scope', $scope)
>
> Again I would recommend only setting these values if they were set,
> otherwise take the default
>

I didn't see what the API defaults are, in the documentation:
https://github.com/publicmediaplatform/pmpdocs/wiki/Authentication-Model#issue-new-client-credentials

So I defined what I thought were some sane defaults for the purposes I 
was after. I'm happy to change it to the API defaults, if those were 
documented.


-- 
Peter Karman
651.228.4972 (o)  651.208.6116 (m)  peter.karman.apm (skype)
Minnesota Public Radio | American Public Media