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

Default to login url to keep backwards compatibility for OAuth JWT #343

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Default to login url to keep backwards compatibility
  • Loading branch information
omniphx committed Mar 22, 2024
commit c57c79f83f92cf8769127173a663923685349ef4
4 changes: 2 additions & 2 deletions src/Omniphx/Forrest/Authentications/OAuthJWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public static function getJWT($iss, $aud, $sub, $privateKey)

public function authenticate($fullInstanceUrl = null)
{
$fullInstanceUrl = $fullInstanceUrl ?? $this->getInstanceURL() . '/services/oauth2/token';
$loginUrl = $this->credentials['loginURL'];
$fullInstanceUrl = $fullInstanceUrl ?? $loginUrl . '/services/oauth2/token';

$consumerKey = $this->credentials['consumerKey'];
$loginUrl = $this->credentials['loginURL'];
$username = $this->credentials['username'];
$privateKey = $this->credentials['privateKey'];

Expand Down
9 changes: 8 additions & 1 deletion src/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
'privateKey' => '',
],

'instanceURL' => 'https://<YOUR_ORG>.my.salesforce.com',

/*
* These are optional authentication parameters that can be specified for the WebServer flow.
* https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_oauth_web_server_flow.htm&language=en_US
Expand Down Expand Up @@ -78,7 +80,12 @@
'version' => '',

/*
* Optional (and not recommended) if you need to override the instance_url returned from Saleforce
* Optional (and not recommended) if you need to override the instance_url returned from Salesforce
*
* This is useful for adding lightning and sandbox capability to OAuthJWT:
* Lightning: https://<YOUR_ORG>.my.salesforce.com
* Lightning Sandbox: https://<YOUR_ORG>--<SANDBOX_NAME>.sandbox.my.salesforce.com
* Developer Org : https://<DEV_DOMAIN>.develop.my.salesforce.com
*/
'instanceURL' => '',

Expand Down
Loading