Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

HttpOnlyCookie option #107

Merged
merged 20 commits into from
Sep 24, 2022
Merged

HttpOnlyCookie option #107

merged 20 commits into from
Sep 24, 2022

Conversation

madeyoga
Copy link
Owner

@madeyoga madeyoga commented Sep 17, 2022

builder.Services.AddAuthEndpointsCore<MyCustomIdentityUser, MyDbContext>(); // <-- 

builder.Services.AddSimpleJwtEndpoints<ApplicationUser, ApplicationDbContext>(options => 
{
  options.UseCookie = true;
});

Jwt endpoints will return 204 NoContent. Default cookie options used to store jwts:

new CookieOptions()
{
  HttpOnly = true,
  SameSite = SameSiteMode.Lax,
};

Cookie options is configured inside SimpleJwtOptions:

builder.Services.AddSimpleJwtEndpoints<ApplicationUser, ApplicationDbContext>(options => 
{
  options.UseCookie = true;
  options.CookieOptions = new CookieOptions()
  {
    SameSite = SameSiteMode.Strict,
  };
});

@madeyoga madeyoga added improvements Larger code contributions new-feature New feature documentation Improvements or additions to documentation labels Sep 17, 2022
@madeyoga madeyoga merged commit ef09a59 into main Sep 24, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation improvements Larger code contributions new-feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant