omniphx / forrest

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

Add Client Credentials Flow as Authentication Method #330

Closed lamungu closed 11 months ago

lamungu commented 11 months ago

Description

Adds the Client Credential Flow as a possible authentication method.

How to use

The Client Credentials flow only requires the consumer secret and key generated by the Salesforce Connected App. Client Credentials Flow should also be enabled within Salesforce to allow it to work.

You may then set SF_AUTH_METHOD to ClientCredentials in your .env file, and have the client authenticate directly with Forrest::authenticate()

Known issues

The PHPSpec file was loosely based on the UserPassword spec, which had an issue with the it_should_refresh_the_token_if_token_expired_exception_is_thrown test.

omniphx commented 11 months ago

Thanks, @lamungu!