Skip to main content
Skip table of contents

setBearerAuthentication

Versionshinweise

25.5

Code

GROOVY
JsonSchemaConfig setBearerAuthentication(JsonSchemaConfig config, String bearerToken)

Beschreibung

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

Parameter

  • config - Die Konfiguration für die Validierung.

  • bearerToken - Das Bearer-Token für die Authentifizierung.

Rückgabe

Die modifizierte Konfiguration.

Beispiele

GROOVY
String bearerToken = "...";
JsonSchemaConfig config = JsonSchemaUtils.createValidationConfig();
config = JsonSchemaUtils.setBearerAuthentication(config, bearerToken);

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.