Skip to content

Using demo environment for testing

jalukse edited this page Apr 1, 2019 · 6 revisions

How to use it against demo environment

  1. Configuring the client with demo environment specific parameters
SmartIdClient client = new SmartIdClient();
client.setRelyingPartyUUID("00000000-0000-0000-0000-000000000000");
client.setRelyingPartyName("DEMO");
client.setHostUrl("https://sid.demo.sk.ee/smart-id-rp/v1/");
  1. Configuring the AuthenticationResponseValidator

When using demo environment, the certificates originate from test certificate chain. The AuthenticationResponseValidator verifies if the certificate in the authentication response is issued by one of the configured trusted CA certificates. By default AuthenticationResponseValidator is configured with live CA certificates, so when using demo environment it should be configured with test CA certificates in order for the authentication validation to succeed.

Currently all Smart-ID test certificates are issued by TEST of NQ-SK 2016 and TEST of EID-SK 2016 CA certificates. These certificates should be added to AuthenticationResponseValidator. They are obtainable from here.

Example of adding a test CA certificate to AuthenticationResponseValidator:

Path certificatePath = Paths.get("path/to/certificate");
byte[] certificateBytes = Files.readAllBytes(certificatePath);

AuthenticationResponseValidator validator = new AuthenticationResponseValidator();
validator.clearTrustedCACertificates();
validator.addTrustedCACertificate(certificateBytes);
  1. There is also possibility to replace trusted_certificates.jks with keystore containing TEST certificates, obtainable from here
Clone this wiki locally