simple-salesforce icon indicating copy to clipboard operation
simple-salesforce copied to clipboard

Problem with JWT and My Domain/Enhanced Domains

Open bwanshoom opened this issue 1 year ago • 5 comments

With My Domains enabled, domain must be set to the My Domain prefix (e.g. my-custom-domain.my or my-custom-domain.my.sandbox) in order for the token URL to be set correctly. However, the aud portion of the JWT request must be either login or test - it cannot be the custom portion or you'll receive an "invalid audience" error.

There is currently no way to accommodate this in the library - it uses the domain parameter for both. Am I missing something?

bwanshoom avatar Jul 29 '23 17:07 bwanshoom

This is only applicable if instance_url is passed. If that parameter is omitted, it works correctly.

bwanshoom avatar Jul 29 '23 17:07 bwanshoom

I have the same requirement to do JWT-based auth along with My Domains.

It looks like the only solution is to fork this repo and fix (or contribute)?

keith-rhodes-0723 avatar Feb 29 '24 13:02 keith-rhodes-0723

This is fixed is the most recent release. Just need to get it pushed back to pypi since there was an error in the pypi deployment.

jon-wobken avatar Feb 29 '24 13:02 jon-wobken

it looks like you pass in the "my" instance url in the instance_url and the domain field contains "login" vs. "test" for the aud parameter; nice. Any idea when the latest version will be pushed to pypi?

keith-rhodes-0723 avatar Feb 29 '24 14:02 keith-rhodes-0723

Just need to figure out why we are getting an auth error on the travis-ci deployment to pypi.

jon-wobken avatar Feb 29 '24 14:02 jon-wobken