MaikuB / MaikuB/flutter_appauth

sign in doesn't give me the option to select another account (even with preferEphemeralSession=true)

Open
#500 2 comments 0 reactions 0 assignees View on GitHub

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.

![image](https://github.com/MaikuB/flutter_appauth/assets/518393/153219d3-2b97-496e-8ada-53cd7fce3379)

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

![image](https://github.com/MaikuB/flutter_appauth/assets/518393/8444fd61-8833-438e-9e1c-8bb3ff98b518)

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.