Browse code

Make csrf and session cookies httpOnly

Jordan Liggitt authored on 2015/05/15 16:23:06
Showing 2 changed files
... ...
@@ -19,6 +19,7 @@ func NewStore(maxAgeSeconds int, secrets ...string) Store {
19 19
 	}
20 20
 	cookie := sessions.NewCookieStore(values...)
21 21
 	cookie.Options.MaxAge = maxAgeSeconds
22
+	cookie.Options.HttpOnly = true
22 23
 	return store{cookie}
23 24
 }
24 25
 
... ...
@@ -256,7 +256,7 @@ func CreateOrUpdateDefaultOAuthClients(masterPublicAddr string, assetPublicAddre
256 256
 
257 257
 // getCSRF returns the object responsible for generating and checking CSRF tokens
258 258
 func getCSRF() csrf.CSRF {
259
-	return csrf.NewCookieCSRF("csrf", "/", "", false, false)
259
+	return csrf.NewCookieCSRF("csrf", "/", "", false, true)
260 260
 }
261 261
 
262 262
 func (c *AuthConfig) getAuthorizeAuthenticationHandlers(mux cmdutil.Mux) (authenticator.Request, handlers.AuthenticationHandler, osinserver.AuthorizeHandler, error) {