Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

Latest commit

 

History

History
124 lines (87 loc) · 3.55 KB

File metadata and controls

124 lines (87 loc) · 3.55 KB

Methods

This is the general description of the methods availiable to you. I'm still struggling a bit to make this really readable in a good way, so perhaps easier to check with the examples. This as close a replication of the original library as possible, it is using language specific features and sports some nice taskbased interfaces.

constructor(initialization data)

Configures the module according to the object sent in. Example configs can be obtained by accessing the settings properties of each module.

Inputs

object(mandatory): A object containing configuration.

Outputs

None

PollAuthStatus(string) or PollSignStatus(string)

Inputs

string(mandatory): A string containing the id of the authentication or signing you wish to check

Outputs

A status object as one of the below:

{
    status: 'error' or 'pending',
    code: string,
    description: string,
    [details: string]
}

The description field is a user friendly error message in english. The details is a optional field that if it exists contains more information about the error. More generic error types often have a details field.

Status Possible Codes
error system_error
request_id_invalid
api_error
expired_transaction
cancelled_by_user
cancelled_by_idp
pending pending_notdelivered
pending_user_in_app
pending_delivered
{
    status: 'completed',
    user: {
        firstname: string,
        lastname: string,
        fullname: string,
        ssn: string
    },
    extra: {..}
}

When the status is completed extra information may be in the extra block depending on which module you are using.

Task AuthRequest(string, ProcessIProgress, CancellationToken) or Task SignRequest(string, string, ProcessIProgress, CancellationToken)

Inputs

string: this is the ssn most probably put could be a object with special properties for that module. ProcessIProgress: A ProcessIProgress to report back events and updates as they unfold CancellationToken: Standard CancellationToken to cancel the running task

Outputs

Same as PollAuthStatus(string) or PollSignStatus(string) but wrapped in a awaitable Task

InitAuthRequest(string) or InitSignRequest(string,string)

Inputs

string(mandatory): this is the ssn most probably put could be a object with special properties for that module. string(only for signing): this is the text most probably put could be a object with special properties for that module.

Outputs

A status object as one of the below:

{
    status: 'error',
    code: string,
    description: string,
    [details: string]
}

The description field is a user friendly error message in english. The details is a optional field that if it exists contains more information about the error. More generic error types often have a details field.

Status Possible Codes
error system_error
already_in_progress
request_ssn_invalid
request_text_invalid
api_error
{
    status: 'initialized',
    id: string,
    description: string,
    extra: {..}
}

When the status is completed extra information may be in the extra block depending on which module you are using.

CancelAuthRequest(string) or CancelSignRequest(string)

Inputs

string(mandatory): A string containing the id of the authentication or signing you wish to cancel

Outputs

{
    status: 'cancelled',
    id: string,
    description: string,
    extra: {..}
}