javamacosauthenticationinstall4jnotarize

Install4J notarization for MacOs fails based on new & needed 2-factor auth


Starting February 2021, two-factor authentication or two-step verification will be required for all users to sign in to App Store Connect (https://developer.apple.com/support/authentication/).

Currently we do notarization as described by install4j documentation, where install4j is configured to do the entire notarization process for us: notarization is enabled, codeSigning certificate and apple id is provided in the config and the password for authentication is provided by --apple-id-password command line parameter on the CI environment.

Enabling two-factor for our account now leads to problems when our CI build tries to authenticate to upload the native dmg for notarization as a verification code SMS now is delivered to our mobile.

How can we configure install4j to do notarization with a 2-factor Apple Id account?

Build Output:

[INFO] install4j: compilation failed. Reason: We are unable to create an authentication session. (code -22016)
[INFO] Uploading my-app.dmg for notarization
Failed to execute goal org.sonatype.install4j:install4j-maven-plugin:1.1.2:compile (compile-installers) on project native-installer: null returned: 1

Solution

  • When you use two-factor authentication, you have to use app-specific passwords as explained in https://support.apple.com/en-us/HT204397