Skip to content
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

Allow OAuth providers to pass additional options to provider constructor #3062

Merged
merged 3 commits into from
Sep 1, 2022

Conversation

tadhgboyle
Copy link
Member

A simple change which helps us support things like Keycloak.
As you can see from its readme, it wants some additional config options passed to the constructor (authServerUrl, realm, etc):
https://github.com/stevenmaguire/oauth2-keycloak#authorization-code-flow

This has been tested on a demo keycloak instance thanks to @RediPanda

        NamelessOAuth::getInstance()->registerProvider('keycloak', 'Keycloak Module', [
            'class' => \Stevenmaguire\OAuth2\Client\Provider\Keycloak::class,
            'user_id_name' => 'sub',
            'scope_id_name' => 'profile',
            'icon' => 'fas fa-key',
        ], [
            'authServerUrl'  => 'https://sso.nekonii.xyz',
            'realm' => 'devrealm',
        ]);

@tadhgboyle tadhgboyle force-pushed the feat/oauth-custom-options branch from 0e60345 to 49098bb Compare August 31, 2022 00:29
@tadhgboyle tadhgboyle requested a review from a team August 31, 2022 00:30
@tadhgboyle tadhgboyle merged commit 71ca33e into develop Sep 1, 2022
@tadhgboyle tadhgboyle deleted the feat/oauth-custom-options branch September 1, 2022 18:08
@Derkades Derkades added this to the 2.1.0 milestone Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants