Error: HTTP status code: 401. Invalid credentials. Username or password is incorrect. Use the app-specific password generated at appleid.apple.com. Ensure that all authentication arguments are correct.

HERE IS THE COMPLETE LOG FROM THE SYSTEM.. please help me with the issue.

Downloads % xcrun notarytool submit appName.pkg --apple-id “appleid --team-id <app_id> --wait --verbose [17:21:08.220Z] Debug [MAIN] Running notarytool version: unknown (0), date: 2024-09-09T17:21:08Z, command: /Applications/Xcode.app/Contents/Developer/usr/bin/notarytool submit <appname>_090624.pkg --apple-id <apple_id_hidden>--team-id <app_id> --wait --verbose

Conducting pre-submission checks for <appname>_090624.pkg and initiating connection to the Apple notary service...

[17:21:08.222Z] Debug [PREFLIGHT] <appname>_090624.pkg is a flat installer package.

[17:21:08.223Z] Debug [PREFLIGHT] Finished completing determination of file type for <appname>_090624.pkg. Operation took 1ms. Password for <apple_id_hidden>:

[17:21:13.354Z] Info [API] Initialized Notary API with base URL: https://appstoreconnect.apple.com/notary/v2/

[17:21:13.357Z] Debug [CTXMGR] Created temporary directory at: file:///var/folders/bj/ct_f469n03b2l596c_00n27c0000gp/T/TemporaryItems/NSIRD_notarytool_hkXwCu/

[17:21:13.359Z] Debug [CTXMGR] Copied <appname>_090624.pkg -- file:///Users/w525362/Downloads/ to file:///var/folders/bj/ct_f469n03b2l596c_00n27c0000gp/T/TemporaryItems/NSIRD_notarytool_hkXwCu/<appname>_090624.pkg

[17:21:13.360Z] Debug [FILEHASH] Generating md5 and sha256 digest with buffer size 1048576 for file:///var/folders/bj/ct_f469n03b2l596c_00n27c0000gp/T/TemporaryItems/NSIRD_notarytool_hkXwCu/<appname>_090624.pkg

[17:21:13.486Z] Debug [FILEHASH] MD5 digest: bd49fd77dfe36a9bbfb4c7efc329c6fe

[17:21:13.486Z] Debug [FILEHASH] Base64-encoded MD5 Digest: vUn9d9/japu/tMfvwynG/g==

[17:21:13.487Z] Debug [FILEHASH] SHA256 digest: 03466bf60dc33f57a2bbb2ba54402eb882529085e98f9d18e1e42ceeecd9d0aa

[17:21:13.487Z] Debug [FILEHASH] Finished generating file hashes for <appname>_090624.pkg. Operation took 126ms.

[17:21:13.487Z] Debug [API] Sending submissions payload: submissionPayload(submissionName: "<appname>_090624.pkg", md5: "bd49fd77dfe36a9bbfb4c7efc329c6fe", sha256: "03466bf60dc33f57a2bbb2ba54402eb882529085e98f9d18e1e42ceeecd9d0aa", notifications: [])

[17:21:13.488Z] Info [API] Preparing POST request to URL: https://appstoreconnect.apple.com/notary/v2/submissions?, Custom Headers: private<Dictionary<String, String>>

[17:21:13.488Z] Debug [AUTHENTICATION] Delaying current request to refresh app-specific password token.

[17:21:13.488Z] Info [API] Preparing GET request to URL: https://appstoreconnect.apple.com/notary/v2/asp?, Parameters: [:], Custom Headers: private<Dictionary<String, String>>

[17:21:13.488Z] Debug [AUTHENTICATION] Authenticating request to '/notary/v2/asp' with Basic Auth. Username: appleID, Password: private<String>, Team ID: <app_id> [17:21:13.489Z] Debug [TASKMANAGER] Starting Task Manager loop to wait for asynchronous HTTP calls.

[17:21:14.774Z] Debug [API] Received response status code: 401, message: unauthorized, URL: https://appstoreconnect.apple.com/notary/v2/asp?, Correlation Key: QHGCOMLZWZVN4SEAKHS3SBGLS4

[17:21:14.775Z] Error [TASKMANAGER] Completed Task with ID 2 has encountered an error.

[17:21:14.775Z] Debug [TASKMANAGER] Ending Task Manager loop.

[17:21:14.783Z] Debug [CTXMGR] Removed temporary directory:

Optional(file:///var/folders/bj/ct_f469n03b2l596c_00n27c0000gp/T/TemporaryItems/NSIRD_notarytool_hkXwCu/) Error: HTTP status code: 401. Invalid credentials. Username or password is incorrect. Use the app-specific password generated at appleid.apple.com. Ensure that all authentication arguments are correct.

Answered by DTS Engineer in 803083022

When testing authentication, it’s best to use the store-credentials subcommand:

% xcrun notarytool store-credentials

This process stores your credentials securely in the Keychain. You reference these credentials later using a profile name.
… and so on …

This interactively guides you through the credential process. It also means that you don’t need to submit anything, which speeds up your tests.


On the password front, did you actually generate and then supply an app-specific password? You do the first part using the steps described in the How to generate an app-specific password section of Using app-specific passwords.

The vast majority of errors like this are caused by folks supplying their main Apple ID password, rather than an app-specific password that they create solely for the purposes of notarisation.

Note You don’t need a different password for each app you notarise! The “app” in “app-specific password” refers to notarytool.

              *                   *                   *

If that doesn’t fix things, I recommend that you switch to using an App Store Connect API key. For advice on how to do that, see Creating API Keys for App Store Connect API.

Once you’ve generated and download the key, you can point notarytool store-credentials at that .p8 file and follow its instructions.

ps Please don’t use the entire error message as your thread title. See tip 13 in Quinn’s Top Ten DevForums Tips.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

When testing authentication, it’s best to use the store-credentials subcommand:

% xcrun notarytool store-credentials

This process stores your credentials securely in the Keychain. You reference these credentials later using a profile name.
… and so on …

This interactively guides you through the credential process. It also means that you don’t need to submit anything, which speeds up your tests.


On the password front, did you actually generate and then supply an app-specific password? You do the first part using the steps described in the How to generate an app-specific password section of Using app-specific passwords.

The vast majority of errors like this are caused by folks supplying their main Apple ID password, rather than an app-specific password that they create solely for the purposes of notarisation.

Note You don’t need a different password for each app you notarise! The “app” in “app-specific password” refers to notarytool.

              *                   *                   *

If that doesn’t fix things, I recommend that you switch to using an App Store Connect API key. For advice on how to do that, see Creating API Keys for App Store Connect API.

Once you’ve generated and download the key, you can point notarytool store-credentials at that .p8 file and follow its instructions.

ps Please don’t use the entire error message as your thread title. See tip 13 in Quinn’s Top Ten DevForums Tips.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Error: HTTP status code: 401. Invalid credentials. Username or password is incorrect. Use the app-specific password generated at appleid.apple.com. Ensure that all authentication arguments are correct.
 
 
Q