MaikuB / MaikuB/flutter_appauth
sign in doesn't give me the option to select another account (even with preferEphemeralSession=true)
Nobody has claimed this yet.
- Dominant language
- Objective-C
- Stars
- 308
- Forks
- 301
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 5
Description
problem
===
Trying to integrate a microsoft sign in with my app. I am always stuck in a pre-existing account with no way to select another account (even in ephemeral session mode)
details
===
Everything works fine if I never signed in with the browser. I get the popup which asks for my username/password. Perfect.

Unfortunately If I ever signed in with the browser in the past, I now get this popup:

And there is no way way to say "no, I want to sign in to a different org, or use a different account". Nothing. `Cancel` just closes the window.
The only solution I found is to ask my users to switch to chrome and clear the browser data, but obviously this is not going to happen. Am I missing something obvious ?
code
===
This is what I am using to bring up the auth page:
```
final AuthorizationTokenResponse? result = await appAuth.authorizeAndExchangeCode(
AuthorizationTokenRequest(
_clientId,
_redirectUrl,
serviceConfiguration: AuthorizationServiceConfiguration(
authorizationEndpoint: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
tokenEndpoint: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
endSessionEndpoint: ''),
scopes: ['openid', 'profile', 'email', 'offline_access'],
preferEphemeralSession: true,
),
);
```
(ps: I thought `preferEphemeralSession: true` was to explicitly address this but apparently not...)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the authorizeAndExchangeCode call and its preferEphemeralSession option, then trace how the Flutter wrapper passes this request to the AppAuth iOS and Android SDKs. Reproduce the flow after a prior Microsoft browser sign-in; done means users can choose a different account or organization without clearing browser data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, dart, flutter, ios
- Domain
- authentication, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100