-
Notifications
You must be signed in to change notification settings - Fork 416
Fix: Resolve contradictory Gmail configs and add missing SMTP link #3170 #6027
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,8 @@ You can use WSO2 Identity Server as the email OTP provider or you can | |
| configure Gmail or SendGrid as the email OTP provider using Gmail or | ||
| SendGrid APIs. Follow the instructions in **one** of **Option1** or | ||
| **Option2** to set up the email OTP provider. | ||
|
|
||
| !!! note | ||
| Before you begin, ensure that you have configured the email server. For instructions on how to do this using SMTP, see [Configuring the Email Sending Module](../../setup/configuring-email-sending/). | ||
| #### Option1: Configure WSO2 IS as the email OTP provider | ||
|
|
||
| ??? abstract "Expand this section to follow the steps to configure WSO2 IS to send emails once the Email OTP is enabled." | ||
|
|
@@ -401,22 +402,23 @@ SendGrid APIs. Follow the instructions in **one** of **Option1** or | |
| !!! Note "Sample configuration when using Identity Server as Email OTP Provider" | ||
| ``` toml | ||
| [authentication.authenticator.email_otp] | ||
| name = "EmailOTP" | ||
| enable= true | ||
| [authentication.authenticator.email_otp.parameters] | ||
| EMAILOTPAuthenticationEndpointURL = "https://localhost:9443/emailotpauthenticationendpoint/emailotp.jsp" | ||
| EmailOTPAuthenticationEndpointErrorPage = "https://localhost:9443/emailotpauthenticationendpoint/emailotpError.jsp" | ||
| EmailAddressRequestPage = "https://localhost:9443/emailotpauthenticationendpoint/emailAddress.jsp" | ||
| usecase = "association" | ||
| secondaryUserstore = "primary" | ||
| EMAILOTPMandatory = false | ||
| sendOTPToFederatedEmailAttribute = false | ||
| federatedEmailAttributeKey = "email" | ||
| EmailOTPEnableByUserClaim = true | ||
| CaptureAndUpdateEmailAddress = true | ||
| showEmailAddressInUI = true | ||
| useEventHandlerBasedEmailSender = true | ||
| emailAddressRegex = '(?<=.{1}).(?=.*@)' | ||
| name = "EmailOTP" | ||
| enable = true | ||
|
|
||
| [[authentication.authenticator.email_otp.parameters]] | ||
| name = "EmailOTPAuthenticationEndpointURL" | ||
| value = "https://localhost:9443/emailotpauthenticationendpoint/emailotp.jsp" | ||
|
|
||
| [[authentication.authenticator.email_otp.parameters]] | ||
| name = "EmailOTPAuthenticationEndpointErrorPage" | ||
| value = "https://localhost:9443/emailotpauthenticationendpoint/emailotpError.jsp" | ||
|
|
||
| [[authentication.authenticator.email_otp.parameters]] | ||
| name = "EmailAddressRequestPage" | ||
| value = "https://localhost:9443/emailotpauthenticationendpoint/emailAddress.jsp" | ||
|
Comment on lines
404
to
+418
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Major: Inconsistent configuration format between Option1 and Option2. Option1 (lines 51-70) uses the flat-style format with This inconsistency creates confusion about which format to use and may suggest different configuration requirements when there shouldn't be any. Both options should use the same configuration format for consistency unless there's a technical reason for the difference. Consider standardizing on the flat-style format used in Option1, as shown in the previous comment's recommended fix. This matches the format used elsewhere in the WSO2 Identity Server 5.10.0 documentation (see context snippet from 🤖 Prompt for AI Agents |
||
|
|
||
| [output_event_adapter.email] | ||
| default_from_address = "your_email@gmail.com" | ||
| ``` | ||
|
Comment on lines
404
to
422
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for output adapter email configuration patterns in documentation and config files
echo "=== Searching for output adapter email config patterns ==="
rg -n "output.*adapter.*email" --type toml --type md -C2
echo ""
echo "=== Searching for specific section names ==="
rg -n "\[output_event_adapter\.email\]|\[output_adapter\.email\]" --type toml --type md -C2Repository: wso2/docs-is Length of output: 50370 🏁 Script executed: cat -n en/identity-server/5.10.0/docs/learn/configuring-email-otp.md | sed -n '374-475p'Repository: wso2/docs-is Length of output: 107 🏁 Script executed: cat -n en/identity-server/5.10.0/docs/learn/configuring-email-otp.md | sed -n '374,475p'Repository: wso2/docs-is Length of output: 6080 🏁 Script executed: cat -n en/identity-server/5.10.0/docs/learn/configuring-email-otp.md | sed -n '1,403p' | tail -50Repository: wso2/docs-is Length of output: 2858 🏁 Script executed: cat -n en/identity-server/5.10.0/docs/learn/configuring-email-otp.md | sed -n '270,330p'Repository: wso2/docs-is Length of output: 3426 🏁 Script executed: cat -n en/identity-server/5.10.0/docs/learn/configuring-email-otp.md | sed -n '475,530p'Repository: wso2/docs-is Length of output: 2922 🏁 Script executed: # Check the format used for email_otp.parameters in the file
cat -n en/identity-server/5.10.0/docs/learn/configuring-email-otp.md | sed -n '404,425p'Repository: wso2/docs-is Length of output: 1008 🏁 Script executed: # Search for any other configuration examples in the file that include Gmail parameters
rg -n "GmailClientId|GmailClientSecret|GmailRefreshToken|GmailEmailEndpoint" en/identity-server/5.10.0/docs/learn/configuring-email-otp.md -A 2 -B 2Repository: wso2/docs-is Length of output: 1633 🏁 Script executed: # Check what comes before line 402 to understand which Option this is for
cat -n en/identity-server/5.10.0/docs/learn/configuring-email-otp.md | sed -n '250,275p'Repository: wso2/docs-is Length of output: 1259 Fix incorrect section name and add missing Gmail authentication parameters to the configuration example. The configuration at lines 404-422 has two critical issues:
Without these parameters, the Gmail integration will fail. The configuration example should be corrected to include all required Gmail authentication details. Configuration format[authentication.authenticator.email_otp]
name = "EmailOTP"
enable = true
[[authentication.authenticator.email_otp.parameters]]
name = "EmailOTPAuthenticationEndpointURL"
value = "https://localhost:9443/emailotpauthenticationendpoint/emailotp.jsp"
[[authentication.authenticator.email_otp.parameters]]
name = "EmailOTPAuthenticationEndpointErrorPage"
value = "https://localhost:9443/emailotpauthenticationendpoint/emailotpError.jsp"
[[authentication.authenticator.email_otp.parameters]]
name = "EmailAddressRequestPage"
value = "https://localhost:9443/emailotpauthenticationendpoint/emailAddress.jsp"
[[authentication.authenticator.email_otp.parameters]]
name = "GmailClientId"
value = "<your_client_id>"
[[authentication.authenticator.email_otp.parameters]]
name = "GmailClientSecret"
value = "<your_client_secret>"
[[authentication.authenticator.email_otp.parameters]]
name = "GmailRefreshToken"
value = "<your_refresh_token>"
[[authentication.authenticator.email_otp.parameters]]
name = "GmailEmailEndpoint"
value = "https://www.googleapis.com/gmail/v1/users/<your_email@gmail.com>/messages/send"
[[authentication.authenticator.email_otp.parameters]]
name = "accessTokenRequiredAPIs"
value = "Gmail"
[output_adapter.email]
default_from_address = "your_email@gmail.com"🤖 Prompt for AI Agents |
||
|
|
||
| ??? Tip | ||
|
|
||
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.
Critical: Contradictory note placement.
The note states "Sample configuration when using Identity Server as Email OTP Provider", but this configuration snippet is located inside Option2: Configure Gmail as the email OTP provider (line 267). Option1 is for using Identity Server as the provider. This contradiction will confuse users about which configuration to use.
📝 Proposed fix
Either:
However, note that the configuration is also missing required Gmail-specific parameters (see separate comment).
📝 Committable suggestion
🤖 Prompt for AI Agents