Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): enable sending client credentials in body #4377

Merged
merged 3 commits into from
Oct 20, 2022

Conversation

RicardoE105
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Oct 18, 2022

N8N-5079

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team node/improvement New feature or request labels Oct 18, 2022
@RicardoE105 RicardoE105 changed the title n8n 5079 allow including credentials in the body feat(core): enable sending client credentials in body Oct 19, 2022
@RicardoE105 RicardoE105 merged commit 7fcd821 into master Oct 20, 2022
@RicardoE105 RicardoE105 deleted the n8n-5079-allow-including-credentials-in-the-body branch October 20, 2022 15:15
@n8n-assistant n8n-assistant bot added the Upcoming Release Will be part of the upcoming release label Oct 20, 2022
@janober
Copy link
Member

janober commented Oct 21, 2022

Got released with n8n@0.199.0

@janober janober removed the Upcoming Release Will be part of the upcoming release label Oct 21, 2022
valya pushed a commit to valya/n8n that referenced this pull request Nov 8, 2022
* ⚡ Enable inject credentials in the body for OAuth2 CC

* 🐛 Persist token data

* 👕 Fix linting error
@minhlucvan
Copy link

minhlucvan commented Oct 4, 2024

Hi @RicardoE105, I am trying to add a new field into the get token request's body something like

const options = {};
if (credentials.authentication === 'body') {
Object.assign(options, {
	headers: {
		Authorization: '',
	},
	body: {
		client_id: credentials.clientId as string,
		client_secret: credentials.clientSecret as string,
	},
});
}

if(credentials.authExtraBody) {
    // { appId: 'string' }
    Object.assign(options, credentials.authExtraBody)
}


return oAuth2Client.credentials.getToken(options);
	

The auth provider required to add the app id as exra field of the get token request.

Do you have any idea the best approach for that?

thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team node/improvement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants