Skip to content

With credentials

Ahmad K. Bawaneh edited this page Jul 10, 2020 · 1 revision

With credentials

withCredentials property is a Boolean that indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. Setting withCredentials has no effect on same-site requests.

in domino-rest you can set the withCredentials flag using one of the following :

  • Directly set the value on the request instance :
PersonServiceFactory.INSTANCE
      .create(person)
      .setWithCredentials(true)
      .onSuccess(personConsumer::accept)
      .onFailed(failedConsumer::accept)
      .send();
  • Using the @WithCredentials annotation which has a boolean value, default value is true
    @POST
    @Path("someService/create")
    @Produces(MediaType.APPLICATION_JSON)
    @WithCredentials(true)
    Void registerUser(@RequestBody HashMap<String, String> personalData);

if the annotation not presented on the interface, the flag wont be set and will be left to the default implementation.