Skip to content

Commit

Permalink
Add Client Credentials Flow as Authentication Method (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
lamungu authored Oct 12, 2023
1 parent 1c9cad4 commit 6682a01
Show file tree
Hide file tree
Showing 7 changed files with 979 additions and 5 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,22 @@ Route::get('/callback', function()

With the Username Password flow, you can directly authenticate with the `Forrest::authenticate()` method.

> To use this authentication you must add your username, and password to the config file. Security token might need to be ammended to your password unless your IP address is whitelisted.
> To use this authentication you must add your username, and password to the config file. Security token might need to be amended to your password unless your IP address is whitelisted.
```php
Route::get('/authenticate', function()
{
Forrest::authenticate();
return Redirect::to('/');
});
```


#### Client Credentials authentication flow

With the Client Credentials flow, you can directly authenticate with the `Forrest::authenticate()` method.

> Using this authentication method only requires your consumer secret and key. Your Salesforce Connected app must also have the "Client Credentials Flow" Enabled in its settings.
```php
Route::get('/authenticate', function()
Expand All @@ -135,7 +150,7 @@ Route::get('/authenticate', function()
4. Update your config file with values for `loginURL`, `username`, and `password`.
With the Username Password SOAP flow, you can directly authenticate with the `Forrest::authenticate()` method.

> To use this authentication you can add your username, and password to the config file. Security token might need to be ammended to your password unless your IP address is whitelisted.
> To use this authentication you can add your username, and password to the config file. Security token might need to be amended to your password unless your IP address is whitelisted.
```php
Route::get('/authenticate', function()
Expand All @@ -147,7 +162,7 @@ Route::get('/authenticate', function()

If your application requires logging in to salesforce as different users, you can alternatively pass in the login url, username, and password to the `Forrest::authenticateUser()` method.

> Security token might need to be ammended to your password unless your IP address is whitelisted.
> Security token might need to be amended to your password unless your IP address is whitelisted.
```php
Route::Post('/authenticate', function(Request $request)
Expand Down
Loading

0 comments on commit 6682a01

Please sign in to comment.