Answer:
theoretically it should be an user id because the word unit starts with a vowel, all words that start with a vowel, or have a vowel sound (i.e. hour) you use an, not a.
but a lot of the English language is all in how it sounds, & to me, an user id doesn't sound right, so i would say a.
"An" was once used with some words starting with 'h' also, but this usage is probably considered obsolete. For example, "a historic event" sounded incorrect; "an historic event" was the right way to say it. There are other instances where "a" is correct. I think it is when the initial vowel sound of the noun is like a "diphthong", a vowel or vowel combination that changes value while it is being pronounced. So it sounds correct to say "a university" and "a euphemism".
It seems that "an" is used to solve the need to make a "stop" between vowel sounds, and it is jarring to my ear when people don't use "an" for this purpose. "Can you give a example" is awkward, because I want to make (and hear) a distinct "a" sound followed by a distinct "e" sound. Another example is "in the blink of a eye".
---
"User" does not begin with a vowel sound, but with a consonantal y-glide. That is why the n of an is dropped.