1

I have added scope to "Expose an API" on the Azure portal with the reference of Microsoft document and granted API permission to that scope. After that I request a token using postman it returns an error AADSTS70011: The provided request must include a 'scope' input parameter. The provided value for the input parameter 'scope' is not valid.

When I try scope like this {resource}/.default works fine. But, I need scope like {resource}/access_as_user

I have already tried this link, but it did not work.

postman

Dineshkumar P
  • 81
  • 1
  • 12

1 Answers1

2

You have used the wrong authentication flow, and you have granted delegated permissions. In this case, you should use the auth code flow.

Then you can set the scope to: api://{resource}/access_as_user.

Add:

This is my test process:

  1. First obtain the authorization code in the browser:
https://login.microsoftonline.com/xxxxxxxx-bd27-40d5-8459-230ba2a757fb/oauth2/v2.0/authorize? 
client_id=5f11e827-xxxx-4f1f-aa05-33a33f806aab
&response_type=code
&redirect_uri=https://jwt.ms/index
&response_mode=query
&scope=api://c848e37d-xxxx-4cd8-b9bf-0b2aa6927a82/access_as_user
&state=12345
  1. Use the authorization code to redeem the access token:

enter image description here

Carl Zhao
  • 8,543
  • 2
  • 11
  • 19