I have embedded the FolderBrowserWidget in a custom application that authenticates the widget with CS using an OTDS Ticket in the connector. Here is a code snippet showing how it gets instantiated and started. (This is an Angular TypeScript application)
const otdsToken: string = this.userLocalStorageService.getOtdsToken();
csui.onReady(() => {
const connector = new csui.util.Connector({
connection: {
url: this.configurationService.ContentServerUrlWithApiUrl,
supportPath: this.configurationService.ContentServerSupportPath,
// AuthenticationHeaders: OTDSTicket is a token retrieved from OTDS.
authenticationHeaders: {
OTDSTicket: otdsToken
}
},
start: this.startNode
});
this.folderBrowser = new csui.widget.FolderBrowserWidget({
connector: connector,
start: { id: this.startNodeId },
breadcrumb: {
stop: { id: this.startNodeId },
limit: 1
},
facetPanel: {
expandFirstFacet: true
},
backButton: true,
menuFilter: [{ id: "delete" }, { id: "Delete" }, { id: "DELETE"}],
menuMatch: ["default", "download", "properties", "properties_general"]
});
this.folderBrowser.show({
placeholder: "#folderBrowser"
});
this.folderBrowser.on("containerOpened", (args) => {
this.containerOpened = true;
});
});
The otdsToken is an OTDS SSO token that has been previously retrieved and saved.
This code works to get the widget showing the folder in CS that we want. We can download a document, pull up its properties, etc using the FolderBrowserWidget's built in functionality without a problem. However, clicking on the Edit link causes a new browser tab to open to the Content Server UI itself to launch the Office Editor Client. The problem now is that the first time this second tab opens, Content Server isn't authenticated using the client-side cookie that would otherwise have been set if the logged in user had previously signed into Content Server directly.
This is unacceptable as we do not want to force the user to authenticate again. Is there any sort of way that the Edit link in the widget can be customized to provide the OTCS ticket it is already using? Or is this a limitation of Content Server itself that it absolutely has to have a cookie set in order to be logged in to identify the user? Is there any way that we can set this cookie programmatically before the edit link is clicked in the widget?