Will be useful we can provide the destination as a parameter in the authentication request. For example:

Request URL: https://my-domain.example/openid-connect/MY-PROVIER/login?destination=/a-nice-path-to-my-destination

If no destination is provided then go with the actual check with the $_SESSION and fallback to 'user'

Do you think this can be interesting?

This is also related to other discussions in issue queue about altering with a hook or others the destination. Both can co-exist but this fix is smaller and maybe we can move forward with it.

Comments

quiron created an issue. See original summary.

quiron’s picture

I provide a basic patch working in my case.

quiron’s picture

Assigned: quiron » Unassigned
Status: Active » Needs review
Related issues: +#2953289: Add option to alter the destination during authenticate in the redirect controller.
ccjjmartin’s picture

Status: Needs review » Closed (duplicate)

I am going to close this one. While digging into this problem I found that the authorize method didn't have the right page context (i.e. the proper destination parameter had already been stripped out). The openid_connect_save_destination() function was what I was looking for and so I recommend we continue further work in this issue: https://www.drupal.org/project/openid_connect/issues/3022086#comment-134...