'A simple device( no oauth2 context) should send data to .net rest api with AAD Token

So I have a .net 6 rest api running as appservice in azure. the authentication is being done with AAD tokens. My app and web page can login but 1 device that needs to send some information to the database can only make simple HTTPS get, post, put and delete actions but it can never start a oauth2 authentication process to acquire a token.

The only thing the device can do is store a long url. When the get action is required it just sends the https call with that url string.

So have any of you encountered this problem before and how did you solve it?

  1. I was thinking of a Token per device that never expires but AAD does not support this. As they should. :).

  2. Should I create a separate endpoint with user and password login?

Thanks in advance!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source