Commits on Source (57)
-
p-betula authored
-
Vinoth Kannan authored
-
David Taylor authored
These were removed from core in https://github.com/discourse/discourse/commit/d2bceff133ac152678a1407d45fea260a0fe8536
-
Vinoth Kannan authored
Now we can sync or create user fields based on the new `saml_user_field_statements` environment variable's mapping.
-
Vinoth Kannan authored
-
Roman Rizzi authored
We started seeing [this error](https://github.com/onelogin/ruby-saml/issues/577) on some of our sites, which has been fixed on 1.12.1.
-
Vinoth Kannan authored
Recent commit 9d836281 is not compatible with old versions of Discourse.
-
Vinoth Kannan authored
Our hosted sites running in stable branch have issues with `rexml` gem and returning "missing gem" error.
-
Andreas Teuber authored
If your IDP transmits `cn=groupname,cn=groups,dc=example,dc=com` you can set this to true to use only `groupname`. This is useful if you want to keep the standard group name length of Discourse (20 characters). Co-authored-by:
Andreas Teuber <andreas.teuber@passiv.de>
-
Bastien Le Querrec authored
Co-authored-by:
Bastien Le Querrec <blq@laquadrature.net>
-
David Taylor authored
The styling no works with Discourse's current login UI, so let's remove it. The OnceOff job was to migrate from an old data format more than 4 years ago. It's exceptionally unlikely that anyone is going to upgrade from such an old version. If they do, they could still extract the data manually and migrate it.
fb96faba -
David Taylor authoredae6a93f5
-
David Taylor authored6321ca5e
-
David Taylor authored8f43b51e
-
David Taylor authored8002759d
-
David Taylor authored
-
David Taylor authored
For `name`, the previous intention was to use the `fullName` attribute, and then fallback to "firstname lastname". However, a bug in the implementation meant that the `fullName` was skipped. This commit updates the logic to lean on omniauth-saml's attribute_statements for the fullName, firstName and lastName attributes, and also updates the priority logic so that fullName is indeed prioritized.
-
David Taylor authored
This will allow much easier testing of the strategy, and is one more step towards making the SAML plugin multisite-compatible
-
David Taylor authored
Putting this logic into the omniauth strategy is much cleaner because: - we no longer need a Rails controller and the associated `custom_url` parameter - we can re-use the `authn_request` instance which is automatically generated by the omniauth strategy, rather than re-implementing that logic - the behavior is decided at runtime, rather than during initialization. This makes it testable, and is another step on the way to making the plugin multisite-compatible This commit also introduces a spec for the feature.
-
David Taylor authored
This means that the name/title can be set per-site and per-locale. This change is backwards-compatible - any existing sites which have configured the GlobalSettings will use those cluster-wide.
-
David Taylor authored
This centralises our logic for accessing settings. This particular commit should be a no-op. I intend to followup with the new site setting definitions in a future commit.
-
David Taylor authored
The prefix is added by the helper. Adding it here causes it to be prefixed twice.
-
David Taylor authored
SAML flows end in a cross-site POST back to Discourse. We have the SameSite=lax attributes on our session cookies so this cross-site POST request has no cookies, and therefore we are unable to check any values in the `session`. This commit makes the browser re-submit the POST request in a SameSite context (i.e. with cookies). Upon receiving a cross-site POST, it renders a simple HTML form with some auto-submit JS. This form submits exactly the same data to the same URL, but this time the request will include the cookies, and authentication can complete properly
-
David Taylor authored
Follow-up to d137e981. If the cross-site POST returns a Set-Cookie header, it will overwrite the existing session, and we'll lose the redirect URL. This commit instructs rack not to persist a session cookie in this response.
-
David Taylor authored
GlobalSettings configured via environment variables will continue to take precendence, so this change is backwards compatible. - `.presence` is added to string values, since 'unset' site settings are never `nil` - saml_force_domains is split on `|` and `,` because site settings expect a `|`, while the old global setting expected a `,` - Specs are migrated to use SiteSettings, because GlobalSettings do not override SiteSettings in test mode
e9f9150b -
David Taylor authoredf42577cb
-
David Taylor authored
Regression introduced in e9f9150b
-
David Taylor authored
Core takes care of suggesting usernames during normal signup. Suggesting them here as well can cause unexpected issues (e.g. when staged users sign up). The SAML plugin currently has a bespoke `auto_create_account` implementation, which **does** need to do its own username suggestion. Therefore this commit moves all the suggestion logic into `auto_create_account`. An integration spec for staged-user signup is also introduced.
-
David Taylor authored
Some variable renames were missed, and some specs are no longer relevant
-
David Taylor authored
-
David Taylor authored
The SAML spec requires compression for the standard Redirect binding. However, it is not used in the POST binding. This regressed during the refactoring of 95ccea3f
-
David Taylor authored
In the vast majority of cases, this wasn't causing a problem because browsers will auto-detect the content-type. However, if any intermediate proxies add the `X-Content-Type-Options: nosniff` header, then the html will be displayed as plain text, and login will be broken.
-
David Taylor authored
The change in 245b70d4 means that the CSP middleware now activates for the `/auth/saml` route. That's good, but it also broke things for subfolder installations because the CSP includes the base_path, while the SAML script path did not. This commit fixes that, and adds an integration spec to ensure the script is included in the script_src directive for regular and subfolder sites.
-
discoursebot authored
Co-authored-by:
CvX <CvX@users.noreply.github.com>
-
David Taylor authored
-
Andrei Prigorshnev authored
Starting from https://github.com/discourse/discourse/commit/c2022521906b3c44a8a21e8eb2527c8650e06a18 we can pass to `UsernameSuggester` an array of inputs parameters and it'll be skipping invalid items and trying next ones.
-
David Taylor authored
There is only one SAMLAuthenticator instance per-process. Storing user-specific state in it is risky (although, in our default unicorn-based config, is unlikely to cause issues because we only handle one concurrent request per process). This commit also updates our implementation to use the built-in `#single` and `#multi` methods provided by the SAML gem. This avoids the need for our custom `&.first`, `&.split` and `&.join` implementation.
-
David Taylor authored
All data will be automatically migrated from `oauth2_user_infos` to the `user_associated_accounts` table
-
David Taylor authored
In production, the SAML omniauth strategy returns some very complex data structures in the `extra` data. These have circular references, and can cause a "stack level too deep" error when serializing to JSON. This commit simplifies thing so we only try to store the attributes hash.
-
David Taylor authored
`name` is nil... so this logic was not working at all
-
discoursebot authored
Co-authored-by:
discoursebuild <build@discourse.org>
-
David Taylor authored
-
Andrei Prigorshnev authored
-
discoursebot authored
Co-authored-by:
discoursebuild <build@discourse.org>
-
Jarek Radosz authored
-
discoursebot authored
* DEV: Update CI workflows * DEV: Update CI setup * prettier Co-authored-by:
discoursebuild <build@discourse.org> Co-authored-by:
Jarek Radosz <jradosz@gmail.com>
-
discoursebot authored
Co-authored-by:
discoursebuild <build@discourse.org>
-
David Taylor authored
* DEV: Bump rubocop-discourse * Fix rubocop violations
-
discoursebot authored
Co-authored-by:
discoursebuild <build@discourse.org>
-
Vinoth Kannan authored
This commit already added in a brach and deployed to a client before. https://github.com/discourse/discourse-saml/commit/ddeb2615529eb0f9cac9621e247feebf31e65fee
-
Vinoth Kannan authored
And add a option to add multiple certificates in site setting with "|" separator.
-
David Taylor authored
-
dependabot[bot] authored
Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.2. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](https://github.com/json5/json5/compare/v2.2.1...v2.2.2 ) --- updated-dependencies: - dependency-name: json5 dependency-type: indirect ... Signed-off-by:
dependabot[bot] <support@github.com> Signed-off-by:
dependabot[bot] <support@github.com> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-
David Taylor authored
-
discoursebot authored
Co-authored-by:
discoursebuild <build@discourse.org>
-
Davide Depau authored05b7cdc8
-
Davide Depau authoredf2dff4f6
Showing
- .discourse-compatibility 4 additions, 0 deletions.discourse-compatibility
- .eslintrc 3 additions, 0 deletions.eslintrc
- .github/workflows/discourse-plugin.yml 11 additions, 0 deletions.github/workflows/discourse-plugin.yml
- .gitignore 3 additions, 3 deletions.gitignore
- .prettierrc 1 addition, 0 deletions.prettierrc
- .rubocop.yml 2 additions, 355 deletions.rubocop.yml
- .streerc 2 additions, 0 deletions.streerc
- .template-lintrc.js 4 additions, 0 deletions.template-lintrc.js
- Gemfile 8 additions, 0 deletionsGemfile
- Gemfile.lock 48 additions, 0 deletionsGemfile.lock
- LICENSE 0 additions, 1 deletionLICENSE
- README.md 24 additions, 6 deletionsREADME.md
- app/jobs/onceoff/migrate_saml_user_infos.rb 0 additions, 21 deletionsapp/jobs/onceoff/migrate_saml_user_infos.rb
- assets/stylesheets/saml.scss 0 additions, 6 deletionsassets/stylesheets/saml.scss
- config/locales/client.en.yml 6 additions, 0 deletionsconfig/locales/client.en.yml
- config/locales/server.en.yml 60 additions, 0 deletionsconfig/locales/server.en.yml
- config/settings.yml 89 additions, 0 deletionsconfig/settings.yml
- db/migrate/20211230141200_migrate_saml_user_info.rb 31 additions, 0 deletionsdb/migrate/20211230141200_migrate_saml_user_info.rb
- lib/discourse_saml/saml_omniauth_strategy.rb 79 additions, 0 deletionslib/discourse_saml/saml_omniauth_strategy.rb
- lib/saml_authenticator.rb 261 additions, 163 deletionslib/saml_authenticator.rb
.discourse-compatibility
0 → 100644
.eslintrc
0 → 100644
.github/workflows/discourse-plugin.yml
0 → 100644
.prettierrc
0 → 100644
.streerc
0 → 100644
.template-lintrc.js
0 → 100644
Gemfile
0 → 100644
# frozen_string_literal: true | ||
source "https://rubygems.org" | ||
group :development do | ||
gem "rubocop-discourse" | ||
gem "syntax_tree" | ||
end |
Gemfile.lock
0 → 100644
assets/stylesheets/saml.scss
deleted
100644 → 0
config/settings.yml
0 → 100644
lib/discourse_saml/saml_omniauth_strategy.rb
0 → 100644
This diff is collapsed.