# We recognise this app but we can't understand it's OAuth request

**URL:** <https://api-discuss.freeagent.com/t/we-recognise-this-app-but-we-cant-understand-its-oauth-request/1489>\
**Category:** Authentication\
**Created:** [31 May 2019 18:33 UTC](https://api-discuss.freeagent.com/t/we-recognise-this-app-but-we-cant-understand-its-oauth-request/1489 "2019-05-31T18:33:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![praveen.premaratne](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/praveen.premaratne/32/319_2.png) [@praveen.premaratne](https://api-discuss.freeagent.com/u/praveen.premaratne)\
**Post date:** [31 May 2019 18:33 UTC](https://api-discuss.freeagent.com/t/we-recognise-this-app-but-we-cant-understand-its-oauth-request/1489/1 "2019-05-31T18:33:49Z")

</div>

I’ve created an app for a project of my company, that requires me to create an application to access certain information to generate an Excel spreadsheet for the management team to make their lives easier.

So I’ve looked into the API docs and created an app on the Developer Dashboard. Now I’m trying to get the OAuth Authorization endpoint to authenticate with my account (standard employee with no administrative access to the company). All is going well until I login to FreeAgent and I get the following error.

```
Sorry, there's been a problem

We recognise this app but we can't understand it's OAuth request.
Please get in touch with the author of the application you're trying to approve.

```

As far as I can see it recognise the correct app, but I haven’t got a clue what this error means.

I used the following endpoint for the authorisation request:  
`https://api.freeagent.com/v2/approve_app?client_id=REDACTED&response_type=200`

I’ve set the redirect URL on the app itself so I omit that here according to API docs.

Is there something I’m missing on the request or any idea why this is happening?

Also does it not need the **OAuth secret**? Since there is no mention of that on the [API docs](https://dev.freeagent.com/docs/oauth#the-authorisation-request).

Thanks in advance

Prav

---

<div class="post-metadata">

**Author:** ![David\_Jones](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/david_jones/32/55_2.png) [@David\_Jones](https://api-discuss.freeagent.com/u/David_Jones)\
**Post date:** [3 June 2019 11:02 UTC](https://api-discuss.freeagent.com/t/we-recognise-this-app-but-we-cant-understand-its-oauth-request/1489/2 "2019-06-03T11:02:40Z")

</div>

Hi Praveen,

> I used the following endpoint for the authorisation request:  
> `https://api.freeagent.com/v2/approve_app?client_id=REDACTED&response_type=200`

It looks like you’re missing a few query parameters from your authorisation request. You’re correctly supplying your `client_id`, although you’re missing the `response_type=code` argument.

Also, contrary to our documentation, you **do** need to supply your `redirect_uri`. This paramter used to be optional but we [made it compulsory](https://api-discuss.freeagent.com/t/forthcoming-api-oauth-restriction-change/643) a few years ago to mitigate against potential man in the middle attacks. I’ll get that documentation updated now.

Here’s an example URL that you can copy, just be sure to replace `example.com/oauth/callback` and `[redacted]` with the values for your integration.

```auto
https://api.freeagent.com/v2/approve_app?redirect_uri=https%3A%2F%2Fexample.com%2Foauth%2Fcallback&response_type=code&client_id=[redacted]

```

> Also does it not need the **OAuth secret**? Since there is no mention of that on the [API docs](https://dev.freeagent.com/docs/oauth#the-authorisation-request).

No, the OAuth Secret isn’t used in the authorisation request, it’s used [in the next step](https://dev.freeagent.com/docs/oauth#the-access-token-request) where you swap the authorisation token for a refresh and access token.

I hope this helps!

---

<div class="post-metadata">

**Author:** ![David\_Jones](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/david_jones/32/55_2.png) [@David\_Jones](https://api-discuss.freeagent.com/u/David_Jones)\
**Post date:** [26 June 2019 12:05 UTC](https://api-discuss.freeagent.com/t/we-recognise-this-app-but-we-cant-understand-its-oauth-request/1489/3 "2019-06-26T12:05:00Z")

</div>

> Also, contrary to our documentation, you **do** need to supply your `redirect_uri` . This paramter used to be optional but we [made it compulsory](https://api-discuss.freeagent.com/t/forthcoming-api-oauth-restriction-change/643) a few years ago to mitigate against potential man in the middle attacks. I’ll get that documentation updated now.

Just to confirm, the our [OAuth documentation](https://dev.freeagent.com/docs/oauth) has now been updated. Thanks for flagging this issue, Praveen!

> - `redirect_uri`_(required) must be url escaped and match with a redirect\_uri registered in your [Developer Dashboard account](https://dev.freeagent.com/apps)._

---

<div class="post-metadata">

**Author:** ![praveen.premaratne](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/praveen.premaratne/32/319_2.png) [@praveen.premaratne](https://api-discuss.freeagent.com/u/praveen.premaratne)\
**Post date:** [21 October 2020 21:47 UTC](https://api-discuss.freeagent.com/t/we-recognise-this-app-but-we-cant-understand-its-oauth-request/1489/4 "2020-10-21T21:47:39Z")

</div>

Hi David,

Thanks for looking into this and sorry for the very late response.

I’ve managed to get it to work now.

Thanks  
Prav
