AADSTS50012: Invalid client secret is provided when moving from a Test App to Production

yfan183 picture yfan183 · Feb 27, 2017 · Viewed 29.1k times · Source

I have two applications registered under the Azure Portal: a test version and a production version. My test App works fine with the Client Id and ClientSecret/AppKey that I got from the test app's detail from Azure Portal. However when I move to the production one as I replace the ClientId and Secret values with the one specified by the production App I registered, I suddenly get an error:

AdalServiceException: AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided

But I'm fairly sure that my client secret is correct as I just copied and pasted from the Portal. Is there any solutions to this?

Answer

fdulau picture fdulau · Nov 21, 2017

Encode your secret ( e.g. replace + by %2B , = by %3D etc)