“One or more claims either missing or does not match with the open authentication access control policy.”

Trying to call a Power Automate that is triggered by an HTTP request that requires authentication.

Interestingly, the official docs only give one side of the story – how to set it up. There’s no info on how to call it, but there are posts such as this one.

I want to call it from PowerShell. It’s all very straight forward, but I struggled with it today. This is what I was trying:

On paper this should work, but I kept getting an error:

I examined the token in jwt.ms and the claims seem fine. From the docs, the following claims are needed:

I had all of those, so it made no sense.

As usual, I faffed around by trying to connect as a user and wasted time on that – but it too didn’t work.

Then I realized, the audience values look like this:

But in my claims, it doesn’t have the slash.

Could that be it?

So I modified the scope in the code from

to

and tried again.

And this time it worked!

How irritating! 😠