Commit Graph

31 Commits

Author SHA1 Message Date
David Taylor ac6d5d1a36
FIX: Only send `claims` parameter if it has been set (#23)
Follow-up to 25454d6707
2021-10-14 16:58:42 +01:00
Lucas Leadbetter 25454d6707
FEATURE: token endpoint `client_secret_post` authentication, and explicit `claims` (#19)
The `client_secret_post` authentication method will be used when the discovery document defines `token_endpoint_auth_methods_supported`, includes `client_secret_post`, and does not include the default `client_secret_basic`.

A new (optional) site setting is introduced which allows `claims` to be explicitly requested.

Co-authored-by: David Taylor <david@taylorhq.com>
2021-10-04 17:25:42 +01:00
David Taylor 4aa0e1b4ab
FIX: Ensure nonce mismatch causes auth to fail correctly (#15) 2021-08-09 13:25:10 +01:00
David Taylor a9dd528aea FIX: RP-initiated logout should pass id_token, not access_token 2020-11-12 17:16:11 +00:00
David Taylor 85abe67701
FIX: Gracefully handle errors while fetching the discovery document (#4)
Previously an error loading the discovery document would raise an exception. Now, it will display an error to the user, and log the error for site admins to view at `/logs`. Specs are updated and improved accordingly.

This moves the discovery document fetching out of OmniAuth and into Discourse. This makes it available for the upcoming rp-initiated-logout support.
2020-11-11 18:46:11 +00:00
David Taylor 109f910fd5
DEV: Fix plugin when installed alongside discourse-jwt (#3)
Replace `JWT` with `::JWT` so that it doesn't get resolved to `Omniauth::Strategies::JWT`
2020-11-11 15:27:23 +00:00
buildthomas 0112e5a046
Fix avatar picture in auth hash info (#1)
Managed Authenticator expects `image` field, not `picture`:
09a97363da/lib/auth/managed_authenticator.rb (L87)
2020-09-28 12:27:17 +01:00
David Taylor 18c20c29a0
FIX: Do not verify the `iat` claim in JWT tokens
The JWT specification (https://tools.ietf.org/html/rfc7519#page-10) does not require verification of this claim. If the issuer wishes to restrict the validity of the token, they can use the 'nbf' (not before) claim which is intended for this purpose. Discourse will verify the `nbf` claim if it is present.

In practice, clock skew between identity providers and Discourse was causing JWT validity errors to be raised.
2020-09-25 10:35:40 +01:00
David Taylor 109ec1a275
FEATURE: Add detailed OIDC request and response logs
This makes use of Faraday middleware to log precise details about all requests made by the OAuth2 gem. This should make it easier to debug configuration issues
2020-09-25 09:47:24 +01:00
David Taylor 9ada9528e8
FIX: Accept strings for the email_verified token
This is technically a spec violation, but many providers do this so we should check for the string 'true'
2020-07-10 16:49:32 +01:00
David Taylor 2ef80870d3
FIX: Do not include token scope parameter when setting is empty 2020-04-01 17:50:23 +01:00
David Taylor 84c21a572c FEATURE: Optionally allow overriding email on every login 2020-03-06 11:51:41 +00:00
David Taylor 9ad63a3fc7 FEATURE: Allow parameters to be passed from /auth/oidc to the IDP
The most common use case is when you want the IDP to start with a specific screen (e.g. signup, rather than sign in). This change has no effect by default, you must add the parameter names to the openid_connect_authorize_parameters site setting.
2020-01-08 14:15:32 +00:00
David Taylor 67a5595e98 FEATURE: Respect the email_verified boolean when supplied by IDP 2020-01-08 13:54:37 +00:00
David Taylor 3e83fa9c50 DEV: Refactor authenticator into its own file 2020-01-08 13:52:24 +00:00
Guo Xiang Tan 1f08770d1a Add frozen string literal comment to files. 2019-05-13 10:51:32 +08:00
David Taylor 94bba5f710 FEATURE: Option to enable verbose logging of authentication process 2019-01-04 15:08:35 +00:00
David Taylor d394c12078 FEATURE: Support latest version of `ruby-jwt` to support core changes
This change is not backwards compatible. If you install the plugin on
an earlier version of Discourse, the plugin will not initialize.
2019-01-02 10:42:28 +00:00
David Taylor 84085413d5 REFACTOR: user_associated_account and managed_authenticator moved to core 2018-11-30 11:20:28 +00:00
David Taylor 250bf84faa DEV: Improve specs for managed authenticator 2018-11-27 17:05:00 +00:00
David Taylor f44a2cd7bb DEV: Refactor managed_authenticator into its own file 2018-11-26 14:54:20 +00:00
David Taylor 8558d65e67 DEV: Additional tests, and improved JWT error handling 2018-11-22 12:44:38 +00:00
David Taylor ba3685f2ef DEV: Test token_params 2018-11-22 11:24:31 +00:00
David Taylor a74bd6c27a FIX: Discovery error handling in request phase 2018-11-21 16:56:46 +00:00
David Taylor 78a792b5b6 FIX: Improved 'discovery' error handling, with tests 2018-11-21 15:28:01 +00:00
David Taylor 91774686e7 FEATURE: Maintain `p` parameter between authorization and token request 2018-11-19 12:51:47 +00:00
David Taylor 923df4d39d FIX: Use correct parameter for error description 2018-11-16 18:19:01 +00:00
David Taylor e9c86e6822 FEATURE: Optionally redirect on defined errors, and add site setting descriptions 2018-11-16 17:55:10 +00:00
David Taylor 37753dd377 FEATURE: Pass on policy parameter
Used for Azure B2C tenants
2018-11-15 17:31:43 +00:00
David Taylor c4335cc513 FIX: Do not cause server error if OAuth2 callback phase fails 2018-11-15 17:31:03 +00:00
David Taylor 4425b8ae67 FEATURE: OpenID Connect support 2018-11-09 12:49:51 +00:00