cesarhernandezgt commented on a change in pull request #1:
URL: https://github.com/apache/geronimo-javamail/pull/1#discussion_r498973883



##########
File path: 
geronimo-javamail_1.6/geronimo-javamail_1.6_provider/src/main/java/org/apache/geronimo/javamail/authentication/SASLAuthenticator.java
##########
@@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.javamail.authentication;
+
+import java.io.UnsupportedEncodingException ;
+import java.util.Map;        
+import java.util.Properties; 
+
+import javax.mail.MessagingException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.sasl.Sasl; 
+import javax.security.sasl.SaslClient; 
+import javax.security.sasl.SaslException; 
+import javax.security.sasl.RealmCallback; 
+import javax.security.sasl.RealmChoiceCallback; 
+
+public class SASLAuthenticator implements ClientAuthenticator, CallbackHandler 
{
+    // The realm we're authenticating within 
+    protected String realm; 
+    // the user we're authenticating
+    protected String username;
+    // the user's password (the "shared secret")
+    protected String password;
+    // the authenticator we're proxying 
+    protected SaslClient authenticator; 
+
+    protected boolean complete = false;
+
+    /**
+     * Main constructor.
+     * 
+     * @param username
+     *            The login user name.
+     * @param password
+     *            The login password.
+     */
+    public SASLAuthenticator(String[] mechanisms, Properties properties, 
String protocol, String host, String realm, 
+            String authorizationID, String username, String password) throws 
MessagingException {
+        this.realm = realm; 
+        this.username = username;
+        this.password = password;
+        try {
+            authenticator = Sasl.createSaslClient(mechanisms, authorizationID, 
protocol, host, (Map)properties, 
+                this); 
+        } catch (SaslException e) {

Review comment:
       SASLA was not updated in this PR. It remains the same from 
https://github.com/apache/geronimo-javamail/blob/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/authentication/SASLAuthenticator.java
 and 
https://github.com/apache/geronimo-javamail/blob/trunk/geronimo-javamail_1.5/geronimo-javamail_1.5_provider/src/main/java/org/apache/geronimo/javamail/authentication/SASLAuthenticator.java




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to