Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample for GetAccountAsync() not using correct claims #15

Open
isaacrlevin opened this issue Feb 27, 2023 · 1 comment
Open

Sample for GetAccountAsync() not using correct claims #15

isaacrlevin opened this issue Feb 27, 2023 · 1 comment
Assignees

Comments

@isaacrlevin
Copy link

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [X ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  • Clone Repo
  • Follow steps

Any log messages given by the failure

Using the sample, the GetAccountIdentifier method does not check the correct claims and no accounts are retrieved when using that identifier

        private string GetAccountIdentifier(AuthenticationState authState)
        {
            if (authState.User.Identities.First().Claims.Where(c => c.Type == "uid").Count() == 0 ||
                authState.User.Identities.First().Claims.Where(c => c.Type == "utid").Count() == 0)
            {
                return null;
            }
            //return "<user object id>.<tenant id>" which is account identifier;
            return authState.User.Identities.First().Claims.Where(c => c.Type == "uid").First().Value + "." +
                authState.User.Identities.First().Claims.Where(c => c.Type == "utid").First().Value;
        }

Expected/desired behavior

GetAccountAsync() to return account

OS and Version?

Windows 11

Thanks! We'll be in touch soon.

@kalyankrishna1
Copy link
Contributor

@v-michaelmi , please have a look at this one when you have a moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants