question

NagaSureshKumarChinni-3688 avatar image
0 Votes"
NagaSureshKumarChinni-3688 asked sikumars commented

401 error while authenticating Registered Apps with MSIdentityPlatform

I've been getting 401 error when trying to authenticate my registered application in Azure AD from azuredevops pipeline using terraform. I've used the same ClienID/Secret key which I've generated a few seconds ago.

Could anyone able to help here? Error message.
Error: getting authenticated object ID: Error listing Service Principals: autorest.DetailedError{Original:adal.tokenRefreshError{message:"adal: Refresh request failed. Status Code = '401'.
Response body: {\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret is provided.\\r\\nTrace ID: d27286a5-767c-4573-9e29-dca0ac0f6c00\\r\\nCorrelation ID: a9d16e72-ff24-4dcc-8b1e-6b3f4f86c401\\r\\nTimestamp: 2021-08-16 07:31:57Z\",\"error_codes\":[7000215],\"timestamp\":\"2021-08-16 07:31:57Z\",\"trace_id\":\"d27286a5-767c-4573-9e29-dca0ac0f6c00\",\"correlation_id\":\"a9d16e72-ff24-4dcc-8b1e-6b3f4f86c401\",\"error_uri\":\"https://login.microsoftonline.com/error?code=7000215\"} Endpoint https://login.microsoftonline.com/xxxxxxxxxx-bf16-4119-8725-xxxxxxxxxx/oauth2/token?api-version=1.0", resp:(*http.Response)(0xc00079d0e0)}, PackageType:"azure.BearerAuthorizer", Method:"WithAuthorization", StatusCode:401, Message:"Failed to refresh the Token for request to https://graph.windows.net/xxxxxxxx-bf16-4119-8725-xxxxxxx/servicePrincipals?%24filter=appId+eq+%27xxxxxxxx-e94e-499c-9c74-xxxxxx%27&api-version=1.6", ServiceError:[]uint8(nil), Response:(*http.Response)(0xc00079d0e0)}

I'm using terraform v0.13 and ad version is v1.6.0, azuredevops version is v0.1.6

azure-ad-adal-deprecation
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Just checking in to see if the below answer helped. If this answers your query, please don’t forget to click "Accept the answer" and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.
Thanks,

0 Votes 0 ·

1 Answer

sikumars avatar image
0 Votes"
sikumars answered sikumars edited

Hello @NagaSureshKumarChinni-3688,

Thanks for reaching out.

From the error message it shows as "Invalid client secret is provided". Could you please make sure you are using right secret value by comparing with first few shown value also verify expiry date of secret that you are using from Azure AD app registration blade? or try creating new client secret and see if that works.

123898-image.png

Additionally, I would recommend you to verify if you are using recent update of terraform Azure providers to avoid some know issues.

Hope this helps.


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


image.png (46.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.