public function SalesforceCommands::listAuthProviders in Salesforce Suite 5.0.x
Same name and namespace in other branches
- 8.4 src/Commands/SalesforceCommands.php \Drupal\salesforce\Commands\SalesforceCommands::listAuthProviders()
Lists authentication providers.
@command salesforce:list-providers @aliases sflp @field-labels default: Default label: Label name: Name status: Token Status @default-fields label,name,default,status
Return value
\Consolidation\OutputFormatters\StructuredData\RowsOfFields The auth provider details.
File
- src/
Commands/ SalesforceCommands.php, line 689
Class
- SalesforceCommands
- A Drush commandfile.
Namespace
Drupal\salesforce\CommandsCode
public function listAuthProviders() {
$rows = [];
foreach ($this->authMan
->getProviders() as $provider) {
$rows[] = [
'default' => $this->authMan
->getConfig()
->id() == $provider
->id() ? '✓' : '',
'label' => $provider
->label(),
'name' => $provider
->id(),
'status' => $provider
->getPlugin()
->hasAccessToken() ? 'Authorized' : 'Missing',
];
}
return new RowsOfFields($rows);
}