NextGen Knowledge Center

Authentication

Mirth® Connect supports both session-based cookie authentication and basic authentication.

Basic Authentication:

  • Simply include an Authorization header on all API requests, with basic credentials. Example (for admin/admin):
    • Authorization: Basic YWRtaW46YWRtaW4=

Session-Based Authentication:

  • First, invoke the POST /users/_login endpoint, passing in your login credentials. If successful, the server will respond with a cookie (Set-Cookie header) like the following:
    • Set-Cookie: JSESSIONID=uysqrtx9lle36ernybizstps;Path=/api;Secure
  • Invoke the actual API endpoints of your choice, passing in the same cookie as a header:
    • Cookie: JSESSIONID=uysqrtx9lle36ernybizstps;Path=/api;Secure
  • Once you are done, make sure to call the POST /users/_logout endpoint, making sure to pass in the same cookie.

Session-based Authentication is preferred since you only need to transmit your login credentials once.

Note that the API documentation page invokes the same endpoint automatically when you login at the top:

Image of the API documentation page logon.