|
40 | 40 | # Generic type for store options |
41 | 41 | TStoreOptions = TypeVar('TStoreOptions') |
42 | 42 | INTERNAL_AUTHORIZE_PARAMS = ["client_id", "redirect_uri", "response_type", |
43 | | - "code_challenge", "code_challenge_method", "state", "nonce"] |
| 43 | + "code_challenge", "code_challenge_method", "state", "nonce", "scope"] |
44 | 44 |
|
45 | 45 |
|
46 | 46 | class ServerClient(Generic[TStoreOptions]): |
@@ -154,11 +154,17 @@ async def start_interactive_login( |
154 | 154 | state = PKCE.generate_random_string(32) |
155 | 155 | auth_params["state"] = state |
156 | 156 |
|
| 157 | + #merge any requested scope with defaults |
| 158 | + requested_scope = options.authorization_params.get("scope", None) if options.authorization_params else None |
| 159 | + audience = auth_params.get("audience", None) |
| 160 | + merged_scope = self._merge_scope_with_defaults(requested_scope, audience) |
| 161 | + auth_params["scope"] = merged_scope |
| 162 | + |
157 | 163 | # Build the transaction data to store |
158 | 164 | transaction_data = TransactionData( |
159 | 165 | code_verifier=code_verifier, |
160 | 166 | app_state=options.app_state, |
161 | | - audience=auth_params.get("audience", None), |
| 167 | + audience=audience, |
162 | 168 | ) |
163 | 169 |
|
164 | 170 | # Store the transaction data |
|
0 commit comments