다음을 통해 공유


TokenResolver Interface

public interface TokenResolver

This interface is for client side implementation, which can be used for initializing AsyncDocumentClient without passing master key, resource token and permission feed.

Each time the SDK create request for CosmosDB, authorization token is generated based on that request at client side which enables creation of one AsyncDocumentClient per application shared across various users with different resource permissions.

Method Summary

Modifier and Type Method and Description
String getAuthorizationToken(String requestVerb, String resourceIdOrFullName, CosmosResourceType resourceType, Map<String, Object> properties)

This method will consume the request information and based on that it will generate the authorization token.

Method Details

getAuthorizationToken

public String getAuthorizationToken(String requestVerb, String resourceIdOrFullName, CosmosResourceType resourceType, Map properties)

This method will consume the request information and based on that it will generate the authorization token.

Parameters:

requestVerb - Request verb i.e. GET, POST, PUT etc.
resourceIdOrFullName - ResourceID or resource full name.
resourceType - Resource type i.e. Database, DocumentCollection, Document etc.
properties - the user properties.

Returns:

The authorization token.

Applies to