Jump to content

Help Needed - Getting basic Teams Presence Alert to Work


Recommended Posts

Hello,

We've recently invested in IBridge, and while testing the functionality on a simple auto-task to poll the ticket requester's  MSTeams status and report to the timeline, we're getting
issues with the connected that we need assistance with. When we add the error code to the output to the timeline we get this, the other fields (status, availablity, etc) are all
blank.

I've confirmed the Hornbill automation is getting passed a working UPN as this is the same as the user's primary email address. 

Error: Failed to get user details from Teams: Refresh Token Generation Error: AADSTS900144: The request body must contain the following parameter: 'grant_type'.

Can anyone assist?

Many thanks,

Ben

Link to comment
Share on other sites

  • 2 weeks later...

I got back from holiday and I have just received the same error. It was working on 26th March for us (midday) but seems to have stopped working for my Team by later that day (16:38 on 26th March); but by then I had gone on holiday...

The error from the node is:

Failed to get user details from Teams: Refresh Token Generation Error: AADSTS900144: The request body must contain the following parameter: 'grant_type'. Trace ID: dc90567b-0216-451f-a338-2fc966304900 Correlation ID: ca80b545-840e-4d70-af99-f1abad2768f7 Timestamp: 2024-04-08 06:49:40Z

Status: failed

I cannot see anywhere that we need to specify the "grant_type" in the config:

image.thumb.png.979005d8124352cec2bbf20765ec80b3.png

@Steve G is there an error in the iBridge somewhere?

MS Co-Pilot gave me this:

The AADSTS900144 error typically occurs during token generation in the context of OAuth 2.0 authentication. Let’s troubleshoot this issue:

  1. Missing Grant Type Parameter:

    • The error message indicates that the request body must contain the parameter ‘grant_type’.
    • Ensure that you include the ‘grant_type’ parameter in your HTTP POST request.
    • Also, make sure to add an ampersand (&) before the ‘grant_type’ parameter in the request body.
    • Example: grant_type=client_credentials.
  2. Resource Parameter:

    • You don’t need to include the ‘resource’ parameter in the same body.
    • Remove the ‘resource’ parameter from the request body.
    • The ‘resource’ parameter is typically used for older authentication scenarios and is not required for client credentials flow.
  3. Content-Type Header:

    • Set the Content-Type header to ‘application/x-www-form-urlencoded’ in your HTTP POST request.
    • This ensures that the request body is formatted correctly.
  4. Check for Typos or Encoding Issues:

    • Verify that your client ID, client secret, and other parameters are correctly encoded and free of typos.
    • Double-check the values you’re using.
  5. Postman Configuration (if applicable):

    • If you’re using Postman, ensure that you select “Send client credentials in body” instead of “Send as Basic Auth header” in the Authorization tab.
    • This ensures that the credentials are included in the request body.
  6. Browser Issues (if relevant):

    • Clear cookies from your browser or try running the tool in private mode.
    • Check for any pending Windows updates.

Remember that troubleshooting may vary based on your specific use case and environment. If you encounter any further issues, feel free to seek additional assistance or provide more details about your setup. 🛠️

Link to comment
Share on other sites

@Ben Maddams @Berto2002,

This was a defect in the Keysafe Key Type definition for Teams Presence which could prevent the refresh of expired access tokens. It's been fixed and should work on your instance now. Depending on your Microsoft refresh token expiration policy, this may just work now for you, or if you get  Refresh Token Expired type error then you'll need to revoke and reconnect your affected key(s).

We've also added automated tests to prevent defects of this type again in the future.

Cheers,

Steve 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...