If you want to create an identity in Environment B, then that is where you create your clientid and secret in the UI. Once that is done, use that clientid and secret in Environment A to call the API in Environment B. That is the correct endpoint and if you need the token URL it will be http://EnvironmentB/identityiq/oauth2/token
Thanks for your response. Just to confirm the client and secret will be created from Environment B thereafter using that client and secret I will call http://EnvironmentB/identityiq/oauth2/token and other endpoints in Environment A?
Also just to confirm the client and secret can only be created from the UI, Global Settings → API Authentication?
Yes, Environment B → Create clientID and secret. Also has the endpoints you want to add users with.
Environment A → uses the Env B credentials to call the Env B endpoints.
The UI is by far the easiest way to create and access the clientID and secret. There are other more complicated ways like creating it from scratch but are rarely used.