Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14795

camel-mail: allow dynamic setting of token in order to be able to support OAUTH

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.2.0
    • camel-mail
    • None
    • Unknown

    Description

      camel-mail uses java-mail. Meanwhile java-mail does support OAuth for imap and smtp (see https://javaee.github.io/javamail/OAuth2). The OAuth access tokens typically expire. The current camel-mail component does not allow to dynamically read the password (=token), the password is fix set in the configuration. Therefore it is not possible to update the password/token.

      We improve the camel-mail component so that it is possible to dynamically read the user and password/token, so that the OAuth use case can be supported.

      Instead of setting the user and password on the configuration, you specify an authenticator bean in the configuration.  The authenticator method 

      public PasswordAuthentication getPasswordAuthentication() 

      will be called dynamically whenever a user/token (or password) is needed for connecting to the mail server.

       

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            forsthofer Franz Forsthofer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m

                Slack

                  Issue deployment