Integrating with the Mender API

I’d like to integrate the Mender API into my own application, but am unsure how the API tokens should be managed. The documentation shows how to get a token for a user using the /api/management/v1/useradm/auth/login endpoint but isn’t clear about what practices I should follow if I want to call the Mender API from my application.

If I pregenerate a token will it eventually expire? What is the recommended way of handling this? Should I bake my username/password into my application so I can regenerate tokens once they expire? Or is there a better way of handling this?

Hi @samlewis,

Not really my are my area but will try to cover the parts that I know,

Yes the generated token will expire and I believe it is valid for seven days, meaning that you will need to have a mechanism in place to refresh. I do not really know what the best practice is here and hopefully someone else might provide some insights.

Thanks @mirzak, would love to hear more about this from your team.