Unable to refresh Access Token in Oauth configuration while making API requests

Hi Team,

We are having a custom application to integrate Freshdesk and Mavenlink. We are using Oauth 2.0 for authorizing the API calls.

The Oauth_config.json file is as below :

{
    "client_id": "",
    "client_secret": "",
    "authorize_url": "https://app.mavenlink.com/oauth/authorize",
    "token_url": "https://app.mavenlink.com/oauth/token",
    "token_type": "account",
    "grant_type":"authorization_code"
  }

While we make the API call to fetch workspaces for a particular particiapant/Agent using the following URL :

https://api.mavenlink.com/api/v1/workspaces?by_custom_text_value=${field_id_in_ML}:${sfdcID}&has_participant=${participantID}&per_page=200&page=${page}

The app throws an error shown in below :

While trying the same using Postman , we were able to successfully get the access token and also call the API only If the Oauth config in postman has Client Authentication : Send client credentials in Body , if we select Client Authentication : Send as basic auth header , it again throws error.

We need to know which of the Client Authentication method does Our Product (Freshdesk) uses in Oauth or like, How is secret keys are being passed to the auth server? is it sent as basic auth header or in body?

Thanks in advance!

1 Like

If you are building the app on the Freshworks platform with OAuth it relies on RFC6749

Hope this helps:

It appears as if your app is able to get the access token but is unable to refresh it. Can you reproduce this issue in your local on fdk and share the fdk.log file?

Hi Saif,

I have sent the log file via private message.

Thanks in advance.

@Jayanth_Kumar

In the logs I see:

2022-11-08 17:18:43.927 +0530 [debug] (proxy.js) Proxy came back with error as null, body as "{\"errors\":[{\"type\":\"oauth\",\"message\":\"Invalid OAuth 2 Request\"}]}"

Do you happen to know why this occurs? I guess you may have fixed it.

Also grant_type is an attribute not part top level key value pairs in OAuth documentation.

How about we change config to following:

{
    "client_id": "",
    "client_secret": "",
    "authorize_url": "https://app.mavenlink.com/oauth/authorize",
    "token_url": "https://app.mavenlink.com/oauth/token",
    "token_type": "account",
    "options": {
       "grant_type":"authorization_code"
     }
  }

Hi @Saif ,

I changed the config as you suggested butt encountered the same error. Is there any other way we can fix this ASAP, since this ticket was raised as on high priority.

Thanks & Regards

Hi @Saif

To add more context to this issue. This oAuth login with this Mavenlink app was working fine till a few days ago. A client reported this login failure issue on 20th October without any changes in the app. Are you aware of any changes in our platform w.r.t the OAuth authentication?

Requesting your help to expedite this one, as the client has already started escalating it.

There are no changes that are affecting this.

  1. Do you know the lifetime of an access token that Mavenlink issues? Please share the link to its documentation source.
  2. Do you see the same error when you uninstall and reinstall the app + reauthorize it?

Hi @Saif
Here is the Mavenlink API authentication documentation. Mavenlink OAuth access tokens do not expire based on the documentation.

https://developer.mavenlink.com/beta/#section/Authentication

Hope the Response_type is set to “code” while constructing the request URL

https://app.mavenlink.com/oauth/authorize?response_type=code&client_id=abc123&redirect_uri=http%3A%2F%2Fmyapp.com%2Foauth%2Fcallback

Hi @Saif - any update on this issue?

Hi, this issue should be resolved by now. Please get back to us in case of anything else.

Thanks!

2 Likes

Thank you for the support @Sudarsana_Raghavan

As discussed, we have tested it in the sandbox account and appears to be working fine. We have informed the customer and awaiting a response.

1 Like