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

Added an hook for base_request_uri #246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TeamIguana
Copy link

This change was necessary because, in our case, we have a website that needs to respond to different urls, and currently, the plugin breaks because it assumes a fixed base url.
This causes issues during the OAuth signature verification, where the generated signature doesn't match, resulting in the "OAuth signature does not match" error.

To address this, we've introduced a new hook that allows us to intercept and modify the base url before the signature is generated. This change provides flexibility for anyone facing similar issues, giving them the opportunity to adjust the base url dynamically to match their specific setup.

For example, with this hook, one could implement the following function:

function customized_oauth1_base_request_uri($url)
{
return str_replace(<fixed_base_url>, <new_base_url>, $url);
}

add_filter('oauth1_base_request_uri', 'customized_oauth1_base_request_uri');

This approach allows us to ensure that the base URL matches what is expected, preventing the signature mismatch and ensuring the OAuth process works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant