# OAuth2 Token Refresh Doesn't Work in HTTP Tools (AI Agents)

**URL:** <https://community.n8n.io/t/oauth2-token-refresh-doesnt-work-in-http-tools-ai-agents/59494>\
**Category:** Questions\
**Tags:** oauth2, highlevel\
**Created:** [October 23, 2024, 12:13pm UTC](https://community.n8n.io/t/oauth2-token-refresh-doesnt-work-in-http-tools-ai-agents/59494 "2024-10-23T12:13:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tero](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/tero/32/47987_2.png) [@Tero](https://community.n8n.io/u/Tero)\
**Post date:** [October 23, 2024, 12:13pm UTC](https://community.n8n.io/t/oauth2-token-refresh-doesnt-work-in-http-tools-ai-agents/59494/1 "2024-10-23T12:13:32Z")

</div>

Hi,

We’ve been building workflows in n8n for our company and encountered a recurring issue with OAuth2 token refresh. The issue arises when using HTTP tools for AI agents. Although n8n should refresh the token automatically once it expires, we found that after 24 hours, the HTTP tools stop working due to missing credentials. Video and workflow below are examples of a call to HighLevel oAuth2 API.

Interestingly, running a single HTTP request node calling the API seems to refresh the token and restores functionality for all HTTP tools for 24 hours. It took us quite a while to troubleshoot and pinpoint this behavior. Me or Perplexity couldn’t find this being a known issue.

## Video of the issue

[HTTP tool oAuth2 not refreshing token.mp4](https://talgraf-my.sharepoint.com/:v:/g/personal/tero_vaalamaki_talgraf_fi/EY9GWmmHSSNLiMhqgtMDgkEBaMPgKfGI5U4a1IOQQLgkbg?e=KuuEfL&nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJTdHJlYW1XZWJBcHAiLCJyZWZlcnJhbFZpZXciOiJTaGFyZURpYWxvZy1MaW5rIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXcifX0%3D)

## What is the error message (if any)?

There was an error: “Node does not have credential type”

## Please share your workflow

## Information on your n8n setup

- **n8n version:** 1.56.2
- **Database (default: SQLite):** default
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):** default
- **Running n8n via (Docker, npm, n8n cloud, desktop app):** n8n cloud
- **Operating system:** Window 11

---

<div class="post-metadata">

**Author:** ![ria](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ria/32/99251_2.png) [@ria](https://community.n8n.io/u/ria)\
**Post date:** [October 28, 2024, 8:41am UTC](https://community.n8n.io/t/oauth2-token-refresh-doesnt-work-in-http-tools-ai-agents/59494/2 "2024-10-28T08:41:11Z")

</div>

Hi @Tero

Thanks for reporting this! This should be fixed with version `1.65.0`

> <https://github.com/n8n-io/n8n/pull/11343>
>
> \## Summary
> 
> This PR fixes an undefined response from HTTP Tool node in case au…thentication is enabled.
> 
> Since this PR was merged (https://github.com/n8n-io/n8n/pull/11219) HTTP tool node requires a full response. But the underlying implementation for the request may differ, depending on authentication setting, and so the name of the option to get the full response.
> 
> HTTP Tool Node now uses \`helpers.httpRequestWithAuthentication\` instead of deprecated \`helpers.requestWithAuthentication\`, so now it should respect the \`returnFullResponse\` option.
> 
> \## Related Linear tickets, Github issues, and Community forum posts
> 
> \- https://github.com/n8n-io/n8n/pull/11219
> \- https://linear.app/n8n/issue/AI-407/http-tool-returning-response-undefined
> \- https://community.n8n.io/t/http-tool-request-error/58998
> 
> \## Review / Merge checklist
> 
> \- \[\] PR title and summary are descriptive. (\[conventions\](../blob/master/.github/pull\_request\_title\_conventions.md)) 
> \- \[\] \[Docs updated\](https://github.com/n8n-io/n8n-docs) or follow-up ticket created.
> \- \[\] Tests included. 
> \- \[\] PR Labeled with \`release/backport\` (if the PR is an urgent fix that needs to be backported)

Please let us know if you still encounter errors after updating.

Thanks! 🙌

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [November 4, 2024, 8:41am UTC](https://community.n8n.io/t/oauth2-token-refresh-doesnt-work-in-http-tools-ai-agents/59494/3 "2024-11-04T08:41:28Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
