Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
disable same-site for external cookie #2595
Browse files Browse the repository at this point in the history
  • Loading branch information
brockallen committed Oct 3, 2018
1 parent e6a16e7 commit b0026c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public void Configure(string name, CookieAuthenticationOptions options)
if (name == IdentityServerConstants.ExternalCookieAuthenticationScheme)
{
options.Cookie.Name = IdentityServerConstants.ExternalCookieAuthenticationScheme;
// https://github.com/IdentityServer/IdentityServer4/issues/2595
// need to set None because iOS 12 safari considers the POST back to the client from the
// IdP as not safe, so cookies issued from response (with lax) then should not be honored.
// so we need to make those cookies issued without same-site, thus the browser will
// hold onto them and send on the next redirect to the callback page.
options.Cookie.SameSite = SameSiteMode.None;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/Infrastructure/MessageCookie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public void Write(string id, Message<TModel> message)
HttpOnly = true,
Secure = Secure,
Path = CookiePath
// don't need to set same-site since cookie is expected to be sent
// to only another page in this host.
});
}

Expand Down

0 comments on commit b0026c9

Please sign in to comment.