Exemplo n.º 1
0
 public static AuthInfo GetAuthInfo()
 {
     return(new AuthInfo()
     {
         ServiceUrl = endpointProvider.GetClientEndpoint(HubName),
         AccessToken = tokenProvider.GenerateClientAccessToken(HubName)
     });
 }
Exemplo n.º 2
0
        public IActionResult GenerateJwtBearer(string hubName, [FromQuery] string uid)
        {
            var serviceUrl  = _endpointProvider.GetClientEndpoint(hubName);
            var accessToken = _tokenProvider.GenerateClientAccessToken(hubName, new[]
            {
                new Claim(ClaimTypes.NameIdentifier, uid)
            });

            return(new OkObjectResult(new
            {
                ServiceUrl = serviceUrl,
                AccessToken = accessToken
            }));
        }
Exemplo n.º 3
0
 public IActionResult GenerateJwtBearer(string hubName)
 {
     return(new OkObjectResult(
                new
     {
         serviceUrl = _endpointProvider.GetClientEndpoint(hubName),
         accessToken = _tokenProvider.GenerateClientAccessToken(hubName,
                                                                new[]
         {
             new Claim(ClaimTypes.Name, "username"),
             new Claim(ClaimTypes.NameIdentifier, "userId")
         })
     }));
 }