-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Adds missing description for Xoauth2 authenticator for SMTP transport #231
base: 2.23.x
Are you sure you want to change the base?
Conversation
… Office 365 SMTP using XOauth2 Signed-off-by: Emery <[email protected]>
Signed-off-by: Emery <[email protected]>
Signed-off-by: Emery <[email protected]>
Signed-off-by: Emery <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding the missing description! 👍🏻
Some improvements are needed.
@@ -135,6 +135,85 @@ $options = new SmtpOptions([ | |||
$transport->setOptions($options); | |||
``` | |||
|
|||
### SMTP Transport Usage with XOAUTH2 | |||
|
|||
```php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like different steps are needed to use this type of transport for mails, therefore a list of all required steps should be added. But at first an explanation of the transport type must be added. Also a link to an official description would be good here.
'username' => 'user', // the email address of user that approved token | ||
'access_token' => $access_token, // the access token you've acquired via an authorization token or refresh token reuest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not include longer descriptions in the code examples themselves. If explanations are necessary, please put them before or after to code block.
$body = [ | ||
'client_id' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', | ||
'client_secret' => 'xxxxx~xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', | ||
'redirect_uri' => 'https://your-host.com/your/redirect-uri', // This needs to match what you've configured in the admin on Azure for the app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here: no longer descriptions in the code.
'client_secret' => 'xxxxx~xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', | ||
'redirect_uri' => 'https://your-host.com/your/redirect-uri', // This needs to match what you've configured in the admin on Azure for the app | ||
'grant_type' => 'authorization_code', | ||
'code' => $authorization_code, // The authorization code you've received at the redirect url specified from a prior browser-based authorization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here: no longer descriptions in the code.
$body = [ | ||
'client_id' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', | ||
'client_secret' => 'xxxxx~xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', | ||
'redirect_uri' => 'https://your-host.com/your/redirect-uri', // This needs to match what you've configured in the admin on Azure for the app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here: no longer descriptions in the code.
'redirect_uri' => 'https://your-host.com/your/redirect-uri', // This needs to match what you've configured in the admin on Azure for the app | ||
'scope' => 'https://outlook.office.com/SMTP.Send', | ||
'grant_type' => 'refresh_token', | ||
'refresh_token' => $refresh_token, // The refresh_token you've received from the previous grant request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here: no longer descriptions in the code.
Get access token using an "authorization code" (can only be performed once per authorization code | ||
|
||
```php | ||
$body = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to explain what is being done here. The reader needs to understand what is necessary and how to implement these steps themselves.
No description provided.