Table of Contents

Class XapiLrsCredential

Namespace
Xapi.Lrs
Assembly
Xapi.Lrs.dll

A key and secret that clients send with HTTP Basic authentication, and the scopes granted to it.

public sealed class XapiLrsCredential
Inheritance
XapiLrsCredential
Inherited Members

Remarks

The values are checked when the host starts, see Credentials. Configured credentials are then written to the database with the secret hashed (PBKDF2), and the stored list mirrors the configured one. The secret is never stored or logged in plain text.

The authority put on the statements a credential stores is an Agent with an account on AuthorityHomePage named after Key, unless the credential is created in code with XapiLrsCredential(string, string, Agent, params string[]). It is not a property, so that the configuration binder, reflection-based or source-generated, can bind this class.

Constructors

XapiLrsCredential()

Creates an empty credential, for example for the configuration binder.

public XapiLrsCredential()

XapiLrsCredential(string, string, params string[])

Creates a credential.

public XapiLrsCredential(string key, string secret, params string[] scopes)

Parameters

key string

The Basic user name.

secret string

The Basic password.

scopes string[]

The scopes granted, as XapiScopes names.

XapiLrsCredential(string, string, Agent, params string[])

Creates a credential that stores statements with the given authority.

public XapiLrsCredential(string key, string secret, Agent authority, params string[] scopes)

Parameters

key string

The Basic user name.

secret string

The Basic password.

authority Agent

The authority put on statements stored with this credential.

scopes string[]

The scopes granted, as XapiScopes names.

Properties

Key

The Basic user name. Required; must not be empty or contain a colon.

public string? Key { get; set; }

Property Value

string

Scopes

The scopes granted, as xAPI scope names such as StatementsWrite (statements/write). At least one is required.

public IList<string> Scopes { get; }

Property Value

IList<string>

Secret

The Basic password. Required; must not be empty.

public string? Secret { get; set; }

Property Value

string