matt-al-4005 avatar image
0 Votes"
matt-al-4005 asked SnehaAgrawal-MSFT answered

Token generation custom claim attachement

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?

             // 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}:");

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for reaching here! Could you please elaborate your ask, If I am understanding right you want to replicate the functionality of Azure Identity management if so, As mentioned in the document here that;

"Azure Communication Services doesn't replicate the functionality of the Azure identity management system. It doesn't provide a way for customers to use customer-specific identities. For example, customers can't use a phone number or email address. Instead, Azure Communication Services provides unique identifiers. You can assign these unique identifiers to your application's identities. Azure Communication Services doesn't store any kind of information that might reveal the real identity of your users."

Let us know to help you better on this.

0 Votes 0 ·
matt-al-4005 avatar image matt-al-4005 SnehaAgrawal-MSFT ·

Thanks @SnehaAgrawal-MSFT .

I actually did not mean to have a replication of an identity management. What I meant was to know whether issuing an access token by ACS, that can be configurable so that I can inject some claims in that access token to be validated later in the process.
Such as; an email address or phone number to be added in that token as a custom claim so that I could verify an anonymous user access checking against their email & phone number input.

0 Votes 0 ·

1 Answer

SnehaAgrawal-MSFT avatar image
0 Votes"
SnehaAgrawal-MSFT answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.