Skip to content

Use config from Provider instead of config(‘services.apple’)#1422

Open
bonroyage wants to merge 3 commits intoSocialiteProviders:masterfrom
bonroyage:apple-config
Open

Use config from Provider instead of config(‘services.apple’)#1422
bonroyage wants to merge 3 commits intoSocialiteProviders:masterfrom
bonroyage:apple-config

Conversation

@bonroyage
Copy link
Contributor

Rather than retrieving the team_id, client_id and key_id from the config file, this uses the config that is known by the Provider at the time the AppleToken is created.

In our scenario, we dynamically build the config (as explained here: https://socialiteproviders.com/usage/#overriding-a-config) and thus don't have services.apple configured.

I realise it is a breaking change to introduce new required parameters. If preferred, I can make the parameters optional and read from the config like before if they're omitted.

@atymic
Copy link
Member

atymic commented Feb 3, 2026

Yes, please make sure it's BC compat change :)

@bonroyage
Copy link
Contributor Author

Yes, please make sure it's BC compat change :)

Done!

@atymic
Copy link
Member

atymic commented Feb 4, 2026

Have you tested this in your APP?
I don't think this will work as the service container isn't going to resolve those params - as per the example you linked they need to be in the $additionalProviderConfig array

@bonroyage
Copy link
Contributor Author

bonroyage commented Feb 4, 2026

You're right, I tested this in an app that generates custom configs. When you build your own Config instance, it doesn't limit you to the keys that are present in additionalConfigKeys and lets you put whatever you want in additionalProviderConfig, so I didn't notice the potential issue for those who didn't use custom configs.

Before fix

This is before I made the additions to additionalConfigKeys.

Reading from config/services.php:

image

Reading from custom config, this is what I tested in my app:

image

After fix

Added key_id and team_id to additionalConfigKeys

Reading from config/services.php:

image

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

Successfully merging this pull request may close these issues.

2 participants