Problem/Motivation

When you're in a multlingual drupal website, with language negotiation set up using path prefixes, the generated consumer endpoint will include the language prefix of the language currently in use.

For example, if you're on the English version of a Drupal website, that'll result in the consumer endpoint being generated as /en/saml/consume instead of /saml/consume .

Steps to reproduce

* Install multiple languages, for example English and French
* Set them up to use distinct prefixes per language, /en for English and /fr for French
* Enable SAML SP
* Check the generated consumer endpoint

Proposed resolution

Force the URL to be generated without path prefix.

Issue fork saml_sp-3239120

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

DeFr created an issue. See original summary.

DeFr’s picture

Assigned: DeFr » Unassigned
Status: Active » Needs review
StatusFileSize
new977 bytes
DeFr’s picture

StatusFileSize
new1.05 KB

Uploaded the patch above in a hurry, rerolling it from a patch I made for a project and it's not plain wrong, not patching the correct Url call, sorry for that.

Corrected patch attached.

jcisio’s picture

Status: Needs review » Reviewed & tested by the community

I'm not sure whether it is a bugfix or a behavior change. In any case, remove the prefix won't break anything (prefixed url still works).

denix’s picture

We are using the patch since a couple of months now and it is stable and working. Thanks

jproctor made their first commit to this issue’s fork.

jproctor’s picture

Status: Reviewed & tested by the community » Fixed

  • jproctor committed 0f16c10 on 4.x
    Issue #3239120: Consumer endpoint incorrectly includes the language...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

PaEricksonWaTech’s picture

My SAML login trust stopped working after installing Version: 4.1.0. (on a multi-lingual site)

It seems the generated metadata still contains the language code in the Assertion Urls. And the "Assertion Urls" form field on the saml_sp settings page uses the language code as a default. I don't know a lot about how this all works, but shouldn't the generated metadata be consistent with the Consumer Endpoint? If we remove the language code from the endpoint, it should also be removed from the metadata.

matthijs’s picture

I created a follow-up issue for the inconsistency reported above: #3316762: Metadata incorrectly includes the language prefix