Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-74326

The username field is treated as a mandatory field in the outgoing mail server configuration when using Oauth 2.0

    XMLWordPrintable

Details

    • 9.02
    • 15
    • Severity 3 - Minor
    • 52
    • Hide
      Atlassian Update – 21 July 2023

      Thank you for reporting this issue. In the last weeks we have been working hard on fixing it.

      Summary of the problem:

      Jira admin was forced to enter value into username field, even though OAuth 2.0 authentication does not need one. The Jira should use token obtained during authorisation process, and not require any kind of username being passed.

      New behaviour after the change:

      The validation for username field for OAuth authentication has been dropped, allowing form validation for OAuth to pass with empty username field.

      Status of the fix and Fix Version:

      The fix is ready, and we’re moving the status of this ticket to Waiting for release with Fix Versions of 9.4.9, 9.10.1 and 9.11.0.

      Best regards,

      Artur Falborski
      Jira DC Software Engineer

      Show
      Atlassian Update – 21 July 2023 Thank you for reporting this issue. In the last weeks we have been working hard on fixing it. Summary of the problem: Jira admin was forced to enter value into username field, even though OAuth 2.0 authentication does not need one. The Jira should use token obtained during authorisation process, and not require any kind of username being passed. New behaviour after the change: The validation for username field for OAuth authentication has been dropped, allowing form validation for OAuth to pass with empty username field. Status of the fix and Fix Version: The fix is ready, and we’re moving the status of this ticket to Waiting for release with Fix Versions of 9.4.9 , 9.10.1 and 9.11.0 . Best regards, Artur Falborski Jira DC Software Engineer

    Description

      Issue Summary

      The Oauth 2.0 authentication for the Outgoing Mail Server functionality was introduced in Jira 9.2.0 as per Jira 9.2 release notes.

      In the ⚙ > System > Outgoing Mail configuration page, the following is mentioned:

      Optional - if you use authenticated SMTP to send email, enter your username.

      However, when configuring an Outgoing Mail Server and when testing the connection, we are forced to enter something in that field, even though this behavior does not make sense when using the Oauth 2.0 authentication, the Oauth authentication does not need a username: instead, the Jira application should use a token obtained earlier during the authorization process (and after logging into the MS portal) to authenticate against that mail server and test the connection.

      Therefore, there are 2 problems here:

      • this field is mandatory while it should be optional (especially when using the Oauth 2.0 authentication)
      • if this field is not correctly filled in (the browser might automatically autofill this field with a random user), we might run into the following error:
        Unfortunately no connection was possible. Review the errors below and rectify:
        AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful [XXXXXXXXXX.XXXXXX.PROD.OUTLOOK.COM]
        

      Steps to replicate

      • Install Jira 9.2.0
      • Configure an Oauth 2.0 integration in ⚙ > Applications > Application links
      • Configure an Outgoing Mail Server in ⚙ > System > Outgoing Mail, and select the Oauth integration as the authentication method
        • Leave the username field empty
      • Authorize the mailbox
      • Test the connection

      Actual Results

      The connection test is not executed when the username field is not filled in, and the Jira admin user is forced to enter a username.

      Expected Results

      The connection test should be executed even if the username field is not filled in

      Attachments

        1. IssueStep1.png
          IssueStep1.png
          315 kB
        2. IssueStep2.png
          IssueStep2.png
          353 kB

        Issue Links

          Activity

            People

              d996197e70d9 Artur Falborski
              jrey Julien Rey
              Votes:
              9 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: