Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Getting the below error once i try to add TtmCdEnvironment id in SDL Web 8

 Add-TtmCdEnvironment -Id SampleCD -EnvironmentPurpose "Staging" -DiscoveryEndpointUrl http://localhost:8082/discovery.svc 
  -AuthenticationType OAuth -ClientId registration -ClientSecret Reg1str@t10nP@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 Reg1str@t10nP@s ...
+   ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (-AuthenticationType:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I have checked the Discovery service is working fine, but once i define a Content Delivery environment by running command then getting the above error.

share|improve this question
up vote 8 down vote accepted

You should either make sure you put it all on one line - or use the backtick (`) character to continue the command on the second line. It looks like you pasted the two lines from somewhere and PowerShell intepreted them as two separate commands. The first one then failed because you didn't pass in the right credentials - and the second line failed because it is not a valid command.

P.S. You should use the "cmuser" instead of the "registration" user.

share|improve this answer
    
Awesome, many thanks – Priyank Jan 11 at 10:10
    
@Peter the cmuser you are talking about is any user for CM/DB? – Ashutosh May 6 at 10:11
    
No, it's the 'cmuser' oAuth user that is configured by default in Content Delivery. If you've changed it, it should be any user in the 'cm' role. Tridion users and groups are not involved. – Peter Kjaer May 9 at 11:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.