omniphx / forrest

A Laravel library for Salesforce
https://omniphx.github.io/forrest/
MIT License
259 stars 120 forks source link

Authentication Error #211

Closed cdavila1990 closed 1 year ago

cdavila1990 commented 5 years ago

I have followed all the steps for setup however I am getting this error when I try to reach the authenticate route.

_ErrorException in LaravelSession.php line 15: Argument 2 passed to Omniphx\Forrest\Providers\Laravel\LaravelSession::_construct() must be an instance of Illuminate\Contracts\Session\Session, instance of Illuminate\Session\Store given, called in /var/www/dist.com/vendor/omniphx/forrest/src/Omniphx/Forrest/Providers/Laravel/ForrestServiceProvider.php on line 36 and defined

My research on this error is coming up empty. Please help. Thanks

omniphx commented 5 years ago

What version of Laravel are you using?

cdavila1990 commented 5 years ago

5.2 After posting the issue I noticed it has been a problem in the past for others as well. I tried downgrading to version 2.4.2 because someone said it worked for them. Still nothing.

omniphx commented 5 years ago

Looks like Laravel updated this interface back in 5.4 and 5.24.

You can try updating your Laravel project to 5.24 or try version 2.3.1 of this library.

cdavila1990 commented 5 years ago

I went down to 2.3.1 and this is the new error. Is there anything I'm missing in the stack trace that you can see?

error

omniphx commented 5 years ago

Hm... real hard to deal with these backwards compatibility issues. What is the exact Laravel version you are using?

omniphx commented 5 years ago

Maybe try 2.36?

cdavila1990 commented 5 years ago

My exact laravel version is 5.2.45.

When I remove the session variables from LaravelSession.php I'm able to pass through to salesforce.com for logging in. LaravelSession screenshot

However this is the error I get when I attempt to log in. salesforcelogin error

omniphx commented 5 years ago

unsupported_grant_type is actually a Salesforce response, so that's a good sign. Could you share what you have configured?

omniphx commented 5 years ago

Possible it might have to do with the login url you are using: https://salesforce.stackexchange.com/questions/223205/sfdx-grant-type-not-supported

cdavila1990 commented 5 years ago

CALLBACK_URI=https://login.salesforce.com/services/oauth2/token LOGIN_URL=https://login.salesforce.com

I didn't think LOGIN_URL needed to change. I can log in fine to salesforce when I'm not trying to authenticate via my Laravel app.

cdavila1990 commented 5 years ago

What would you like to see as far as configuration goes?

omniphx commented 5 years ago

Callback URI is what endpoint Salesforce is supposed to send the response. For instance, it will probably be localhost:8080/callback or similar for local development