AD B2C default signup-sign-in flow returns the "emails" claim with value type string instead of array - asp.net-core

I am writing .Net Core API code that examines the value of the AD B2C built-in emails claim. I'm expecting this claim to show up on the ClaimsPrincipal as an IList<string> or similar, but it is instead of type string.
The Email Addresses claim is selected in the Azure portal and shows a data type of StringCollection and the emails claim appears on the ClaimsPrincipal but it is of type string. The data I am working with only has a single email address per user so I'm not sure what would happen if there were multiple email addresses.
I understand why AD returns an emails claim (plural) rather than an email claim (singular) so why is the emails claim value a string (the user's email address) instead of an array containing that single email address?
This:
emails: 'email#somedomain.com'
Instead of this:
emails: ['email#somedomain.com']
I'm currently on .NET Core 3.1
Updated to .NET 6 and I still experience the same thing. Am I missing a setting in AD or elsewhere? Is this the expected behavior?

When i tried i got the alternate email address in stringCollection format.
Please try to raise a support request if two or more mails when added are not reflecting in the emails claim else its not an issue AFAIK.

Related

How to get displayName (Name, Surname) from external organization smtp address in Outlook API?

all, and thanks for your support.
I have a list of e-mails (ex: johndoe#company1.com, maryjane#company2.com) and need their DisplayTo names.
By "DisplayTo" I mean the name that appears after the first e-mail is sent ("ABC" in red).
So it should be something like "John Doe" or "Jane, Mary", which is how future e-mails to them appear (only the first one appears as name#company.com).
The Address Catalog only has internal company e-mails. I could not find a way to get this information in Outlook API documentation, is there a way to do this?
Thanks a million!
Pass the SMTP address to Namespace.CreateRecipient (returns Recipient object). Call Recipient.Resolve, then use Recipient.AddressEntry.GetExchangeUser.FirstName/LastName/etc (error / null checking omitted).

Using query string parameter in Kentico marketing automation process

I am trying to set up a marketing automation process that is kicked off when a user visits a particular web page on my site. The URL to that web page is going to be included in an email blast to a set of Kentico contacts.
I was hoping to be able to add a query string parameter to the end of the URL so that I can capture the e-mail address of the contact and store it in the Contact Email field,
i.e. http://example.com/mypage?email=xx#xxx.com.
My first attempt at this was setting up a marketing automation workflow that is triggered when the user visits the page, then using a 'Set Contact Property' step to set the contact's email address to the query string value, but I can't seem to be able to get the value of the query string parameter. I've tried {? email?}, {% QueryString.email%}, etc. with no luck.
Anyone have any ideas?
You are very close. Try this:
{% QueryString["nameOfQueryString"] %}
So if my URL were http://www.exmaple.com/mypage?email=testEmail#example.com, and I wanted to resolve the query string called "email" I would write:
{% QueryString["email"] %}
And it would resolve "testEmail#example.com".
Side Note: I would not recommend using your users' emails as the query string. I would use a GUID to build the URL and associate the user's email with a GUID in a SQL table.
So, if the email address "testEmail#exaple.com" was associated to the guid 25892e17-80f6-415f-9c65-7395632f0223, you would build a URL like this:
http://www.exmaple.com/mypage?id=25892e17-80f6-415f-9c65-7395632f0223
Then when the user visits this page, you can tell who they are by comparing the GUID to their email.

Google + (after sign in retrieve the code)

I completed the Google + sign in.But after sign in I want to retrieve the inforamation means User first name and lastname seperately.But I retrieve the full name Using disPlayname.But I want first name and last name seperately. So please help any one.Because those values should be passed to one method in my web application.My web application is based on JAVA.(Ecommerce site).Please suggest any code for me.
Instead of using the displayName field in the returned object, you can use the name.firstName and name.lastName fields.
See https://developers.google.com/+/api/latest/people#resource for details and for what other fields are available as part of name.

MVC user's full name in Url, how to handle duplicates

I want to setup the following url in my MVC4 website, using the user's full name in the url:
http://www.myapp.com/profile/steve-jones
I have setup the following route in Global.asax:
routeCollection.MapRoute(
"profile", "profile/{userName}",
new { controller = "myController", action = "profile", userName = string.Empty
});
And I can take the parameter 'steve-jones' and match it to a user with matching name. My only problem though is, what if there is more than one 'Steve Jones', how can I handle this?
Does anyone know of a workaround/solution to this so that I can use a user's full name as part of the url and still be able to retrieve the correct user in the controller method?
Am I forced into including the user's id with the url (something that I do not want to appear)?
The usual way of handling this is by appending a number when creating the profiles. So if "steve-jones" is already a name in the database, then make the user's display name "steve-jones2". You basically have to insist that all profile urls are unique, which includes updating any existing database and account creation code.
Alternatively (and/or additionally), if two same names are found then have the script reroute to a disambiguation page where the user is presented with links and snippet of profile info of the many existing Steve Joneseses so they can go to the full correct profile.
Another way of handling it is by giving all user profiles an additional numeric code on the end. At my university all logins are based on name, so they give everyone pseudo-random 3-digit extensions so that they are safe as long as they don't get 1000 people with the exact same names :)
Some people might be happier being steve-jones-342 if there is no steve-jones or steve-jones1, if you're concerned.

How to change registration requirement for user ID in chat function

Hi when I run the sample chat function provided by quickblox, it contains several built-in limitation for username registration, for example, I need to have a certain number of characters or type of characters in order to register. I'm wondering which files contain those registration and display of error messages (I only found a class called "errors" in SignUpViewController ) and how do I change those limitations?
There are 2 ways:
Sign Up & then Sign In with email
Sign Up & then Sign In with login - Login field should contain alphanumeric and punctuation characters only
Is it OK? Or you have problem with other User's field?