Closed nurettintopal closed 8 years ago
@nurettintopal
I cant seem to re-produce this error. Can you give me step by step what you did here so I can try to troubleshoot this.
Here are the steps that I did.
laravel new test
composer.json
"stormpath/laravel": "^0.4"
to require
section and save filecomposer update
config/app.php
Stormpath\Laravel\Support\StormpathLaravelServiceProvider::class,
at the bottom of the providers
section and savephp artisan optimize
This seems to work on my end. If you have any error logs that is more than what shows in terminal, Please send those along and I can take a look at them.
-Brian
@bretterer
in my project
if you have STORMPATH_CLIENT_APIKEY_ID
, STORMPATH_CLIENT_APIKEY_SECRET
, STORMPATH_APPLICATION_HREF
in your .env
file. You can see that exception.
Also, when I remove STORMPATH_CLIENT_APIKEY_ID
, STORMPATH_CLIENT_APIKEY_SECRET
, STORMPATH_APPLICATION_HREF
from my .env
file.
php artisan route:list
output :
But when .env
file has STORMPATH_CLIENT_APIKEY_ID
, STORMPATH_CLIENT_APIKEY_SECRET
, STORMPATH_APPLICATION_HREF
.
php artisan route:list
output :
When I use only stormpath/sdk without laravel project, I can connect stormpath and login successfuly.
{
"require": {
"stormpath/sdk": "1.14.*"
}
}
<?php
require 'vendor/autoload.php';
\Stormpath\Client::$apiKeyFileLocation = $_SERVER['HOME'] . '/.stormpath/apiKey.properties';
$client = Stormpath\Client::getInstance();
$application = Stormpath\Resource\Application::get('https://api.stormpath.com/v1/applications/XXXXXX');
try {
$result = $application->authenticate('User', 'Pass');
$account = $result->account;
echo "<pre>";
print_r($account);
} catch (\Stormpath\Resource\ResourceError $e) {
echo $e->getMessage();
}
@bretterer
I have resolved this issue this way:
stormpath-laravel/src/Support/StormpathLaravelServiceProvider.php
before:
$accountStoreArray[] = [ 'href' => $mapping->accountStore->href, 'name' => $mapping->accountStore->name, 'provider' => [ 'href' => $mapping->accountStore->provider->href, 'providerId' => $mapping->accountStore->provider->providerId, ] ];
after:
$accountStoreArray[] = [ 'href' => $mapping->accountStore->href, 'name' => $mapping->accountStore->name, 'provider' => [ 'href' => isset($mapping->accountStore->provider->href) ? $mapping->accountStore->provider->href : null, 'providerId' => isset($mapping->accountStore->provider->providerId) ? $mapping->accountStore->provider->providerId : null, ] ];
Do you think that this is a correct way to resolve this issue?
I have sent a pull request(https://github.com/stormpath/stormpath-laravel/pull/48). please review it.
@nurettintopal please see comments on the PR. I think what is happening here is that your application has something other than directories in the account store mappings. I would guess groups or organizations. This brought in a bug with the laravel integration. We will need to get this resolved.
@bretterer I updated my pull request.
I set the accountStoreArray without provider and if the $mapping->accountStore->provider is exist, I attach it.
I think it seems to be fine.
when I add "stormpath/laravel": "^0.4" to composer.json file, run ''composer update" from my command line, I have received Runtime Exception.
I think so, this package not compatible with new Laravel 5.2.x