diff --git a/authlib/integrations/base_client/sync_app.py b/authlib/integrations/base_client/sync_app.py index 50fa27a7..c676370f 100644 --- a/authlib/integrations/base_client/sync_app.py +++ b/authlib/integrations/base_client/sync_app.py @@ -254,7 +254,12 @@ def _create_oauth2_authorization_url(client, authorization_endpoint, **kwargs): log.debug(f'Using code_verifier: {code_verifier!r}') scope = kwargs.get('scope', client.scope) - if scope and 'openid' in scope.split(): + scope = ( + (scope if isinstance(scope, (list, tuple)) else scope.split()) + if scope + else None + ) + if scope and "openid" in scope: # this is an OpenID Connect service nonce = kwargs.get('nonce') if not nonce: