The default behaviour set in the document library is to open document in the client application.
This is the code to generate the link (found here https://sharepoint.stackexchange.com/a/231055/20605):
var linkDoc = "ms-word:ofe|u|https://contoso.sharepoint.com" + data.d.results[i].FileRef;
I've tried to put my SharePoint Online URL in Intranet Sites (Internet Options), but when the document is opened in my client application (Word 2016) it keeps to asking me credentials.
Is there a way to stop asking credentials? If is a problem of the link, is there an alternative way to open document in client application?