How to get access_token or another parameters from connected Oauth2 credential

Hello to all!

I have connected credential in /credentials page
OAuth2 API

There is any way to get Oauth access_token to use it hot only https node, but also in code node (or set noode) to put in hardcoded javascript for run?

Information on your n8n setup

  • **n8n version:0.215.1
  • **Database you’re using (default: SQLite):default
  • **Running n8n with the execution process [own(default), main]:main
  • **Running n8n via [Docker, npm, n8n.cloud, desktop app]:Docker

Ideally you wouldn’t be able to do this, the domain would be locked down, but if you create a webhook trigger and then point a HTTP node at it using Predefined Credentials (your OAuth creds) you’ll be able to grab it from the headers.

1 Like

Hello permontto, but i have only generic credential type. i see only one workaround is create custom api call to create new connection and get access token only via classic https node API Calls, then refresh access token manually. My service allow to create another unique credential.

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