Add OpenID Connect Support for Slack Apps#1381
Merged
atymic merged 1 commit intoSocialiteProviders:masterfrom Aug 26, 2025
Merged
Add OpenID Connect Support for Slack Apps#1381atymic merged 1 commit intoSocialiteProviders:masterfrom
atymic merged 1 commit intoSocialiteProviders:masterfrom
Conversation
27debc4 to
2e21f8e
Compare
atymic
approved these changes
Aug 22, 2025
Member
|
Excellent work :) |
Contributor
Author
|
@atymic You are right. In my opinion this does not need a major release, because it uses the current Slack auth + API endpoints when using identity scopes and non of the OpenID scopes. When using the new OpenID scopes, it uses the new API endpoint. Only the |
This file contains hidden or 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
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.
Overview
This PR adds automatic OpenID Connect support to the Slack provider to ensure compatibility with Slack's new marketplace requirements while maintaining full backward compatibility with existing implementations.
Problem
Slack has updated their marketplace approval process and new Slack apps will not be approved if they use the legacy
identity.*scopes (identity.basic,identity.email,identity.team,identity.avatar). Instead, Slack now requires apps to use OpenID Connect with the scopesopenid,email,profileand corresponding OpenID Connect endpoints.Solution
This implementation automatically detects when OpenID Connect scopes are being used and switches to the appropriate endpoints:
Endpoint Mapping
When using OpenID Connect scopes (
openid,email,profile) without bot scopes:https://slack.com/openid/connect/authorize(instead ofhttps://slack.com/oauth/v2/authorize)https://slack.com/api/openid.connect.token(instead ofhttps://slack.com/api/oauth.v2.access)https://slack.com/api/openid.connect.userInfo(instead ofhttps://slack.com/api/users.identity)Detection Logic
OpenID Connect mode is automatically enabled when:
openid,email,profile)Changes Made
Before (Legacy Implementation)
After (Dynamic Implementation)
Key Implementation Details
Dynamic Endpoint Selection:
getAuthUrl()andgetTokenUrl()now route based onshouldUseOpenIdConnect()getUserByToken()routes based onusesOpenIdScopes()Smart Token Extraction:
access_tokendirectlyauthed_user.access_tokenDual User Mapping:
sub,name,email,picture,https://slack.com/team_iduser.id,user.name,user.email,user.image_512,team.idEnhanced Field Handling:
scopefield with space separatoruser_scopeandscopefieldsNew Methods Added
shouldUseOpenIdConnect(): Returns true when using OpenID scopes AND no bot scopesusesOpenIdScopes(): Detects OpenID scopes without legacy identity scopesUsage Examples
✅ Oauth Approach (Unchanged)
✅ New OpenID Connect Approach
✅ Bot and User Scopes (Uses Oauth + Openid)
This implementation ensures seamless compatibility with Slack's marketplace requirements while preserving all existing functionality.