Skip to content

xception in thread "main" java.lang.IllegalArgumentException: Input byte array has incorrect ending byte at 16 at java.base/java.util.Base64$Decoder.decode0(Base64.java:876) at java.base/java.util.Base64$Decoder.decode(Base64.java:566) #17

@bravikr

Description

@bravikr

Exception in thread "main" java.lang.IllegalArgumentException: Input byte array has incorrect ending byte at 16
at java.base/java.util.Base64$Decoder.decode0(Base64.java:876)
at java.base/java.util.Base64$Decoder.decode(Base64.java:566)
at com.azure.cosmos.implementation.BaseAuthorizationTokenProvider.createMac(BaseAuthorizationTokenProvider.java:218)
at com.azure.cosmos.implementation.BaseAuthorizationTokenProvider.lambda$reInitializeIfPossible$0(BaseAuthorizationTokenProvider.java:250)
at com.azure.cosmos.implementation.MacPool.(MacPool.java:27)
at com.azure.cosmos.implementation.BaseAuthorizationTokenProvider.reInitializeIfPossible(BaseAuthorizationTokenProvider.java:250)
at com.azure.cosmos.implementation.BaseAuthorizationTokenProvider.(BaseAuthorizationTokenProvider.java:38)
at com.azure.cosmos.implementation.RxDocumentClientImpl.(RxDocumentClientImpl.java:459)
at com.azure.cosmos.implementation.RxDocumentClientImpl.(RxDocumentClientImpl.java:330)
at com.azure.cosmos.implementation.RxDocumentClientImpl.(RxDocumentClientImpl.java:290)
at com.azure.cosmos.implementation.AsyncDocumentClient$Builder.build(AsyncDocumentClient.java:275)
at com.azure.cosmos.CosmosAsyncClient.(CosmosAsyncClient.java:170)
at com.azure.cosmos.CosmosClientBuilder.buildAsyncClient(CosmosClientBuilder.java:1084)
at com.azure.cosmos.CosmosClientBuilder.buildAsyncClient(CosmosClientBuilder.java:1071)

Get the above exception when I try to use and run the below api.

	 CosmosAsyncClient	 client = new CosmosClientBuilder()
			                              .endpoint(endpointUri)
			                              .key(connection_string)
			                             .buildAsyncClient();

public String connection_string = "AccountEndpoint=https://";

Is that conneciton_string needs to be encrypted ? but how it has to be ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions