Skip to content

Freja-eID/frejaeidclient-csharp

Repository files navigation

Freja eID Client - csharp

License

Freja eID Client is a C# client library aimed to ease integration of relying party back-end systems with Freja eID Relying Party API.

Features

This client library provides a set of classes, interface and utility methods designed for accomplishing one of the following use cases:

  • Authentication Services API Client
    • initiation of an authentication request
    • fetching a single authentication result based on authentication reference
    • fetching multiple authentication results
    • cancelling authentication request

Examples

Init connection to API (test environment)

SslSettings sslSettings = SslSettings.Create("/path/to/keystore.pkcs12", "SuperSecretKeystorePassword", "/path/to/server/certificate.crt");

Init, monitor and cancel authentication request

Create authentication client

IAuthenticationClient authenticationClient = AuthenticationClient.Create(sslSettings, FrejaEnvironment.TEST).Build<AuthenticationClient>();

Initiate request

InitiateAuthenticationRequest request = InitiateAuthenticationRequest.CreateDefaultWithEmail("email@example.com");
string reference = authenticationClient.Initiate(request);

Poll for request

int maxWaitingTimeInSeconds = 30;
AuthenticationResult result = authenticationClient.PollForResult(AuthenticationResultRequest.Create(reference), maxWaitingTimeInSeconds);

Cancel request

authenticationClient.Cancel(CancelAuthenticationRequest.Create(reference));

Releases

No releases published

Packages

No packages published

Languages