-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c60c660
commit c05ecf7
Showing
7 changed files
with
183 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
namespace Dfe\Salesforce; | ||
// 2017-07-10 | ||
/** @final Unable to use the PHP «final» keyword here because of the M2 code generation. */ | ||
class Button extends \Df\OAuth\FE\Button { | ||
/** | ||
* 2017-07-10 | ||
* @override | ||
* @see \Df\OAuth\FE\Button::pExtra() | ||
* @used-by \Df\OAuth\FE\Button::onFormInitialized() | ||
* @return array(string => mixed) | ||
*/ | ||
final protected function pExtra() {return df_clean([ | ||
/** | ||
* 2017-07-11 | ||
* «Specifies a value to be returned in the response; this is useful for detecting "replay" attacks. | ||
* Optional with the openid scope for getting a user ID token.» | ||
* Optional. | ||
* https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_web_server_oauth_flow.htm#nonce_parameter_description | ||
*/ | ||
'nonce' => null | ||
/** | ||
* 2017-07-11 | ||
* Note 1. | ||
* «Specifies what data your application can access. | ||
* See `Scope Parameter Values` in the online help for more information.» | ||
* Optional. | ||
* https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_web_server_oauth_flow.htm#scope_parameter_description | ||
* Note 2. | ||
* The «Scope Parameter Values» documentation article | ||
* is present only in the «Mobile SDK Development Guide»: | ||
* https://www.google.com/search?q="Scope+Parameter+Values"+site:developer.salesforce.com | ||
* https://developer.salesforce.com/docs/atlas.en-us.mobile_sdk.meta/mobile_sdk/oauth_scope_parameter_values.htm#topic-title | ||
*/ | ||
,'scope' => null | ||
]);} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
namespace Dfe\Salesforce\OAuth; | ||
use Df\Core\Exception as DFE; | ||
use Dfe\Salesforce\Settings\General\OAuth as S; | ||
// 2017-07-10 | ||
final class App extends \Df\OAuth\App { | ||
/** | ||
* 2017-07-10 | ||
* @override | ||
* @see \Df\OAuth\App::ss() | ||
* @used-by \Df\OAuth\App::getAndSaveTheRefreshToken() | ||
* @used-by \Df\OAuth\App::pCommon() | ||
* @used-by \Df\OAuth\App::requestToken() | ||
* @used-by \Df\OAuth\App::token() | ||
* @used-by \Df\OAuth\FE\Button::s() | ||
* @return S | ||
*/ | ||
function ss() {return S::s();} | ||
|
||
/** | ||
* 2017-07-10 | ||
* https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_oauth_endpoints.htm#topic-title | ||
* @override | ||
* @see \Df\OAuth\App::urlAuth() | ||
* @used-by \Df\OAuth\FE\Button::onFormInitialized() | ||
* @return string | ||
*/ | ||
function urlAuth() {return self::url('authorize');} | ||
|
||
/** | ||
* 2017-07-11 | ||
* https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_oauth_endpoints.htm#topic-title | ||
* @override | ||
* @see \Df\OAuth\App::urlToken() | ||
* @used-by \Df\OAuth\App::requestToken() | ||
* @return string | ||
*/ | ||
protected function urlToken() {return self::url('token');} | ||
|
||
/** | ||
* 2017-07-11 | ||
* @used-by urlAuth() | ||
* @used-by urlToken() | ||
* @param string $s | ||
* @return string | ||
*/ | ||
private static function url($s) {return "https://login.salesforce.com/services/oauth2/$s";} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
namespace Dfe\Salesforce\Settings\General; | ||
// 2017-07-10 | ||
/** @method static OAuth s() */ | ||
final class OAuth extends \Df\OAuth\Settings { | ||
/** | ||
* 2017-07-10 | ||
* @override | ||
* @see \Df\Config\Settings::prefix() | ||
* @used-by \Df\Config\Settings::v() | ||
* @used-by \Df\OAuth\Settings::refreshTokenSave() | ||
* @return string | ||
*/ | ||
protected function prefix() {return 'df_salesforce/general/oauth';} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version='1.0'?> | ||
<config | ||
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' | ||
xsi:noNamespaceSchemaLocation='urn:magento:framework:ObjectManager/etc/config.xsd' | ||
> | ||
<virtualType | ||
name='Dfe\Salesforce\Controller\Adminhtml\Oauth\Index' | ||
type='Df\OAuth\ReturnT\GeneralPurpose' | ||
/> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters