指向同一MVC项目的多个SharePoint应用程序

时间:2022-02-19 23:15:03

I have more than 2 SharePoint apps and I want them to go to the same MVC Project with multiple Areas.

我有超过2个SharePoint应用程序,我希望它们转到具有多个区域的同一个MVC项目。

SharePoint Apps:

SharePoint应用程序:

  1. CRM
  2. CRM
  3. ProjectManagement
  4. 项目管理

MVC Areas

MVC领域

  1. base/CRM
  2. 碱/ CRM
  3. base/ProjectManagement
  4. 碱/项目管理

I've configured the App Manifest to point to the correct URL in each of the SharePoint Apps:

我已将App Manifest配置为指向每个SharePoint应用中的正确URL:

Start Page: base/CRM

The problem's now are:

问题现在是:

1. The web.config only contains 1 ClientId - but each SharePoint app needs its own ClientId - How do I get the correct ClientId to be picked up by the respective apps?

1. web.config只包含1个ClientId - 但每个SharePoint应用程序都需要自己的ClientId - 如何让各个应用程序获取正确的ClientId?

2. I've read that the TokenHelper.cs class stores data per session, so if someone was to jump from CRM to Project Management urls the session would contain the wrong Token information - How do I break this down to work with multiple apps?

2.我已经读过TokenHelper.cs类存储每个会话的数据,所以如果有人要从CRM跳到项目管理网址会话会包含错误的令牌信息 - 如何将其分解为多个应用程序?

1 个解决方案

#1


0  

Both "problems" can only be solved by customizing the default SharePointContext.cs and TokenHelper.cs, because they are designed in this way.

这两个“问题”只能通过自定义默认的SharePointContext.cs和TokenHelper.cs来解决,因为它们是以这种方式设计的。

No one stops you from modifying those files and use whatever clientID (or several IDs) you want depending on the conditions you should consider.

根据您应该考虑的条件,没有人阻止您修改这些文件并使用您想要的任何clientID(或多个ID)。

#1


0  

Both "problems" can only be solved by customizing the default SharePointContext.cs and TokenHelper.cs, because they are designed in this way.

这两个“问题”只能通过自定义默认的SharePointContext.cs和TokenHelper.cs来解决,因为它们是以这种方式设计的。

No one stops you from modifying those files and use whatever clientID (or several IDs) you want depending on the conditions you should consider.

根据您应该考虑的条件,没有人阻止您修改这些文件并使用您想要的任何clientID(或多个ID)。