auth0-cli icon indicating copy to clipboard operation
auth0-cli copied to clipboard

Allow configuring the signing algorithm for new APIs

Open scraymondjr opened this issue 2 years ago • 1 comments

Describe the problem you'd like to have solved

The create API HTTP documentation describes field signing_alg to allow configuring the signing algorithm of the access token for the API. This configuration does not appear to be available in the CLI.

Describe the ideal solution

Add a flag to allow specifying the signing-alg value, restricted to the allowed values of RS256 and HS256, for example create an API using the HS256 algorithm:

$ auth0 apis create --identifier ${ID} --signing-alg HS256

The response should include the secret on success:

=== {tenant}.us.auth0.com API created

  ID                                          {ID}                 
  NAME                                   {NAME}
  IDENTIFIER                          {AUDIENCE}
  TOKEN LIFETIME                3600                                      
  ALLOW OFFLINE ACCESS  ✗
  SIGNING SECRET                {SECRET PLAINTEXT}

Alternatives and current work-arounds

There is no alternative to this problem using the CLI. The signing algorithm cannot be changed once the API is created so the current behavior is all APIs created through the CLI will use RS256 algorithm.

scraymondjr avatar Oct 22 '21 15:10 scraymondjr

Hi @scraymondjr, thanks for raising this. I'll leave the issue open to track this.

Widcket avatar Oct 23 '21 01:10 Widcket

Update: We included this in v1.3.0 through the --signing-alg flag. Example:

auth0 apis create --name myapi --identifier http://my-api --token-lifetime 6100 --offline-access=false --scopes "letter:write,letter:read" --signing-alg "RS256"

Appreciate the patience!

willvedd avatar Dec 01 '23 19:12 willvedd