Search Unity

AWS CodeArtifact Credential Authentication Failure

Discussion in 'Package Manager' started by irwindong, Nov 1, 2021.

  1. irwindong

    irwindong

    Joined:
    Dec 13, 2018
    Posts:
    1
    Unity Version: 2020.3.16f1
    I'm planning to host our UPM packages on AWS CodeArtifact. I followed the AWS Code Artificat npm login guidline to login into the NPM registry and Unity's manual to copy the npm authentication token to .upmconfig.toml file.
    Unity gives me the following error:
    Request[Get https://....amazonaws.com:443/npm/.../....tgz] failed because it lacks valid authentication credentials.

    I noticed that the npm authentication token has 1184 characters, although, I have no problem using npm CLI to publish the package.

    Any suggestions if anything I did wrong, or it's a Unity issue?
     
    Last edited: Nov 2, 2021
  2. sandolkakos

    sandolkakos

    Joined:
    Jun 3, 2009
    Posts:
    285
    I don't know if you have already solved your problem, but I'm gonna post here in case it could help someone in the future.

    Maybe you are using the incorrect authentication key in your .upmconfig.toml file. Depending on the type of Authentication, you should use token or _auth as described below:

    Token based authentication (Bearer)
    [npmAuth."<REGISTRY URL>"]
    token = "<AUTH TOKEN _authToken in .npmrc)>"
    email = "<EMAIL>"
    alwaysAuth = <BOOLEAN>


    Base64 authentication (Basic)
    [npmAuth."<REGISTRY URL>"]
    _auth = "<BASE64 ENCODED TOKEN (_auth in .npmrc)>"
    email = "<EMAIL>"
    alwaysAuth = <BOOLEAN>
     
    maximeb_unity likes this.