Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
V1.2 of the TikTok Business API will be deprecated on Aug 15, 2023. See https://ads.tiktok.com/marketing_api/docs?id=1740579480076290.
It doesn't sound like any of the changes to the access token endpoint would affect this gem, but apparently it now becomes unhappy if you don't send the token request body as JSON.
Version 2.0.7 of the OAuth2 gem supports this if you set the "Content-Type" header to "application/json", see https://gitlab.com/oauth-xx/oauth2/-/issues/431.
Unfortunately you can't just pass headers in the
token_params
method because thebuild_access_token
deep symbolizes all parameters, and the OAuth2 gem expects the headers to be strings. See https://github.com/omniauth/omniauth-oauth2/blob/3a43234ab5dd36a75f9c125c58fcfe1a37b26805/lib/omniauth/strategies/oauth2.rb#L126, and note that thetoken_params
is aHashie::Mash
.This means we have to override the
build_access_token
method to avoid the "Content-Type" string getting turned into a symbol.Fixes #9.