-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
[4.x] OAuth improvements including support for SAML2 providers #9612
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SAML2 sends POST requests, whereas most oAuth providers send GET requests. We need to support both.
jasonvarga
requested changes
Feb 28, 2024
jasonvarga
requested changes
Feb 29, 2024
- provider class accepts config array in constructor - provider class uses constructor property promotion - provider class deprecated using label method as a setter. now just pass it through the config. - pass config array into provider via the manager
…AuthId will have the config which could potentially be important.
I made some more tweaks:
|
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request fixes two issues preventing our Socialite/oAuth integration from working with SAML2 Socialite Providers, like Auth0/Okta.
Essentially, there were only two changes required to make our code work with SAML2:
/oauth/{provider}/callback
route needs to acceptPOST
requests, not justGET
requests.->stateless()
, otherwise we'd get an error.->stateless()
option only works for some providers and not all of them. There's also no way for us to know programatically if a specific provider supports it or not - you need to simply test it and see.stateless
as a config option in theproviders
array inconfig/statamic/oauth.php
... more details on that belowProvider "Configs"
You can configure which providers Statamic should use for oAuth in the
providers
array inconfig/statamic/oauth.php
. You can optionally configure labels for providers too.Like I mentioned, only some providers support the
->stateless()
method, so I've made it so you can pass an array of config options:Most of the code changes in this PR are around making the config stuff work. Happy to re-work if you think there's a better way to do this.
Fixes #9535.