I am writing a MAUI Blazor Hybrid app using MSAL to Authenticate with a B2C Tenant. I have it working in our dev environment with an Azure B2C application ClientId that is used in two places.
Firstly to create the MSAL client object:
authenticationClient = PublicClientApplicationBuilder.Create(mauiAuthenticationConstants.ClientId)
.WithB2CAuthority(mauiAuthenticationConstants.AuthoritySignIn)
.WithTenantId(mauiAuthenticationConstants.TenantId)
.WithRedirectUri($"msal{mauiAuthenticationConstants.ClientId}://auth")
.WithClientId(mauiAuthenticationConstants.ClientId)
.Build();
And secondly to configure an Android intent in the manifest:
<activity android:name="microsoft.identity.client.BrowserTabActivity" android:configChanges="orientation|screenSize" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="msal[**REPLACE THIS WITH THE CLIENT ID OF YOUR APP**]" android:host="auth" />
</intent-filter>
</activity>
We will be having seperate Azure environments for each one of our clients and so the app will have a different Client Id in each one.
We need to be able to have the app in the Google store and when it is downloaded go through a process of initialisation where the B2C vars including the Client Id are pulled from a central DB and saved to local secure storage.
I can see how I can set the Client Id in the code but how would I replace the Client Id in the AndroidManifest.xml?
Cheers Brian