This sounds like the authentication of your app users should go via some other identity provider. (https://en.wikipedia.org/wiki/Identity_provider). You could check the Mendix app store for modules in the category Authentication. There are some modules there that do something similar as what you described. For instance, the SAML module: https://appstore.home.mendix.com/link/app/1174/Mendix/SAML. This module can replace your app's default login behaviour.
See also this module: https://appstore.home.mendix.com/link/app/107925/Magnus-Consulting/AutoLogin
You could tweak this module and create another webservice that generates the token.
So one webservice that based on an account name returns a token. And then this module in combination with the deeplink module to login that user.