Azure-Samples / active-directory-verifiable-credentials

A code sample demonstrating how to use Azure Active Directory's preview functionality to issue and consume verifiable credentials.
107 stars 64 forks source link

Setup Verifiable Credentials #49

Closed brillioatg closed 2 years ago

brillioatg commented 2 years ago

Hello,

I have tried setting up the verifiable credentials service by following the steps from the document (Tutorial - Configure your tenant for Azure AD Verifiable Credentials (preview) | Microsoft Docs). I was able to setup the python repo (Azure-Samples/active-directory-verifiable-credentials-python: A code sample demonstrating how to use Azure Active Directory's preview functionality to issue and consume verifiable credentials. (github.com)) successfully in the azure ubuntu vm, but when I tried scanning the QR code using MS Authenticator, I am getting Forbidden error. Here are the logs. Kindly help me in resolving the issue as early as possible.

App details: App version: 6.2202.0982 App version code: 202209820 ADAL version: 4.0.1 MSAL version: 3.0.1 Broker version: 4.0.3

        Device details:
        Android version: 12
        Android build: samsung/r8qxxx/r8q:12/SP1A.210812.016/G781BXXS4DVA2:user/release-keys
        Device name: r8q
        Device ID: SP1A.210812.016
        Device manufacturer: samsung
        Device model: SM-G781B
        Device display: SP1A.210812.016.G781BXXS4DVA2
        Device brand: samsung
        Device hardware: qcom
        Locale: en_GB 

ACCOUNTS None 2022-02-23 04:03:03,806 WARN/ADAL: [Telemetry] [2022-02-23 04:03:03 - thread_name : main, correlation_id : UNSET] Android 31 Telemetry is disabled because the Telemetry context or configuration is null Logger$2.log()@211 [pool-18-thread-1] 2022-02-23 04:03:03,881 INFO/App: FCM REGISTRATION IDS: legacyMsaAndAadToken: , msaFcmToken: , currentAadFcmToken: , previousAadFcmToken: CollectLogsUtils.printDeviceTokens()@370 [main] 2022-02-23 04:03:03,881 INFO/App: isDosPreventerAvailable: false CollectLogsUtils.printDeviceTokens()@378 [main] 2022-02-23 04:03:03,882 INFO/App: Scheduling FCM token refresh work. FcmRegistrationManager.schedulePeriodicFcmTokenRefreshIfNecessary()@111 [main] 2022-02-23 04:03:03,883 INFO/App: No need to schedule a daily FCM token refresh worker. FcmRegistrationManager.scheduleFcmTokenDailyRetryRefreshIfNecessary()https://github.com/96 [main] 2022-02-23 04:03:04,143 INFO/App: App restriction sharedDeviceMode: false LaunchActivity.queryIsSharedDeviceModeAppRestrictionSet()@74 [main] 2022-02-23 04:03:04,144 INFO/App: App restriction SharedDeviceTenantId: LaunchActivity.queryIsSharedDeviceModeAppRestrictionSet()@75 [main] 2022-02-23 04:03:04,180 INFO/App: FCM token refresh worker started. FcmTokenRefreshWorker.doWork()https://github.com/70 [DefaultDispatcher-worker-3] 2022-02-23 04:03:04,181 INFO/App: FCM REGISTRATION IDS: legacyMsaAndAadToken: , msaFcmToken: , currentAadFcmToken: , previousAadFcmToken: CollectLogsUtils.printDeviceTokens()@370 [DefaultDispatcher-worker-3] 2022-02-23 04:03:04,181 INFO/App: isDosPreventerAvailable: false CollectLogsUtils.printDeviceTokens()@378 [DefaultDispatcher-worker-3] 2022-02-23 04:03:04,181 INFO/App: Returning FCM token for AAD = FcmRegistrationManager.getCachedAadFcmToken()@66 [DefaultDispatcher-worker-3] 2022-02-23 04:03:04,182 INFO/App: Setup MFA FCM for PROD environment. FirebaseNotificationsWrapper.getFirebaseAppForAad()https://github.com/60 [DefaultDispatcher-worker-3] 2022-02-23 04:03:04,189 INFO/App: Try to acquire AAD FCM registration token. FcmRegistrationManager$acquireFcmTokenForAad$2.invokeSuspend()@194 [DefaultDispatcher-worker-3] 2022-02-23 04:03:04,282 INFO/App: Returning FCM token for AAD = FcmRegistrationManager.getCachedAadFcmToken()@66 [main] 2022-02-23 04:03:04,283 INFO/App: hasDosPreventer = false AccountStorageCustomQueries.hasMfaAccountsConfiguredForNotifications()@99 [main] 2022-02-23 04:03:04,285 INFO/App: Processed BrooklynFRE args showCelebratoryDialog : false, showPhoneSigninMsg :false AccountListFragment.processFREArguments()@448 [main] 2022-02-23 04:03:04,287 INFO/App: Merging broker accounts into accounts list BrokerAccountUseCase$mergeBrokerAccounts$2.invokeSuspend()@84 [DefaultDispatcher-worker-4] 2022-02-23 04:03:04,336 INFO/Broker: [KeyMigrationBroadcaster:migrateKeyIfNeeded] [2022-02-23 04:03:04 - thread_name : main, correlation_id : UNSET] Android 31 KEY_MIGRATION_BROADCASTER| Called by: AUTHENTICATOR_APP_LAUNCH | This is not an active broker. ThreadPoolExecutor$Worker.run()@641 [pool-18-thread-1] 2022-02-23 04:03:04,354 INFO/App: onResume MainActivity.onResume()https://github.com/262 [main] 2022-02-23 04:03:04,381 INFO/Broker: [com.microsoft.identity.client.api.BrokerApiController] [2022-02-23 04:03:04 - thread_name : DefaultDispatcher-worker-4, correlation_id : UNSET] Android 31 Broker Strategies added : ContentProviderStrategy, AccountManagerUpdateCredentialStrategy, ThreadPoolExecutor$Worker.run()@641 [pool-18-thread-1] 2022-02-23 04:03:04,381 INFO/Broker: [BrokerOperationExecutor:getBrokerAccounts] [2022-02-23 04:03:04 - thread_name : DefaultDispatcher-worker-4, correlation_id : UNSET] Android 31 Executing with IIpcStrategy: ContentProviderStrategy ThreadPoolExecutor$Worker.run()@641 [pool-18-thread-1] 2022-02-23 04:03:04,384 INFO/Broker: [com.microsoft.identity.common.internal.broker.ipc.ContentProviderStrategyBROKER_API_HELLO] [2022-02-23 04:03:04 - thread_name : DefaultDispatcher-worker-4, correlation_id : UNSET] Android 31 Request to BrokerContentProvider for uri path /brokerApi/hello ThreadPoolExecutor$Worker.run()@641 [pool-18-thread-1] 2022-02-23 04:03:04,624 INFO/Broker: [com.microsoft.identity.common.internal.broker.ipc.ContentProviderStrategyBROKER_API_HELLO] [2022-02-23 04:03:04 - thread_name : DefaultDispatcher-worker-4, correlation_id : UNSET] Android 31 Received successful result from Broker Content Provider. ThreadPoolExecutor$Worker.run()@641 [pool-18-thread-1] 2022-02-23 04:03:04,625 INFO/Broker: [com.microsoft.identity.common.internal.result.MsalBrokerResultAdapter:verifyHelloFromResultBundle] [2022-02-23 04:03:04 - thread_name : DefaultDispatcher-worker-4, correlation_id : UNSET] Android 31 Able to establish the connect, the broker protocol version in common is [2.0] ThreadPoolExecutor$Worker.run()@641 [pool-18-thread-1] 2022-02-23 04:03:04,626 INFO/Broker: [com.microsoft.identity.common.internal.broker.ipc.ContentProviderStrategyBROKER_API_GET_BROKER_ACCOUNTS] [2022-02-23 04:03:04 - thread_name : DefaultDispatcher-worker-4, correlation_id : UNSET] Android 31 Request to BrokerContentProvider for uri path /brokerApi/getBrokerAccounts ThreadPoolExecutor$Worker.run()@641 [pool-18-thread-1] 2022-02-23 04:03:04,752 INFO/App: Is Fingerprint Available: true AppLockModule.fetchAppLockStatus()@75 [mqt_native_modules] 2022-02-23 04:03:04,753 INFO/App: Is Face Available: true AppLockModule.fetchAppLockStatus()@75 [mqt_native_modules] 2022-02-23 04:03:04,754 INFO/App: Is Iris Available: false AppLockModule.fetchAppLockStatus()@75 [mqt_native_modules] 2022-02-23 04:03:04,765 INFO/App: isAuthenticatorBroker: false BatteryOptimizationModule.configureBatteryOptimizationPreference()@34 [mqt_native_modules] 2022-02-23 04:03:04,765 INFO/App: companyPortalVersionCode: 5312669 BatteryOptimizationModule.configureBatteryOptimizationPreference()https://github.com/35 [mqt_native_modules] 2022-02-23 04:03:04,777 INFO/App: isBrokerIgnoringBatteryOptimizations: false BatteryOptimizationModule.configureBatteryOptimizationPreference()@48 [mqt_native_modules] 2022-02-23 04:03:05,140 INFO/App: Total number of broker accounts: 1 BrokerAccountUseCase$mergeBrokerAccounts$2.invokeSuspend()https://github.com/88 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,140 INFO/Broker: [com.microsoft.identity.common.internal.broker.ipc.ContentProviderStrategyBROKER_API_GET_BROKER_ACCOUNTS] [2022-02-23 04:03:05 - thread_name : DefaultDispatcher-worker-4, correlation_id : UNSET] Android 31 Received successful result from Broker Content Provider. ThreadPoolExecutor$Worker.run()@641 [pool-18-thread-1] 2022-02-23 04:03:05,141 INFO/App: Total number of all accounts: 0 BrokerAccountUseCase.setAccountInfoForMatchingAadAccount()@119 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,141 INFO/App: Did not find a match. BrokerAccountUseCase.setAccountInfoForMatchingAadAccount()@141 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,141 INFO/App: Total number of all accounts: 0 BrokerAccountUseCase.setAccountInfoForMatchingAadAccount()@119 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,141 INFO/App: Did not find a match. BrokerAccountUseCase.setAccountInfoForMatchingAadAccount()@141 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,250 INFO/App: Refreshed AAD v1 token trimmed: 6UJzz46mvs FcmRegistrationManager$acquireFcmTokenForAad$2.invokeSuspend()https://github.com/210 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,251 INFO/App: Enqueuing MFA change device token work. spreadAcrossFiveDays = true FcmRegistrationManager$acquireFcmTokenForAad$2.invokeSuspend()https://github.com/223 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,252 INFO/App: Initial delay in hours = 50, Same in days = 2.0833333333333335") FcmRegistrationManager$acquireFcmTokenForAad$2.invokeSuspend()https://github.com/223 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,253 INFO/App: MFA change token work enqueued FcmRegistrationManager$acquireFcmTokenForAad$2.invokeSuspend()@224 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,253 INFO/App: FCM REGISTRATION IDS: legacyMsaAndAadToken: , msaFcmToken: , currentAadFcmToken: 6UJzz46mvs, previousAadFcmToken: CollectLogsUtils.printDeviceTokens()@370 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,254 INFO/App: isDosPreventerAvailable: false CollectLogsUtils.printDeviceTokens()@378 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,254 INFO/App: Returning FCM token for MSA = FcmRegistrationManager.getCachedMsaFcmToken()https://github.com/57 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,254 INFO/App: Setup MSA FCM for PROD environment FirebaseNotificationsWrapper.getFirebaseAppForMsa()@36 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,258 INFO/App: Try to acquire MSA FCM registration token for MSA. FcmRegistrationManager$acquireFcmTokenForMsa$2.invokeSuspend()@133 [DefaultDispatcher-worker-4] 2022-02-23 04:03:05,324 INFO/App: A new auto generated token received: wurtN6a8r7. It's not going to be used. FcmListenerService.onNewToken()@48 [Firebase-Messaging-Intent-Handle] 2022-02-23 04:03:05,353 INFO/App: FCM update work is currently running, so no need to schedule second attempt. FcmListenerService.onNewToken()https://github.com/56 [Firebase-Messaging-Intent-Handle] 2022-02-23 04:03:05,708 INFO/App: User agreed to privacy terms. MainActivityViewModel.onPrivacyConsentAgreed()@138 [main] 2022-02-23 04:03:05,727 INFO/App: Determining if calling package is a recent valid install referrer: Installed At = 1645587227 Current Time = 1645588985 Referring App = utm_source=google-play&utm_medium=organic InstallReferrerApi.onInstallReferrerSetupFinished()@47 [main] 2022-02-23 04:03:05,728 INFO/App: Install referrer calculation completed, determined from too long ago InstallReferrerApi.onInstallReferrerSetupFinished()@76 [main] 2022-02-23 04:03:06,000 INFO/App: Refreshed MSA v1 token trimmed: dcP1eodjCS FcmRegistrationManager$acquireFcmTokenForMsa$2.invokeSuspend()https://github.com/150 [DefaultDispatcher-worker-5] 2022-02-23 04:03:06,001 INFO/App: FCM REGISTRATION IDS: legacyMsaAndAadToken: , msaFcmToken: dcP1eodjCS, currentAadFcmToken: 6UJzz46mvs, previousAadFcmToken: CollectLogsUtils.printDeviceTokens()@370 [DefaultDispatcher-worker-5] 2022-02-23 04:03:06,001 INFO/App: isDosPreventerAvailable: false CollectLogsUtils.printDeviceTokens()@378 [DefaultDispatcher-worker-5] 2022-02-23 04:03:06,002 INFO/App: FCM token refresh worker finished. FcmTokenRefreshWorker.doWork()@73 [DefaultDispatcher-worker-5] 2022-02-23 04:03:06,423 INFO/App: Navigating to add account by scanning QR code. FirstRunSignInFragment$onViewCreated$$inlined$apply$lambda$3.onClick()@119 [main] 2022-02-23 04:03:06,443 INFO/App: Initiate camera permission request. ScanQrCodeFragment.onViewCreated()@68 [main] 2022-02-23 04:03:08,049 INFO/App: Camera permission was granted. ScanQrCodeFragment$onCreate$1.onActivityResult()@30 [main] 2022-02-23 04:03:08,050 INFO/App: onRequestPermissionsResult: requestCode = 1886613268 MainActivity.onRequestPermissionsResult()@405 [main] 2022-02-23 04:03:08,050 ERROR/App: Unknown request. MainActivity.onRequestPermissionsResult()@434 [main] 2022-02-23 04:03:08,051 INFO/App: onResume MainActivity.onResume()https://github.com/262 [main] 2022-02-23 04:03:09,542 INFO/App: Received a result from QR code scan. DecoratedBarcodeView$WrappedCallback.barcodeResult()@49 [main] 2022-02-23 04:03:09,544 INFO/App: Handling QR code scanning status: Success(qrResult=openid://vc/?request_uri=https://beta.did.msidentity.com/v1.0/2e3e7b44-8e2d-4c0a-9d26-695f083df548/verifiablecredentials/request/75901faf-7bca-4c1e-9713-2484d1dcb9e7) ScanUnknownQrCodeManager.handleQrCodeScanStatus()@52 [main] 2022-02-23 04:03:09,546 INFO/App: Handling successful QR code scan result. ScanUnknownQrCodeManager.handleQrCodeScanStatus()@58 [main] 2022-02-23 04:03:09,546 INFO/App: Handling QR Code result for a DID account QrCodeHandlerVc.handleQrCodeResult()https://github.com/35 [main] 2022-02-23 04:03:30,689 WARN/App: File not found: authenticator.1.txt CollectLogsUtils.readFileFromInternalStorage()@144 [AsyncTask https://github.com/Azure-Samples/active-directory-verifiable-credentials-python/pull/1] 2022-02-23 04:03:30,689 WARN/App: File not found: broker.1.txt CollectLogsUtils.readFileFromInternalStorage()@144 [AsyncTask https://github.com/Azure-Samples/active-directory-verifiable-credentials-python/pull/1] 2022-02-23 04:03:30,690 WARN/App: File not found: DID.1.txt CollectLogsUtils.readFileFromInternalStorage()@144 [AsyncTask https://github.com/Azure-Samples/active-directory-verifiable-credentials-python/pull/1] 2022-02-23 04:03:30,690 WARN/App: File not found: brooklyn.1.txt CollectLogsUtils.readFileFromInternalStorage()@144 [AsyncTask https://github.com/Azure-Samples/active-directory-verifiable-credentials-python/pull/1] 2022-02-23 04:03:30,690 WARN/App: File not found: experimentation.1.txt CollectLogsUtils.readFileFromInternalStorage()@144 [AsyncTask https://github.com/Azure-Samples/active-directory-verifiable-credentials-python/pull/1] 2022-02-23 04:03:30,691 WARN/App: File not found: authenticator.txt1 CollectLogsUtils.readFileFromInternalStorage()@144 [AsyncTask https://github.com/Azure-Samples/active-directory-verifiable-credentials-python/pull/1] 2022-02-23 04:03:30,691 WARN/App: File not found: broker.txt1 CollectLogsUtils.readFileFromInternalStorage()@144 [AsyncTask https://github.com/Azure-Samples/active-directory-verifiable-credentials-python/pull/1] 2022-02-23 04:03:30,691 WARN/App: File not found: brooklyn.txt1 CollectLogsUtils.readFileFromInternalStorage()@144 [AsyncTask https://github.com/Azure-Samples/active-directory-verifiable-credentials-python/pull/1] 2022-02-23 04:03:30,692 WARN/App: File not found: DID.txt1 CollectLogsUtils.readFileFromInternalStorage()@144 [AsyncTask https://github.com/Azure-Samples/active-directory-verifiable-credentials-python/pull/1] 2022-02-23 04:03:30,692 WARN/App: File not found: experimentation.txt1 CollectLogsUtils.readFileFromInternalStorage()@144 [AsyncTask https://github.com/Azure-Samples/active-directory-verifiable-credentials-python/pull/1] 2022-02-23 04:03:03,891 DEBUG/Brooklyn: Brooklyn module disabled [main] 2022-02-23 04:03:03,892 DEBUG/Brooklyn: Enterprise deny list refresh periodic worker scheduled. [main] 2022-02-23 04:03:04,178 DEBUG/Brooklyn: EnterpriseDenyListRefreshWorker worker started. [DefaultDispatcher-worker-4] 2022-02-23 04:03:04,234 DEBUG/Brooklyn: Number of denyListsToRefresh to refresh : 0 [DefaultDispatcher-worker-4] 2022-02-23 04:03:04,243 DEBUG/Brooklyn: Configure and Display Brooklyn Enterprise controls called [DefaultDispatcher-worker-4] 2022-02-23 04:03:04,244 DEBUG/Brooklyn: allow listed account present [DefaultDispatcher-worker-4] 2022-02-23 04:03:04,244 DEBUG/Brooklyn: Brooklyn saved state is 2 and current state is ALLOW [DefaultDispatcher-worker-4] 2022-02-23 04:03:04,244 DEBUG/Brooklyn: Heuristics component is initialized. [DefaultDispatcher-worker-4] 2022-02-23 04:03:04,244 DEBUG/Brooklyn: Brooklyn module enabled [DefaultDispatcher-worker-4] 2022-02-23 04:03:04,244 DEBUG/Brooklyn: Brooklyn current state saved to ALLOW [DefaultDispatcher-worker-4] 2022-02-23 04:03:04,261 DEBUG/Brooklyn: EnterpriseDenyListRefreshWorker worker completed. Time taken : 0.081 seconds. [DefaultDispatcher-worker-4] 2022-02-23 04:03:04,288 DEBUG/Brooklyn: Configure and Display Brooklyn Enterprise controls called [DefaultDispatcher-worker-3] 2022-02-23 04:03:04,289 DEBUG/Brooklyn: allow listed account present [DefaultDispatcher-worker-3] 2022-02-23 04:03:04,290 DEBUG/Brooklyn: Brooklyn current state saved to ALLOW [DefaultDispatcher-worker-3] 2022-02-23 04:03:04,172 INFO/Experimentation: Starting experimentation worker request to TAS [DefaultDispatcher-worker-2]

Thanks in advance.

cljung commented 2 years ago

Closing this as you have cross posted the same issue on the Python sample https://github.com/Azure-Samples/active-directory-verifiable-credentials-python/issues/8