public JwtFactory(IOptions <JwtIssuerOptions> jwtOptions, IOptions <JwtChatIssuerOptions> jwtChatOptions) { _jwtOptions = jwtOptions.Value; _jwtChatOptions = jwtChatOptions.Value; ThrowIfInvalidOptions(_jwtOptions); ThrowIfInvalidOptions(_jwtChatOptions); }
public static async Task <JwtToken> GenerateJwtForChat(GetWebsiteInfoFromDomainViewModel websiteInfoData, IJwtFactory jwtFactory, JwtChatIssuerOptions jwtOptions, string audience) { JwtToken response = new JwtToken { id = Convert.ToString(websiteInfoData.WebsiteId), auth_token = await jwtFactory.GenerateEncodedTokenForChat(websiteInfoData, audience), expires_in = (int)jwtOptions.ValidFor.TotalSeconds, refresh_token = "" }; return(response); //return JsonConvert.SerializeObject(response, serializerSettings); }