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

REST API for opening documents (based on M-Files permissions)

Hi M-Files and community, 

We are working currently on REST API enabling opening of documents in M-Files based on specific business ID. After some difficulties (hosting in IIS and Kerberos), we have made it working well. This is a use case:

  1. We have REST-based API https://<Our Hostname>/api/<Doc ID> other systems can use to link with documents in M-Files
  2. Our solution connects with worker process user and search for latest version through M-Files REST-based API and gets pre-calculated view link (M-Files link to open document in browser, we use PDFs so this works well)
  3. Solution then re-directs to this view link over M-Files OpenUrl launcher app (works also well) and document is opened in M-Files client

If the user is logged in (has open session), M-Files would try to open the document and in case user does not have access, it would provide error that link does not exist. 

If the user does not have open session, the same cryptic error would occur (I don't have access now to the system so can not provide message). 

It is somehow not satisfying as we would need better information for end users from M-Files. We want however to verify document access by M-Files so we do not enable opening of some security documents by everyone. We have originally discussed this solution with M-Files architect and it was recommended for our use case.

Does someone has an idea how to get better information?

Is it possible to force login when we send view link to M-Files client? In that case, we would get an error only in case users do not have access on document. As we use windows authentication for connection, M-Files does not pop-up log in window (username and pwd). Could this be configured to automatically logged in when someone tries to open view link?

Or to check, if some user account has an open session on server in the first place (worker process user is system admin so could call everything)?

Many help for your suggestions.

Dejan

  • Hm, just tested on our cloud environment: when I try to open it if user is not logged in it pops up "Log In to M-Files" window.

    Hm, is this pop up window only limited for connections specified with "Specific Windows user"? This could be potential problem as we have connections created "Current Windows User" on our production environments. My expectations would be that M-Files log in over this connection or at least ask user to log in.

    Does someone now why this "Current Windows User" is not triggered!?