得到错误{“错误”:“invalid_grant”}添加TtmCdEnvironment ID在SDL Web8


5

提示以下错误:一次我尝试添加TtmCdEnvironment ID在SDL网站8

Add-TtmCdEnvironment -Id SampleCD -EnvironmentPurpose "Staging" -DiscoveryEndpointUrl http://localhost:8082/discovery.svc 
    -AuthenticationType OAuth -ClientId registration -ClientSecret [email protected]@ssw0rd 
Add-TtmCdEnvironment : Unable to save item of type 'CdEnvironmentData' with id 'SampleCD'. 
One or more errors occurred. 
Authorization failed while attempting to communicate with CD Discovery Service 'http://localhost:8082/discovery.svc'. Please 
make sure the proper credentials have been configured in the CD Environment 'SampleCD'. 
An error occurred while processing this request. 
{"error":"invalid_grant"} 
At line:1 char:1 
+ Add-TtmCdEnvironment -Id SampleCD -EnvironmentPurpose "Staging" -DiscoveryEndpoi ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : NotSpecified: (Tridion.Topolog...ironmentCommand:AddCdEnvironmentCommand) [Add-TtmCdEnvironment] 
    , DataServiceException 
    + FullyQualifiedErrorId : Tridion.TopologyManager.Automation.AddCdEnvironmentCommand 

-AuthenticationType : The term '-AuthenticationType' is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. 
At line:2 char:3 
+ -AuthenticationType OAuth -ClientId registration -ClientSecret [email protected]@s ... 
+ ~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : ObjectNotFound: (-AuthenticationType:String) [], CommandNotFoundException 
    + FullyQualifiedErrorId : CommandNotFoundException 

我已经检查了发现服务工作正常,但是一旦我通过运行命令定义一个Content Delivery环境,然后得到上述错误。

8

您应该确保将其全部放在一行上 - 或者使用反引号(')字符在第二行继续执行该命令。看起来你从某处粘贴了两行代码,PowerShell将它们解释为两个单独的命令。第一个失败,因为你没有传入正确的证书 - 第二行失败,因为它不是一个有效的命令。

P.S.您应该使用“cmuser”而不是“注册”用户。

  0

真棒,非常感谢 11 1月. 162016-01-11 10:10:02

  0

@你在说的cmuser是否是CM/DB的用户? 06 5月. 162016-05-06 10:11:56

  0

不,这是在Content Delivery中默认配置的'cmuser'oAuth用户。如果你已经改变了它,它应该是'cm'角色中的任何用户。 Tridion用户和组不参与。 09 5月. 162016-05-09 11:13:31