using POST to login to a webserver using REST api in mendix

I am trying to login to an external webserver using a mendix REST microflow but cannot find a good example or documentation that is helpful. Here is what I am trying to do. register a user on an external webserver use a username and password to login to that external webserver get a return token, save it and use it in the subsequent calls   Please give me some pointers for this example.
1 answers

Here are some pointers that may help:

  1. Refer to this documentation for calling the REST service in general –
  2. It seems like you will have to use custom HTTP headers for your REST calls including the initial authentication POST call. Take a look at the information in this forum question –,  it has the OAuth authentication token handling.
  3. In combination with the above forum question,  please take a look at couple of these related model shares from experts –
  4. Basically, you will see from the example above that once you have accessed the authentication token from the POST response header, you could store it in an entity associated with your Account and retrieve it for subsequent REST calls. If you decide to store it in a persistent entity, it will probably require some delete behavior to clean up this entity whenever the session gets removed.
  5. Alternatively, you could create a non-persistent entity to store the token and associate it directly to the session object. Session object is available in microflows as variable $CurrentSession and you could always retrieve the token from it for your subsequent REST calls.