Refresh token in morpheus plugin

Hello Experts,

  • I am working on the generic plugin integration, And in this plugin I want to get the /api/servers information.
  • Generic integration plugin will get these data through morh-api so it needs to pass the refresh-token. can you suggest me how to get this token if I already logged in morheus ui?

Thanks,

After you have generated a token, you cannot at a later time retrieve the refresh-token per my understanding. Now, I have created the Morpheus Uplink plugin that utilizes Morpheus credentials and does OAuth to query Morpheus API endpoints. This may help you.

More specifically, look at the login method within this file.

Thanks @cbunge , let me try this.

Hi @cbunge, I tried above approach and its working but I need one more enhancement to this flow.
For example: I don’t want to get the credentials from Infrastructure → Trust → UserName & Password. IF I am already logged in through the Morpheus UI, So I want only token to communicate morpheus api. Please suggest me how to achieve this.

Thanks,
Umesh