Closed EvanEvan-17 closed 2 years ago
Ah man because you don't respond, I have been done making my own code for multiple accounts.
@AlphaBs If you can't add it, then that's fine. I have done making custom launcher and modify many things. Now multiple accounts feature is working in my launcher. But if you can add it, I will appreciate it!
I think it will be great if the library supports multiple accounts. (my launcher also needs this feature!)
so I'm planning to add multiple session manager.
Don't forget to also store the Microsoft User ID returned by MSAL.NET, so you can bind your account data with MSAL.NET if you need it (e.g. to get tokens, etc).
Wow! Are you making a launcher like me? What is the purpose for your launcher? haha
When you add multiple accounts feature? If you can't, give me the tutorial to make custom login handler since I'm updating to the 'rc' version.
Implement your own ICacheManager
to return cached session.
working now: a2289dc606efd0376a8ec7bb6080bba464fd9efd
How do I install that version? Is that exist on nuget?
It's actually working since yesterday, with my own code. I've customized many things.
How do I install that version? Is that exist on nuget?
no I have not release yet. you should build it by yourself.
I've tried your sample with dummy device token API (because I'm under 18), but it failed. Without dummy device token API, it success for my first account (since it's on family group) but with dummy device token API, it failed.
what error message? can you show me your code?
please make new issue and explain more detail
Maybe later. I'm no longer testing your sample and I'm now trying to implement this on my own code. Does this multiple accounts feature work with MsalClient? Since the your MsalOAuthApiBase
is using accounts.FirstOrDefault()
var result = await MsalApplication.AcquireTokenSilent(Scopes, accounts.FirstOrDefault())
.ExecuteAsync(cancellationToken);
and also the token invalidation method remove ALL accounts from MSAL storage:
public static async Task RemoveAccounts(IPublicClientApplication app)
{
var accounts = await app.GetAccountsAsync();
while (accounts.Any())
{
var first = accounts.First();
await app.RemoveAsync(first);
accounts = await app.GetAccountsAsync();
}
}
yes it works. OAuth token does not matter
So if multiple accounts on MSAL.NET, it always read first account? How they know the selected session since they aren't reading a cache? Actually I've customized this, but please answer me so I know how it works.
Actually, I don't know. It's just a code to prove that you can create a multi account like this, not a code that designs and tests the exact behavior.
Again, I can't afford to develop this project now...
I'm trying to make my own Launcher for my YouTube Subscribers. I'm looking to support multiple accounts because MANY LAUNCHER SUPPORT MULTIPLE ACCOUNTS. How do I do this? Do I have to make my own code? Or can you add this feature?