Error while trying to authorize an org through JWT from SFDX CLI on Windows.
sfdx force:auth:jwt:grant --clientid <myclientid> --jwtkeyfile server.key --instanceurl https://mysandbox.my.salesforce.com --username <myusername> --setalias PraveenDevJWT
I am trying using the above mentioned SFDX CLI command. I have made sure that the user I am using is assigned to the Profile to which the connected app is assigned to.
Here is the error that I see:
ERROR: This org appears to have a problem with its OAuth configuration. Reason: invalid_grant - audience is invalid
loginUrl: 'Not Specified'
Verify the OAuth configuration for this org. For JWT:
Ensure the private key is correct and the cert associated with the connected app has not expired.
Ensure the following OAuth scopes are configured [api, refresh_token, offline_access].
Ensure the username is assigned to a profile or perm set associated with the connected app.
Ensure the connected app is configured to pre-authorize admins.
The error message says loginUrl: which I reckon can be the issue, but I am not sure how to set it (if it is really required). Can anyone please help with this? Thanks.