Skip to main content
Skip table of contents

setBasicAuthentication (JsonSchemaUtils)

Versionshinweise

25.5

Code

GROOVY
JsonSchemaConfig setBasicAuthentication(JsonSchemaConfig config, String username, String password)

Beschreibung

Legt die Anmeldedaten für eine HTTP-Basic-Authentifizierung fest, falls die Schema-URI geschützt ist.

Parameter

  • config - Die Konfiguration für die Validierung.

  • username - Der Benutzername für die Authentifizierung.

  • password - Das Passwort für die Authentifizierung.

Rückgabe

Die modifizierte Konfiguration.

Beispiele

GROOVY
JsonSchemaConfig config = JsonSchemaUtils.createValidationConfig();
config = JsonSchemaUtils.setBasicAuthentication(config, "USER", "PASSWORD");

JsonSchemaValidation validation = JsonSchemaUtils.validate(config, SCHEMA_AUTH_URI, json);

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.