Client authentication doesn't work

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
OpenSearch 2.11

Describe the issue:
I am trying IAM role based authentication to opensearch server using opensearchpy python library. This gives me this error. (I am using the basic authentication steps as in one of the opensearch doc). Please advice on what I am doing wrong.

opensearchpy.exceptions.AuthorizationException: AuthorizationException(403, '{"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.\\n\\nThe Canonical String for this request should have been\\n\'GET\\n/\\n\\nhost:localhost

Configuration:

credentials = boto3.Session().get_credentials()
auth = AWSV4SignerAuth(credentials, region)
client = OpenSearch(
    hosts = [{'host': 'localhost', 'port': 9300}],
    http_auth = auth,
    #http_auth=(userName, password),
    http_compress=True,
    use_ssl = True,
    verify_certs = False,
    connection_class=RequestsHttpConnection,
)
info = client.info()
print(f"{info['version']['distribution']}: {info['version']['number']}")

Relevant Logs or Screenshots:

@riyaztk Have you tried with port 9200? Port 9300 is only used for OS node to OS node communication in OpenSearch 2.x. Client authentication on port 9300 has been deprecated.

Did you check the OpenSearch documentation? AWSV4SignerAuth is called with credentials, region and service.