Ejemplo n.º 1
0
        public async Task <IActionResult> GetTokenAsync()
        {
            var response = await _userTokenManager.GenerateTokenAsync(_resourceConnectionString);

            var clientResponse = new
            {
                user = new {
                    communicationUserId = response.User.Id
                },
                token     = response.AccessToken.Token,
                expiresOn = response.AccessToken.ExpiresOn
            };

            return(this.Ok(clientResponse));
        }
Ejemplo n.º 2
0
        private async Task <ContosoChatTokenModel> InternalGenerateAdhocUser()
        {
            var(userMri, token, expiresIn) = await _userTokenManager.GenerateTokenAsync(_resourceConnectionString);

            ContosoChatTokenModel model = new ContosoChatTokenModel
            {
                identity  = userMri,
                token     = token,
                expiresIn = expiresIn
            };

            return(model);
        }
 private async Task <CommunicationUserToken> InternalGenerateAdhocUser()
 {
     return(await _userTokenManager.GenerateTokenAsync(_resourceConnectionString));
 }