Add refresh_token to OauthV2Access.php
As far as I can see, there is no possibility of using the oauthV2Access method for token refresh.
Can you add it?
// JoliCode\Slack\Api\Endpoint\OauthV2Access
protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
{
$optionsResolver = parent::getQueryOptionsResolver();
$optionsResolver->setDefined(['client_id', 'client_secret', 'code', 'redirect_uri', 'grant_type', 'refresh_token']);
$optionsResolver->setDefaults([]);
$optionsResolver->addAllowedTypes('client_id', ['string']);
$optionsResolver->addAllowedTypes('client_secret', ['string']);
$optionsResolver->addAllowedTypes('code', ['string']);
$optionsResolver->addAllowedTypes('redirect_uri', ['string']);
$optionsResolver->addAllowedTypes('grant_type', ['string']);
$optionsResolver->addAllowedTypes('refresh_token', ['string']);
return $optionsResolver;
}
Hello! Thanks for reporting this issue.
It looks like it's missing from Slack OpenApi definition:
https://github.com/jolicode/slack-php-api/blob/31a49b5f54049a1ebb001de2545aff0500d4fdd6/resources/slack-openapi.json#L19403-L19440
That's why it's not allowed in OauthV2Access.
The only way to fix this is to create a new patch: https://github.com/jolicode/slack-php-api/blob/31a49b5f54049a1ebb001de2545aff0500d4fdd6/docs/4-updating-sdk.md#generating-a-new-patch (because there specification is really not good, we keep a list of patches to improve it before building the PHP client).
Would you be available to give it a try?
Thanks
Okay, I'll look into it.
Will it be quickly updated after that? Because I need it for a project.
Yes we can release a new version as soon as it's done 👍
I can't push my branch to make a pull request.
Sorry, first time contributing to a project, I discover ^^
Welcome to the open-source world :tada:
To be able to contribute, you have to work on a "fork": https://github.com/jolicode/slack-php-api/fork
It's this fork you must work on (create branches, make changes, etc).
Then when ready, Github will display a button to open a Pull Request on the main project.
Thank you very much.
All done!