C#C
C#3y ago
S-IERRA

❔ JWT Storage location

Hi I'd like to ask where JWTs should be stored, my backend returns a JWT through the API and also sets an http-only cookie, but I'm not sure what to do with this from the front end as ASP requires an Authorization header and http only cookies can't be accessed from the front-end any ideas?

This is for most part what I do
        NumixAuthenticated jwtToken = _authenticatorService.GenerateToken(jwtUser);
        string jwtTokenJson = JsonSerializer.Serialize(jwtToken, JsonHelper.JsonSerializerOptions);
        
        var options = new CookieOptions
        {
            HttpOnly = true, 
        };
    
        Response.Cookies.Append("Numix", jwtTokenJson, options);

        return Ok(jwtTokenJson);
Was this page helpful?