How to get user token from Android

hungChun 0 Reputation points
2023-03-03T06:36:01.8733333+00:00

Form the Microsoft Learn, I can't find how to get user's token of android.

Is there some method like below?

Why most examples just ask us to fill existed token, but not get the token form code?

            // Issue an access token with a validity of 24 hours and the "voip" scope for an identity
            //CommunicationUserIdentifier id = new CommunicationUserIdentifier(clientIdentity);
            Azure.Communication.CommunicationUserIdentifier id = new Azure.Communication.CommunicationUserIdentifier(clientIdentity);
            var tokenResponse = client.GetTokenAsync(id, scopes: new[] { CommunicationTokenScope.VoIP });

            // Get the token from the response
            this.clientToken = tokenResponse.Result.Value.Token;
           // var expiresOn = tokenResponse.Result.Value.ExpiresOn;
Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
669 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 15,166 Reputation points Microsoft Employee
    2023-03-05T23:54:32.2833333+00:00

    @hungChun We understand you would like more samples of how to obtain token's; specifically tokens on Android.

    We have gone ahead and created the document feedback request and assigned it to the document author since this requires a larger rewrite of the document.

    In the future, feel free to go ahead and create the document feedback request by following the steps to provide feedback at the bottom of the document(s).

    You can track the request here. Please let us know if you have any questions or concerns.