WaelHamze / dyn365-ce-vsts-tasks

VSTS Extension for Dynamics 365 Customer Engagement
https://marketplace.visualstudio.com/items?itemName=WaelHamze.xrm-ci-framework-build-tasks
GNU General Public License v3.0
117 stars 56 forks source link

Authentication using Client Secret #147

Closed TomasGold closed 4 years ago

TomasGold commented 4 years ago

I cannot seem to be able to authenticate using Client Secret despite using the same connection string without an issue elsewhere. Reading @WaelHamze's statement, it should be supported.

  1. Has anybody successfully used Client Secret authentication? AuthType=ClientSecret;url={DynamicsURL};ClientId={AppId};ClientSecret={ClientSecret}

  2. Does anybody have any suggestion on how to troubleshoot? The generic Unable to Login to Dynamics CRM error does not point me anywhere and I can connect with the identical connection string from my desktop.

Thanks! Tomas

WaelHamze commented 4 years ago

@TomasGold where are you facing this issue? In PowerShell or the Tasks?

TomasGold commented 4 years ago

@WaelHamze Tasks

WaelHamze commented 4 years ago

@TomasGold can you connect with username/password successfully on that agent/pipeline?

TomasGold commented 4 years ago

Yes, that works fine so it does not seem to be agent/pipeline related. Any other idea?

Thanks for picking this up by the way!

phuocle commented 4 years ago

Just test the Ping task and it worked.

joshcampbell191 commented 4 years ago

@TomasGold We're currently using this connection string in our environment without any issues.

Here's our connection string as an example: AuthType=ClientSecret;Url=$(crm.url);ClientId=$(tenant.appId);ClientSecret=$(tenant.secret)

Is it a task in particular or does it happen for every task? I also noticed that the 'u' from Url is lower case. Can you please try with an uppercase 'U' instead?

TomasGold commented 4 years ago

@joshcampbell191 Thank you for the time you took to respond. I cannot re-test it right now in the same environment but I will close this issue since multiple people confirmed this works. I am not sure why I could not make it work. Perhaps the lower case U was the root cause.