Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Client Credentials Flow as Authentication Method #330

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading