UNPKG

@digitalpersona/core

Version:
26 lines (15 loc) 1.39 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@digitalpersona/core](./core.md) &gt; [User](./core.user.md) &gt; [(constructor)](./core.user.(constructor).md) ## User.(constructor) Constructs the object using a username and a user type. <b>Signature:</b> ```typescript constructor(name: string, type?: UserNameType); ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | name | <code>string</code> | user name. No name transformation/canonicalization is performed. | | type | <code>UserNameType</code> | an optional type of the user. If not provided, he type is deduced automatically. | ## Remarks If no `type` parameter is provided, the username format is analyzes and automatic type is assigned. For example: \* "user<!-- -->@<!-- -->comtoso.com" name will be parsed as a [User Principal Name (UPN)](./core.usernametype.upn.md)<!-- -->, \* "Domain<!-- -->\\<!-- -->UserX" name will be parsed as a [Security Account Manager (SAM)](./core.usernametype.sam.md) name, \* "6de5b5ed-85fc-4298-a18b-dac7d5a18369" will be parsed as a [Unique Identifier (UID)](./core.usernametype.uid.md) name, \* "UserX" name will be parsed as a [DigitalPersona name](./core.usernametype.dp.md) (used in LDS) You may provide a `type` parameter if you want to enforce a specific name type.