| margaretha | aecee1b | 2018-02-20 14:44:21 +0100 | [diff] [blame] | 1 | package de.ids_mannheim.korap.service; |
| 2 | |
| margaretha | 238df8f | 2023-08-16 12:38:12 +0200 | [diff] [blame] | 3 | import jakarta.mail.Authenticator; |
| 4 | import jakarta.mail.PasswordAuthentication; |
| margaretha | aecee1b | 2018-02-20 14:44:21 +0100 | [diff] [blame] | 5 | |
| margaretha | 6b3ecdd | 2018-03-01 18:23:56 +0100 | [diff] [blame] | 6 | /** Defines Authenticator for creating javax.mail.Session. |
| 7 | * |
| 8 | * @see src/main/resources/default-config.xml |
| 9 | * |
| 10 | * @author margaretha |
| 11 | * |
| 12 | */ |
| margaretha | aecee1b | 2018-02-20 14:44:21 +0100 | [diff] [blame] | 13 | public class MailAuthenticator extends Authenticator { |
| 14 | |
| 15 | private PasswordAuthentication passwordAuthentication; |
| 16 | |
| 17 | public MailAuthenticator (String username, String password) { |
| 18 | passwordAuthentication = new PasswordAuthentication(username, password); |
| 19 | |
| 20 | } |
| 21 | |
| 22 | @Override |
| 23 | protected PasswordAuthentication getPasswordAuthentication () { |
| 24 | return passwordAuthentication; |
| 25 | } |
| 26 | |
| 27 | } |