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

Adds missing description for Xoauth2 authenticator for SMTP transport #231

Open
wants to merge 4 commits into
base: 2.23.x
Choose a base branch
from

Conversation

EmeryEx
Copy link
Contributor

@EmeryEx EmeryEx commented Mar 9, 2023

No description provided.

@froschdesign froschdesign added Bug Something isn't working Documentation labels Mar 9, 2023
@froschdesign froschdesign changed the title Xoauth2 authenticator for SMTP transport docs Adds missing description for Xoauth2 authenticator for SMTP transport Mar 9, 2023
Copy link
Member

@froschdesign froschdesign left a 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
Copy link
Member

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.

Comment on lines +151 to +152
'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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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 = [
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants