Namespace: SpawnDev.SpawnJS.JSObjects
Inherits: SpawnJSObject
Source: JSObjects/Credential.cs
MDN Reference: Credential on MDN
The Credential interface of the Credential Management API provides information about an entity (usually a user) normally as a prerequisite to a trust decision. Credential objects may be of the following types: FederatedCredential IdentityCredential PasswordCredential PublicKeyCredential OTPCredential https://developer.mozilla.org/en-US/docs/Web/API/Credential
| Property | Type | Access | Description |
|---|---|---|---|
Id |
string |
get | Returns a string containing the credential's identifier. This might be any one of a GUID, username, or email address. |
Type |
string |
get | Returns a string containing the credential's type. Valid values are password, federated, public-key, identity and otp. (For PasswordCredential, FederatedCredential, PublicKeyCredential, IdentityCredential and OTPCredential) |
SpawnDev.SpawnJS Mapping Note: The JavaScript examples below show the standard Web API usage. In SpawnDev.SpawnJS, the same API is available with C# conventions:
- Properties and methods use PascalCase (e.g.,
readyStatebecomesReadyState)- Events use ActionEvent with
+=/-=(e.g.,addEventListener("click", fn)becomesOnClick += handler)- Async methods return
Task<T>instead ofPromise<T>- Objects should be disposed with
usingstatements- Access via
JS.Get<Credential>(...)or constructornew Credential(...)
const pwdCredential = new PasswordCredential({
id: "example-username", // Username/ID
name: "Carina Anand", // Display name
password: "correct horse battery staple", // Password
});
console.assert(pwdCredential.type === "password");