Project

General

Profile

« Previous | Next » 

Revision f1d53ae8

Added by Serghei Mihai about 9 years ago

on authentication set cookie secure and http only (#6554)

View differences:

ckanext/ozwillo_pyoidc/plugin.py
2 2

  
3 3
import ckan.plugins as plugins
4 4
import ckan.plugins.toolkit as toolkit
5
from ckan.common import session, c, request
5
from ckan.common import session, c, request, response
6 6
from ckan import model
7 7
import ckan.lib.base as base
8 8

  
9
from pylons import config, request
9
from pylons import config
10 10

  
11 11
import conf
12 12
from oidc import create_client
......
76 76
            toolkit.c.userobj = userobj
77 77

  
78 78
    def login(self):
79
        for cookie in request.cookies:
80
            value = request.cookies.get(cookie)
81
            response.set_cookie(cookie, value, secure=True, httponly=True)
82

  
79 83
        if 'organization_id' in session:
80 84
            g = model.Group.get(session['organization_id'])
81 85
            client = Clients.get(g)

Also available in: Unified diff