Token generation custom claim attachement

matt-al 41 Reputation points
2022-05-11T02:22:55.31+00:00

Hi, the following code snippet does generate an identity and token respectively. My question is that can we add a custom claim in that token generation or somehow manage to add some hidden value in the identity such as an user email address so that I can later double check who's accessing the video call?
Thanks

            // Create an identity
            var identityResponse = await client.CreateUserAsync();
            var identity = identityResponse.Value;
            Console.WriteLine($"\nCreated an identity with ID: {identity.Id}");

            // Issue an access token with the "voip" scope for an identity
            var tokenResponse = await client.GetTokenAsync(identity, scopes: new[] { CommunicationTokenScope.VoIP });
            var token = tokenResponse.Value.Token;
            var expiresOn = tokenResponse.Value.ExpiresOn;
            Console.WriteLine($"\nIssued an access token with 'voip' scope that expires at {expiresOn}:");
            Console.WriteLine(token);
Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
676 questions
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 18,286 Reputation points
    2022-05-12T14:51:45.74+00:00

    Thanks for clarification! Right now we don't have anything like this and the tokens are used to validate/authorize user access to the ACS provided communication modalities not into customer own other backends.

    Would suggest you to create a Feedback item and upvote it. The product group monitors this site for feedback. This is the best way to ensure you are heard and you may receive a response depending on how much they information they can currently share.

    Please reach out to us if further query on this.

    0 comments No comments

0 additional answers

Sort by: Most helpful