Skip to content

Instantly share code, notes, and snippets.

@aeimer
Last active November 2, 2021 09:14
Show Gist options
  • Save aeimer/236b2dbd4c90655f8820418882f45988 to your computer and use it in GitHub Desktop.
Save aeimer/236b2dbd4c90655f8820418882f45988 to your computer and use it in GitHub Desktop.
KnpU oauth bundle in usage with special tenant for symfony
# Apply the configuration for 'azure', just with the generic type...
knpu_oauth2_client:
clients:
azure_ad:
# https://github.com/knpuniversity/oauth2-client-bundle#configuring-a-generic-provider
# We need to use the generic type instead of 'azure', so we can pass some extra options
type: generic
provider_class: TheNetworg\OAuth2\Client\Provider\Azure
client_class: KnpU\OAuth2ClientBundle\Client\Provider\AzureClient
# -- normal options --
client_id: '%env(OAUTH_AZURE_CLIENT_ID)%'
client_secret: '%env(OAUTH_AZURE_CLIENT_SECRET)%'
# path to the logincheck
redirect_route: login_check
redirect_params: {}
use_state: false
# -- special options --
# These options need to have exactly the same name as specified in \TheNetworg\OAuth2\Client\Provider\Azure
# so they can be resolved and set through the KNPU-Bundle
provider_options:
# Tenant may be something like: companyxyz.onmicrosoft.com
tenant: '%env(OAUTH_AZURE_TENANT)%'
API_VERSION: '%env(OAUTH_AZURE_API_VERSION)%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment