grant_type parameter missing in Postman
P粉639667504
P粉639667504 2024-02-17 11:16:03
0
1
445

I'm using the Brightspace API.

I am using the post method, the URL is https://auth.brightspace.com/core/connect/token

Reference link here

I have all the details below

Auth URL,
Access Token URL,
Client Id,
Client Secret,
Scope,

The Grant type is , and I chose the Authorization Code option.

In the header, Content-Type is also application/json

Now when I click the send button I get the error

{
    "error": "invalid_request",
    "error_description": "Missing \"grant_type\" parameter"
}

Any idea where I'm getting this error?

P粉639667504
P粉639667504

reply all(1)
P粉360266095

You cannot directly call the POST method of response type "Code" Since after the POST call, Keycloak (IdP server) redirects to the registered URL (redirect_uri) for the login activity. Fortunately, In the Postman can do this via Get New Token in OAuto 2.0 mode.

I don't have the client ID/secret for my D2L Brightspace account so I can't demonstrate how to do it, but I captured the image from the video tutorial.

You can do this using your client ID/secret. step

  1. Set environment variables in Postman (click the icon in the upper right corner) clientid, clientsecret and your values ​​and oauth2scope(content:.)

  2. Start "Get New Token" Select the "Authorization" tab, select the "OAuth 2.0" type, "Request Headers" and click "Get new access token" in the request (can also be in the collection)

  3. Set the fields of each parameter

Enter 3 URLs from 1~3

Enter 3 environment variables from 4~6, where {{ variable name }}

Click "Request Token" and it will get the access token. More details in here, Video and Postman Collection

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!