All Products
Document Center

OpenSearch:Demo code for using a temporary STS token

Last Updated:Sep 09, 2021

You can call the AssumeRole operation to obtain a temporary AccessKey pair and a Security Token Service (STS) token. You can use the temporary AccessKey pair and STS token to create an OpenSearch object.

OpenSearch openSearch = new OpenSearch("<Temporary AccessKey ID>",
    "<Temporary AccessKey secret>", "");
openSearch.setSecurityToken("<Temporary STS token>");