Skip to main content
Mauro Amarillo 님이 #Integration에 질문했습니다
I've set up my sandbox with a connected app to be able to authenticate using the JWT flow for continuous integration according to this document: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_jwt_flow.htm

yet when i run:

sfdx force:auth:jwt:grant --clientid <my consumer key> --jwtkeyfile <path to key file> --username <my username> --setdefaultusername --instanceurl https://<sandbox>.<instance>.my.salesforce.com

i get the following error:

ERROR:  This org appears to have a problem with its OAuth configuration. Reason: invalid_grant - audience is invalid 

username: <my username>, 

clientId: <my client ID>, 

loginUrl: https://<sandbox>.<current instance>.my.salesforce.com, 

privateKey: <path to my key file>

Try this:

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.

I've re-checked everything it says a thousand times and everything appears to be ok, any suggestions?
답변 1개
  1. 2018년 3월 26일 오후 9:10
    Can you share the connect app image?  and make sure your username is configured to pre-authorize admins
0/9000