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

How to add home url to excluded_urls? #29

Open
PeideAmonNg opened this issue Jan 15, 2020 · 1 comment
Open

How to add home url to excluded_urls? #29

PeideAmonNg opened this issue Jan 15, 2020 · 1 comment

Comments

@PeideAmonNg
Copy link

PeideAmonNg commented Jan 15, 2020

How do we add the home url ("/") i.e. Director::absoluteBaseURL() to excluded_urls in the saml.yml config file?

@NightJar
Copy link
Contributor

NightJar commented Apr 2, 2024

/**
* @var array A list of URLs to be excluded from processing via this middleware. These URLs are passed through
* preg_match(), so regular expressions are acceptable. The default URLs include:
* - Any URL under Security/
* - Any URL under saml/
*/
private static $excluded_urls = [
'/^Security/i',
'/^saml/i'
];

The match is only made on the path of the URL, so does not include the domain.

For example:

SilverStripe\SAML\Middleware\SAMLMiddleware:
  excluded_urls:
    - '^$'

will add an empty string to the match. If your homepage is e.g. home, then that would look more like ^home/?$.
If you want to match any page under home, then you'd leave the $ off the end.

For more help with regex you can visit sites like https://www.regular-expressions.info/

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

No branches or pull requests

2 participants