Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add login example #62

Open
matchdav opened this issue May 13, 2014 · 5 comments
Open

Add login example #62

matchdav opened this issue May 13, 2014 · 5 comments

Comments

@matchdav
Copy link

I'd like a more straightforward way of passing webshot the session credentials, for example, I want to take a screenshot of a working document on save. Right now I just get a login screen.

Perhaps a working example of how to pass phantom the info.

@lukepolo
Copy link

I've done this , but it also relies on your framework to correctly take the cookie (aka if its encrypted)

Here is an example :

 var options = 
    {
    screenSize: {
        width: 1500
    },
        shotSize: {
            height: 'all',
            quality : 85
        },
        renderDelay: !req.query.delay ? delay : req.query.delay,
    phantomConfig: {
        'ignore-ssl-errors': 'true'
    },
    cookies: [
        {
        name: 'cookie_name',
        value: 'cookie_value',
        path: '/',
        domain: '.yourdomain.com'
        }
    ]
    };

@jhenriquez
Copy link

Hey @lukepolo @matchdav I've not been able to get this to work. Maybe you could give me some advice.

In my case passport is my framework. I'm setting the cookies but they're being ignored. I'm not sure how to dig what is going on, is passport ignoring the cookie? Could I be using the wrong cookie? Was any of you using passport when you got this working, if you did.

These are the options I'm using:

var options = {
      cookies: [
        {
          name: 'session',
          value: req.cookies.session,
          path: '/',
          domain: 'localhost'
        }
      ]
    };

Any advice will be greatly appreciated!

@lukepolo
Copy link

lukepolo commented Jul 9, 2015

So passport is probably using encrypted cookies, make sure your cookie that your passing is also encrypted

@jhenriquez
Copy link

Right now, I'm taking the cookies in the express request adding them to the
cookies array.

If it's encrypted should be encrypted there as well. I'll ask the passport
guys for advice.

Thanks!

On Thu, Jul 9, 2015, 9:32 AM Luke Policinski [email protected]
wrote:

So passport is probably using encrypted cookies, make sure your cookie
that your passing is also encrypted


Reply to this email directly or view it on GitHub
#62 (comment)
.

@lukepolo
Copy link

lukepolo commented Jul 9, 2015

Yah if its encrypted it should be encrypted there as well, since its basically simulating a client. You can actually grab the cookie from your browser and it should work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants