What is the format of the LinkedIn id field r_basicprofile? - linkedin

We make use of Sign in with LinkedIn for a pre-existing app. The app uses the id field returned as part of the user's profile, however the app has restrictions on what character values can be present in the id.
What are the legal characters that LinkedIn will put in the id?
The description for id says
A unique identifying value for the member.
This value is linked to your specific application. Any attempts to use it with a different application will result in a "404 - Invalid member id" error.
Testing a small sample size, shows things like zHjkl_t-4D, _IcF7_r2b1 and -1ZM8mwCKM, which caused an issue with the field being restricted to starting with alphanumeric characters. I'd like to know the legal values so we can access if LinkedIn signups are suitable for future applications.

Member IDs are presented in Base64 encoded format. Any characters that show up in the Base64 index table are valid.

Related

Ignore Turkish Characters On Firestore Query

I have a .net app that uses Firestore as a database and It's using Firestore Query to find some data. The problem is data fields that include Turkish characters but if someone uses my app and wants to search for data and if don't use Turkish characters, the query can not find this data.
For example, if I want to search my name on my app and my name is saved like "Ertuğrul" and if the user searches like "Ertugrul", the query can not find it. I need it to find it. Is there a way to do that?
My code that uses query is here:
QRef = DataBase.Collection("CollName").Document("DocName").Collection("CollName")
.WhereGreaterThanOrEqualTo("NameSurname", $"{NameSurname}")
.WhereLessThanOrEqualTo("NameSurname", $"{NameSurname}\uF7FF");
Firestore queries always return documents where a particular field holds a perfect match. If you want to be able to search for "Ertuğrul" as well as for "Ertugrul", then besides the "NameSurname" field you should consider adding a new field called "NameSurnameWithoutSpecialCharacters" and store each name without those Turkish characters.
When a user searches, simply verify if the searched term contains "special" characters. If it does, search on the "NameSurname", otherwise search on the newly created field.

Firebase: How to handle users with same displayNames when they sign up with Google Provider?

I have an app where people can sign up for user accounts. They can use their Google account or sign up using email/password. I am storing the user's displayName in Firestore so I can reference it throughout the app as their username.
However, there is a problem:
Let's say "John Doe" signs up for a user account on my app and he uses his Google account named johndoe#gmail.com. His Google account's display name is also "John Doe". However, a few days later, another with the same name "John Doe" signs up for a user account, and although his Google account email may be different (let's say, johndoe2#gmail.com), his display name is still the same. Now, I have 2 users in my app with the same display name "John Doe". This causes an issue when I am trying to create user name routes such as: https://myapp.com/JohnDoe and handling user profile lookups.
What is the recommended way to allow users to use their Google accounts if there are other users that may have the same display names? The catch is I don't want to store UIDs in the URL as I want it to be clean with just the displayName.
The catch is I don't want to store UIDs in the URL as I want it to be clean with just the displayName.
It might be clean, as long as the number of characters within the displayName is reasonable. In your example, "John Doe", contains only 8 characters, including the whitespace character between the names, which is fine. But I've seen so many examples of names that are larger than 28, the number of characters that exist in a UID. Since the displayName property is set within the Google account and it can be changed only by the user, you're having three solutions left.
The first one would be to create your own mechanism for setting specific user names into your application. These user names can be set especially by the users. It can be the same as the names in the Google account or not. However, when someone chooses "JohnDoe" and a second user wants to set the same user name, it won't be possible, since a "JohnDoe" is already present. So before setting a new user name, you should always check if that one is already present. You can do that because it's something that you control. When using Firestore, this can be simply done by using:
db.collection("users").whereEqualTo("userName", "JohnDoe");
Or when using the Realtime Database:
db.child("users").orderByChild("userName").equalTo("JohnDoe");
Now, the first "John Doe" will have a profile that looks like this:
https://myapp.com/JohnDoe
While the second one might have something like this:
https://myapp.com/John_Doe
See the underscore? This kind of mechanism is very widely used. Facebook, Instagram, Twitter, eBay, Reddit, and many more do that:
https://www.facebook.com/JohnDoe/
https://www.instagram.com/JohnDoe/
https://twitter.com/JohnDoe/
https://www.ebay.com/usr/JohnDoe/
https://www.reddit.com/user/JohnDoe/
The second one would be to ignore the user names and use only the UIDs that come from the authentication process. Case in which, your URL will look like this:
https://myapp.com/TwentyEightCharactersLong
That's not unusual, since other big apps use it:
https://www.imdb.com/user/$userId/
The third one would be to create a combination between the UID and the user name. The best example would be Stackoverflow:
https://stackoverflow.com/users/$userId/$userName/
// ^ ^
Or LinkedIn:
https://www.linkedin.com/in/$userName-$userId/
// ^ ^
Doesn't matter which solution will you apply, you'll always have unique URLs. But it's up to you to choose which one of these solutions seems more clear to you.
It's quite common to see URLs suffixed with some random number or combination of alphanumeric characters like john-doe-1 and so on. That being said you would have to implement logic for this yourself maybe using Firebase Auth Triggers for Cloud Functions which will run whenever a new user is created and you can add an URL for their name.
You could also add some random string like /users/john-doe-qwerty and maybe add a paid feature that allows user to set their own URLs (if applicable for your application) i.e. vanity URLs.
I recently had this issue too, after playing around with 2 separate Google Play accounts, I found that the user.UserId is static and unique, and while the user.DisplayName can be changed, display names are unique.
Therefore, you should be safe storing data under UserId and then grabbing their current display name on login. Alternatively, to match your wants, you can save the data under the display name but you might want to track their user identification code in case they change their display name (if you wish to accommodate that)

What is the Firebase Id Format called?

I am currently creating an App with a firebase backend. When creating a new User it gets automatically assigned to an Id in an Format that looks like this: v4xpr8hLrLR3W5VUTN2zZ3XXKrF3.
Has this format a name? Like the 00000000-0000-0000-0000-000000000000 is called a Guid?
A UUID/GUID (RFC 4122) is a 128-bit number written as 32 hexadecimal characters.
A Firebase RTDB Push ID is 20 Base64 characters (a 120-bit number) and a Firebase user ID is (currently) 28 Base62 characters (a 166-bit number). This particular ID format doesn't appear to have an official name at the moment, as they are simply referred to as Push IDs and User UIDs.
However, inspired by the Firebase Push IDs, there is a new term that could be applied here: ULID - a Universally Unique Lexicographic Sortable IDentifier. The Firebase implementation of these IDs is not compatible with the proposed ULID spec (as the spec is Base32 and designed to be UUID compatible) but is similar enough that the name could be used here.

Google Plus 21-digit URL Number Relationship to a Google Place's ID and Reference Numbers

What is the relationship between a Google Place's ID and Reference Number and the same Place's 21-digit Google Plus number used in the Place's Google Plus URL?
I want to link Google Plus URLs for 100's of different businesses to my website. However, I do not know the Google Plus URL address for each of the businesses. But I do know the Google Place ID and Reference Number for each of the businesses. Can I derive the 21-digit Google Plus Number for a business from their Google Places ID and Reference Number? If I can, what is the formula that creates the 21-digit Google Plus Number?
Or is the Google Plus number completely random so that there is no relationship at all with the Google Place's ID and Reference Number?
The ID gives you the URL, just prefix it with "https://plus.google.com/" but as far as I know there is no way to get a ref from the ID. The ref is returned by an API search and when you have a valid ref if you want to ask detail ( i.e reviews ) from this ref you must keep it somewhere and it's a pain because it's a very long string. So if somebody knows how to get the ref from a ID that would be great !
Google's 21-digit number is a numeric form of your UserID.
Most Google sites & API's that identify the UserID in the URL will function properly while interchangeably using any of:
your "text" UserID (your Gmail address to the left of the #),
your 21-digit numeric UserID (as determined below), or,
the word default in place of either (representing the currently authenticated user).
One way to see your numeric UserID is to — while logged into your Google Account — go to:
   https://picasaweb.google.com/data/feed/api/user/default/
The 21-digit page title is your numeric Google UserID.
If you have a 21-digit number that you want to confirm is yours, go to:
   https://plus.google.com/ _21digitUserID_
If it loads your Plus page, that's your numeric Google UserID. (Unless you, like me, have deactivated your Google Plus page!)
"Kinda Related" Bonus Tip:
You can insert + plus signs followed by text after your Gmail address — and add/remove . dots anywhere in your Gmail address — without a problem.
So, these would all get delivered to the same place:
abc123#gmail.com abc123+SortToMySecretFolder#gmail.com a.b.c.123#gmail.com
abc123+camping.trip#gmail.com abc.123#gmail.com abc123+spam.site.signup#gmail.com
You could utilize this by creating rules to handle each address in a different way, or even track which websites are selling your email address to spammers. (Source)

Getting a list of salesforce reports with the 'unique name' and not just the user label

Get a manipulatable list of Salesforce reports is already a little bit convoluted, requiring login to the site and then downloading /servlet/servlet.ReportList, which is an xml file containing a list of reports. For each report you get the folder name, the name (user label), the id and whether it is public. However two fields are missing - the "unique" name and the description. The unique name is important here, as Salesforce allows any number of reports, even in the same folder, to have the same name/label. This means the only way to tell them apart is by the unique name.
Is there any way to get a list of reports that includes both the unique name and the id? (or failing that the description and the id?)
The Metadata API supports Reports.
Included are the "name"and "fullName" fields. The latter is the unique ID for a Report.

Resources