openid-connect-generic icon indicating copy to clipboard operation
openid-connect-generic copied to clipboard

Provide new filter for alternate_redirect_uri

Open daggerhart opened this issue 4 years ago • 2 comments

This is currently untested. Just a starting point.

All Submissions:

Changes proposed in this Pull Request:

Provide a new filter for the alternate_redirect_uri for cases where the hardcoded value may not work. See #285

How to test the changes in this Pull Request:

  1. On the plugin settings page, enable the "Alternate Redirect URI" option.
  2. Write a custom hook in another plugin that changes the alternate redirect uri.
  3. Flush permalinks by visiting the site's permalink page.
  4. Test by performing normal OIDC login.

Generic example:

add_filter( 'openid-connect-generic-alter-alternate-redirect-uri', function( $redirect_uri ) {
  // No preceeding or trailing slash.
  return 'whatever-i-want-the-redirect-uri-to-be';
} );

Example specific to #285 :

add_filter( 'openid-connect-generic-alter-alternate-redirect-uri', function( $redirect_uri ) {
  // No preceeding or trailing slash.
  return 'ithemesfd/openid-connect-authorize';
} );

Changelog entry

Provide new filter for alternate_redirect_uri. Filter: openid-connect-generic-alter-alternate-redirect-uri.

daggerhart avatar Apr 02 '21 12:04 daggerhart

@daggerhart should we update the description of the "Alternate Redirect URI" settings section to mention the availability of the new filter? Also we need to make sure to update the Hooks & Filters Wiki documentation.

timnolte avatar Apr 11 '21 02:04 timnolte

This would be really useful, can it be merged?

Leobaillard avatar Mar 23 '22 22:03 Leobaillard