Skip to content
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

Customizable SPN Service Class for GSSAPI Authentication #740

Open
Barakat opened this issue Oct 15, 2024 · 0 comments
Open

Customizable SPN Service Class for GSSAPI Authentication #740

Barakat opened this issue Oct 15, 2024 · 0 comments

Comments

@Barakat
Copy link

Barakat commented Oct 15, 2024

The JavaMail specifications do not explicitly define how the SPN service classes should be constructed when using GSSAPI authentication. This omission has led to hardcoded service classes, such as smtp/host@realm, across implementations, limiting compatibility with various Kerberos environments.

I propose updating the JavaMail specs to:

  • Introduce a property, mail.smtp.sasl.gssapi.spnserviceclass, to allow customization of the service class.
  • Specify that the default can remain smtp (or whatever the implementer was using) if no customization is provided.

References:

Eclipse Angus's Implementation:

// https://github.com/eclipse-ee4j/angus-mail/blob/master/providers/smtp/src/main/java/org/eclipse/angus/mail/smtp/SMTPTransport.java

public class SMTPTransport extends Transport {
    private String name = "smtp";    // Name of this protocol
   ...
                saslAuthenticator = (SaslAuthenticator) c.newInstance(
                        new Object[]{
                                this,
                                name, // <-- hardcoded service name
                                session.getProperties(),
                                logger,
                                serviceHost
                        });
 ...
}

// https://github.com/eclipse-ee4j/angus-mail/blob/master/providers/smtp/src/main/java/org/eclipse/angus/mail/smtp/SMTPSaslAuthenticator.java

   public SMTPSaslAuthenticator(SMTPTransport pr, String name,
                                Properties props, MailLogger logger, String host) {
...
       this.name = name;
...
   }
...
           Map<String, ?> propsMap = (Map) props;
           sc = Sasl.createSaslClient(mechs, authzid, name, host, // <-- hardcoded service name
                   propsMap, cbh);
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant