Office应用程序:我的任务窗格应用程序未获得许可'?et ='许可令牌 [英] Apps for Office: my task pane app doesn't get the licensing '?et=' license token

查看:361
本文介绍了Office应用程序:我的任务窗格应用程序未获得许可'?et ='许可令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MSDN文档说:

调用您应用程序URL的Office应用程序将添加以下查询 字符串,然后传递URL: http://fooservice.com/index.htm?et= PAByAD4APAB0ACAAYQBpAGQAPQ ....(->此字符串会持续一段时间-Mihaly KR)

The Office application calling you app's URL would add the following query string to it and then pass the URL: http://fooservice.com/index.htm?et= PAByAD4APAB0ACAAYQBpAGQAPQ .... (->this string goes on for a while - Mihaly KR)

我已经尝试了所有方法,但都没有发布(或获取)任何内容,没有?et参数.

应用程序可以在Office中正常加载,但是我想从令牌中获取客户端ID,因此可以在服务器上进行永久存储. 我做了一个php页面,其中显示了所有的get和post参数,并将其设置为APP源,因此我可以看到正在发布的内容.

I've tried everything, but nothing gets ever POSTed (or GETted), no ?et parameter.

The app loads fine in Office, but I want to get the client id from the token, so I could do a permanent storage on my server. I did a php page which prints all get and post parameters, and set it as the APP source, so I can see, what is getting posted.

我的清单文件taskpaneapp.xml

<?xml version="1.0" encoding="utf-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:type="TaskPaneApp">
  <Id>08afd7fe-1631-42f4-84f1-5bc51e242f98</Id>
  <Version>1.0</Version>
  <ProviderName>Microsoft</ProviderName>
  <DefaultLocale>EN-US</DefaultLocale>
  <DisplayName DefaultValue="Get token"/>
  <Description DefaultValue="Test app for getting token"/>
  <IconUrl DefaultValue=
    "http://officeimg.vo.msecnd.net/_layouts/images/general/office_logo.jpg"/>
  <Capabilities>
    <Capability Name="Document"/>
    <Capability Name="Workbook"/>
  </Capabilities>
  <DefaultSettings>    
    <SourceLocation DefaultValue="http://taskpaneapp.misc.dev.nomo.hu/print_r.php"/>    
  </DefaultSettings>
  <Permissions>ReadWriteDocument</Permissions>
</OfficeApp>

我的令牌文件taskpaneapp.tok

<r>
  <t 
    aid="WA900006056" 
    pid="{08afd7fe-1631-42f4-84f1-5bc51e242f98}" 
    cid="32F3E7FC559F4F49" 
    did="{0672BAE9-B41B-48FE-87F1-7F4D3DD3F3B1}" 
    ts="30" 
    et="Trial" 
    ad="2012-01-12T21:58:13Z" 
    ed="2012-06-30T21:58:13Z" 
    sd="2012-01-12T00:00:00Z" 
    te="2012-06-30T02:49:34Z" />
  <d>VNNAnf36IrkyUVZlihQJNdUUZl/YFEfJOeldWBtd3IM=</d>
</r>

MSDN文档在令牌文件架构上不一致,有些在pid中使用{},有些则没有.我都尝试过,但都没有.

MSDN docs are inconsistent on the token file schema, some use {}s in pid and did some does not. I've tried both, none of them worked.

我的注册表项是:

key: taskpaneapp
value: \\NOMONAS\....\taskpaneapp.xml

我尝试了

key: entry1
value: \\NOMONAS\.....\taskpaneapp.xml

也没用.

MSDN文档是否过时了?别这么认为,它们在2014年2月进行了更新,据说与Office Apps JS API 1.0和1.1兼容

Are the MSDN docs outdated? Don't think so, they were updated in Febr, 2014 and are said to be compatible with Office Apps JS API 1.0 and 1.1

如果您有任何建议或遇到相同的问题,请帮助我.任何建议将不胜感激.

Please help me if you have any suggestions, or faced the same problems. Any suggestion would be greatly appreciated.

更新1:,所以我发现Office已成功读取令牌文件.

update 1: So I figured out that token file is successfully read by Office.

将许可证状态设置为试用"时,启动时,任务窗格应用程序的左上角会显示一条通知. MSDN文档非常混乱,在此处表示,该令牌文件pid参数必须放在方括号中,

When setting license status to "Trial", a notification appears on the top left corner of the task pane app when started. MSDN documentation is very confusing, here it says, that token file pid param must be in brackets, here it is used without brackets. After a lot of trial and error, it turns out that token file is only read if the pid is in brackets.

最重要的是,我将.tok文件更改为包含pid="{08afd7fe-1631-42f4-84f1-5bc51e242f98}".我想我将令牌模式"页面设为真实,因此我将cid和aid属性更改为也包含{} -s.

Bottom line, I changed my .tok file to have pid="{08afd7fe-1631-42f4-84f1-5bc51e242f98}" in it. I guess I'll take the Token Schema page to be true, so I changed the cid and aid attributes to also include {}-s.

但是我仍然没有得到?et参数.

But I still don't get the ?et parameter.

推荐答案

原来这是Office错误(duh). 在此

Turns out this is an Office bug (duh). In this forum post, microsoft official says the following:

经过研究,看来这是Office 15的已知问题" SP1,因为从注册表加载的哪些应用程序未获取信息 返回预期.

After my research it seems that this is a "known issue" with Office 15 SP1 because of which apps loaded from the registry are not getting et returned as expected.

解决方法:

?et get参数直接输入到xml中,然后忘记MSDN文档告诉您的有关.tok文件和编辑注册表的所有信息.

put the ?et get parameter right into your xml, and forget everything MSDN docs told you about the .tok file and editing the registry.

<SourceLocation DefaultValue= http://myofficeapp.com?et=<base64 encoded token>

为方便起见,这是MSDN文档中的示例令牌字符串

For your convenience, here is a sample token string from MSDN docs

http://myApp/index.htm?et=PAByAD4APAB0ACAAYQBpAGQAPQAiAFcAQQAxADAAMgA4ADkAOQA1ADYANgAiACAAcABpAGQAPQAiADMAZAAyADgANwAwADcAYQAtAGYAYwBjAGUALQA0ADUAMQA3AC0AYQBjADYAZQAtAGMAYQAwAGEAZABkADYAMwA3ADMAYQBhACIAIABjAGkAZAA9ACIAMgAzAEEANwBFAEIAOABBADQAQwA0ADcARgA1AEEAMgAiACAAdABzAD0AIgAwACIAIABzAGwAPQAiAHQAcgB1AGUAIgAgAGUAdAA9ACIARgByAGUAZQAiACAAYQBkAD0AIgAyADAAMQAyAC0AMAA1AC0AMgAyAFQAMQA4ADoAMQAyADoAMgAzAFoAIgAgAHMAZAA9ACIAMgAwADEAMgAtADAANQAtADIAMgAiACAAdABlAD0AIgAyADAANgA3AC0AMAAyAC0AMgAzAFQAMQA4ADoAMQA0ADoAMAAwAFoAIgAgAC8APgA8AGQAPgAyADIAWABLAEEAdgA0ADMAQgBtAHMAcwByADAAcgBxADUANQBGAHUAdgBpAFUAVgBSAGkAVgBLAFMASQBEAGcAeAAyAHAAMgA0AFoAZwBzAGwANgBNAD0APAAvAGQAPgA8AC8AcgA%2bAA%3d%3d

这篇关于Office应用程序:我的任务窗格应用程序未获得许可'?et ='许可令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆