Skip to content

Commit

Permalink
Made scope parameter compulsary for id_token only
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Oct 6, 2023
1 parent f9d1805 commit 481dfe1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -605,17 +605,6 @@ class QRCodeScanCubit extends Cubit<QRCodeScanState> {
}
}

final scope = state.uri!.queryParameters['scope'];
if (scope == null || scope != 'openid') {
throw ResponseMessage(
data: {
'error': 'invalid_request',
'error_description':
'The openid scope is required in the scope list.',
},
);
}

final redirectUri = state.uri!.queryParameters['redirect_uri'];
final clientId = state.uri!.queryParameters['client_id'];
final isUrl = isURL(clientId.toString());
Expand All @@ -624,6 +613,17 @@ class QRCodeScanCubit extends Cubit<QRCodeScanState> {
if (responseType == 'id_token') {
/// verifier side (siopv2)
final scope = state.uri!.queryParameters['scope'];
if (scope == null || scope != 'openid') {
throw ResponseMessage(
data: {
'error': 'invalid_request',
'error_description':
'The openid scope is required in the scope list.',
},
);
}

if (redirectUri == null) {
throw ResponseMessage(
data: {
Expand Down

0 comments on commit 481dfe1

Please sign in to comment.