You are not logged in.

Change Language:

Freelancer? Consultant? Check out: WorkTrail - Time Tracking made easy
Profile for yann247

Name yann247
Email Address n/a
Posts5
  • Re: Adding a http header to a request and redirecting
    Board » Django » Views
    I cannot put it in GET parameters because the server B can only be configured to look for a value either in the HTTP Header OR a cookie. (it's the Oracle Business Inteligence application, configured for Single sign on)

    So even though it is not django related you seem to have a lot of knowledge so maybe you can offer a suggestion.
    I have to redirect a user from my django application to this OBIEE server with either a special value in a cookie on in a header, what do you is the best (easiest) way to do it?

    Thanks a lot.
  • Re: Adding a http header to a request and redirecting
    Board » Django » Views
    I want from my django app on server A to redirect the user on server B. But server B only lets user in if there is a special header with a special value in the httprequest.

    I'm not a django guru so I tried that way.
    Obviously I was wrong.
    Do you know a correct way?

    thanks
  • Adding a http header to a request and redirecting
    Board » Django » Views
    Hello,

    I want, from server A (where my django application sits), to request server B with a certain Http header.

    I tried doing this in my view:
    response=HttpResponseRedirect('http://xxxxxxxxxxxxxxxxxxxx')
    response["myheader"] = header_value
    return response

    Unfortunately, when I check the headers with the firefox extension livehttpheaders, I see that server B doesnt get my header:

    POST /ssologin/ HTTP/1.1
    Host: localhost:8778
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.13) Gecko/2009073022 Firefox/3.0.13 (.NET CLR 3.5.30729)
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Connection: keep-alive
    Referer: http://localhost:8778/ssologin/
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 35
    username=Administrator&password=sds
    HTTP/1.x 302 FOUND
    Date: Thu, 20 Aug 2009 14:12:01 GMT
    Server: WSGIServer/0.1 Python/2.3.7
    MYHEADER: Administrator <--- my added header
    Content-Type: text/html; charset=utf-8
    Location: http://SERVER_B:7777/index/
    ----------------------------------------------------------
    http://SERVER_B:7777/index/ <-- server B

    GET /analytics/saw.dll?dashboard HTTP/1.1
    Host: http://SERVER_B:7777
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.13) Gecko/2009073022 Firefox/3.0.13 (.NET CLR 3.5.30729)
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Connection: keep-alive
    Referer: http://localhost:8778/ssologin/
    Cookie: nQuireID=thro3n86c29v612sbdav8ubt2egs30kqkk8r9mqzOr07UFe9W00
    If-Modified-Since: Thu, 20 Aug 2009 14:06:59 GMT

    HTTP/1.x 200 OK
    Date: Thu, 20 Aug 2009 14:11:57 GMT
    Server: Oracle-Application-Server-10g/10.1.3.4.0 Oracle-HTTP-Server
    Content-Length: 1685
    Cache-Control: private
    Last-Modified: Thu, 20 Aug 2009 14:11:57 GMT
    Expires: 0
    Keep-Alive: timeout=15, max=100
    Connection: Keep-Alive
    Content-Type: text/html; charset=us-ascii

    Apparently the header is in the django response, but when the redirection occurs, it is not "passed" to the server B.

    Any idea how I can do that? thanks
  • Re: Creating a cookie and redirecting
    Board » Django » Views
    it is not possible to read or write cookies from another domain (with the exception of setting a cookie for a whole domain when the script is located on a subdomain) - this has nothing to do with django or python - it is a security measure enforced by HTTP
    So do you know how I can do?
    I have server A with a django app and server B with another app, looking for a specific cookie which I set in app A.
    Do you know how i can set up a cookie from app A?
    isnt there a work around? thanks
  • Creating a cookie and redirecting
    Board » Django » Views
    Hello,

    I'm trying, from my django application, to create a cookie for a certain domain and then redirecting the user to that domain.

    Here is the code I use:

    def myredirectview(request)
    response = HttpResponseRedirect('http://xx.xx.xx.xxxx:7777/subfolder/page.dll?info)
    cookie_args = { 'value': 'testvalue', 'max_age': settings.SESSION_COOKIE_AGE, 'path': '/subfolder', 'secure': false }
    response.set_cookie("USERNAME", **cookie_args)
    return response

    Now when I use the firefox extension "live http headers" I do see an instruction to create the cookie:
    Set-Cookie: USERNAME=testvalue; Domain=xx.xx.xx.xxxx; Max-Age=1209600; Path=/subfolder/;

    But when I check the cookies in firefox (Tools -> Options -> Privacy -> View cookies), my cookie doesn't appear.

    Any idea why is welcome

    thanks a lot


Powered by Sphene Community Tools