tencent cloud

Feedback

JWT Authentication Configuration

Last updated: 2022-09-08 14:59:29

    Overview

    TDMQ for Pulsar provides the same JWT authentication method used by native Pulsar, which allows you to access TDMQ for Pulsar resources by configuring the token in the client parameters. For directions on how to configure the relationships between different role tokens and TDMQ for Pulsar resources in the console, see Roles and Permissions.

    This document describes how to configure JWT authentication in a TDMQ for Pulsar client, so that you can securely use the client to produce and consume messages. You can also add a token when creating a client.

    Authentication Configuration

    Java client

    Configure JWT authentication in a Java client:

    PulsarClient client = PulsarClient.builder()
        // Access address, which can be copied from **Access Address** in the **Operation** column on the **Cluster Management** page
        .serviceUrl("http://*") 
        // Replace it with the role token displayed on the **Role Management** page
        .authentication(AuthenticationFactory.token("eyJh****")) 
        .build();
    

    Go client

    Configure JWT authentication in a Go client:

    client, err := NewClient(ClientOptions{
         // Access address, which can be copied from the access point list in **Cluster Management**
         URL: "http://*",  
         // Replace it with the role token displayed on the **Role Management** page
         Authentication: NewAuthenticationToken("eyJh****"),  
    })
    

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support