-
Notifications
You must be signed in to change notification settings - Fork 334
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
Handle case when b2c profile contains a '.' #2648
Conversation
{ | ||
return new AccountId(str); //Account id is from ADFS; no . in the string | ||
} | ||
|
||
return new AccountId(str, elements[0], elements[1]); | ||
return new AccountId(str, str.Substring(0, lastIndexOfDot), str.Substring(lastIndexOfDot + 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the fix, splitting the string based on the last .
@@ -117,7 +117,7 @@ public async Task<IEnumerable<IAccount>> GetAccountsAsync(string userFlow) | |||
var accounts = await GetAccountsInternalAsync(ApiIds.GetAccountsByUserFlow).ConfigureAwait(false); | |||
|
|||
return accounts.Where(acc => | |||
acc.HomeAccountId.ObjectId.Split('.')[0].EndsWith( | |||
acc.HomeAccountId.ObjectId.EndsWith( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the reason for adding this split here as the ObjectId
is obtained after splitting the homeAccountId
with the .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please add a few unit tests to cover the parsing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
#2444
Try to handle the scenario when the b2c profile have a '.' character.