This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Retrieving URL, username, password or authentication token within main.js file

Hello,

I am building a plugin for M-Files client which works with the REST-API. For the "plugin to server" communication to work, the client side plugin needs an authentication token.

Since the user has already logged in to the M-Files Desktop Client I would not like to ask the users to enter the server URL, user name and password into my plugin as well.
Instead I would like to make the plugin take care of the authentication in the background.

My plugin is started trough the main.js when a command button, within the M-Files UI, is pressed
I was hoping there is a way to retrieve the current URL, username and password or the authentication token alone.
Then I could pass it to the plugin for automatic authentication.
In case of retrieving only the token, I could use it directly for GET / POST calls.

Also, is there a way to check whether the returned authentication token is valid or just a dummy token?
Currently the authentication call returns a token even if the login credentials are not matching the vault.

Thank you for your response :)

Conclusion:


I don't believe that this will be possible.  You cannot extract the credentials from the running client in that way.




Parents
  • Hello Craig,

    See this picture please https://imgur.com/Y5N0a7j
    The button highlighted by green color runs an external process called 3DView.

    This 3DView process is what I refer to as a plugin.
    3DView is supposed to do the communication with a server under a certain identity.

    You can see a popup window asking for credentials which would be used to authenticate the certain user.
    I would like to omit this step. Perhaps by passing a string of "authenticationToken" when I launch the 3DView when the highlighted button is clicked.

    This is the main.js https://imgur.com/RyKN99S which starts 3DView.exe an I pass few strings as a parameter. Here I would like to pass the current URL, Username, Password / URL , authentication token.
Reply
  • Hello Craig,

    See this picture please https://imgur.com/Y5N0a7j
    The button highlighted by green color runs an external process called 3DView.

    This 3DView process is what I refer to as a plugin.
    3DView is supposed to do the communication with a server under a certain identity.

    You can see a popup window asking for credentials which would be used to authenticate the certain user.
    I would like to omit this step. Perhaps by passing a string of "authenticationToken" when I launch the 3DView when the highlighted button is clicked.

    This is the main.js https://imgur.com/RyKN99S which starts 3DView.exe an I pass few strings as a parameter. Here I would like to pass the current URL, Username, Password / URL , authentication token.
Children
No Data