Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure AD: Requesting a token using device code failed with 401

I am trying to use Azure AD with device code flow. I've created an application and tried to request a code using this client id. The request to code succeed and I was able to approve the login. But, when I tried to request a token using the device code, the request failed with the following error:

AADSTS70002: The request body must contain the following parameter: 'client_secret or client_assertion'.

As far as I can tell, this flow does not require any credentials so I am not sure why this error occurred. I was able to reproduce it using different languages and different Adal libraries (NodeJS, C#) and also by using Postman. So I am pretty sure this is not a bug in a specific library. Probably something I misconfigured - although it is unclear to me what. Could you help me figure this out?

like image 462
Omer Levi Hevroni Avatar asked Dec 29 '25 08:12

Omer Levi Hevroni


1 Answers

You are trying to use confidential client (web app) to execute a flow that is meant for public clients. Please create a native client application to execute the flow.

like image 164
Kanishk Panwar Avatar answered Dec 30 '25 22:12

Kanishk Panwar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!