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粉3602660952024-02-18 09:46:34
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
Set environment variables in Postman (click the icon in the upper right corner) clientid, clientsecret and your values and oauth2scope(content:.)
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)
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