Azure-Samples / Azure-Samples/ms-identity-ciam-dotnet-tutorial

Add sample for MAUI B2C custom flow

Open
#112 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
48
Forks
35
PR merge metrics
No merged PRs in 30d

Description

Hi try to follow your code to implement MSAL in a Maui app for iOS and Android. We have two different policys (custom html views) one for login and one for signup. I have som questions that I can't find any solution to in your docs or code.

1. In your sample code you just set this once in the constructor

.WithB2CAuthority($"{AzureADB2CConfig.Instance}/tfp/{AzureADB2CConfig.Domain}/{AzureADB2CConfig.SignUpSignInPolicyid}")

There is no code that show how to switch policy.

1.1. if I first have the policy signup and do the signup and later want to change to SignIn policy and request token silent I get SingIn web view. So there is no way to switch policy without get Webview. In a normal onboarding senario in an app you first signup and when that is done you want the url to change to SingIn if the token should expire when we use get token silent.

1.2 I have tested to request the token with no policy like the url below and on MsalUiRequiredException add the requested Policy
.WithB2CAuthority($"{AzureADB2CConfig.Instance}/tfp/{AzureADB2CConfig.Domain}
But then the backend team that use the token says that the oid gets [00000-000xxxx] when the use the token on there side. It has value on my side before I send it.

2. When we use the .WithUseEmbeddedWebView(true) flag we want the user not to leve the app. This work on iOS but on Android the web view trigger the app events OnSleep and OnResume. Is this a bug or something that needs to be configured.

//Thanks Joacim

### This issue is for a: (mark with an `x`)
```
- [x ] feature request
- [ x] documentation issue or request

### OS and Version?
> Ios and Android

> Thanks! We'll be in touch soon.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the existing MAUI sample and its WithB2CAuthority setup, then trace the WithUseEmbeddedWebView(true) flow alongside Android OnSleep and OnResume. The sample should demonstrate switching between signup and sign-in policies, silent token behavior, and the reported oid result, while documenting the Android web-view lifecycle behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, azure, csharp, ios
Domain
authentication, documentation, mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.