0

I have registered one app in Azure and teh authentication type is delegated permission type. Now, I am trying to get the access token and below are details of the request.

POST Request 
Endpoint: https://login.microsoftonline.com/{{DirectoryIDforPO}}/oauth2/v2.0/token
{{DirectoryIDforPO}}:12345678-f82d-4cc0-bebd-aa8a6f4f6c58

Authorization Body:
    Key         Value
    grant_type  password
    scope       https://graph.microsoft.com/.default
    username    <<User email>>
    password    <<User password>>

While executing the same I am getting error saying Invalid Client ID.

Kindly suggest what I am missing here.

Thanks in advance!

2 Answers 2

0

The Resource Owner Password Credentials (ROPC) flow is not recommended to be used, as per the documentation at

https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth-ropc

However in addressing the problem you are facing, you'll want to structure your request like the following (note the inclusion of the client id and the specific scopes requested)

POST {tenant}/oauth2/v2.0/token
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded

client_id=00001111-aaaa-2222-bbbb-3333cccc4444
&scope=user.read%20openid%20profile%20offline_access
&[email protected]
&password=SuperS3cret
&grant_type=password
0

You could use OAuth 2.0 to access graph api. You could refer to following document

https://learn.microsoft.com/en-us/graph/auth-v2-user?tabs=http

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.