How to automate login in Gmail?

0

Explanation:

I currently have a URL that informs Gmail user email:

  

link EMAIL & Passwd = password & null = Sign + in

But in this way, the Password is not loaded, just the Email .

Objective:

I would like a link where I can enter the Email and password, then log in automatically.

If this is not possible I would like a workaround.

    
asked by anonymous 28.02.2014 / 01:54

2 answers

1

You can create a server in Java or C ++ that plays the role of a proxy for the content of the email you want. This server must use the Google APIs to connect to the email service. Your WEB page can communicate with this server using WebSocket, JSONP, or AJAX with CORS enabled and in this case the request for this proxy can be in the format you want as long as you translate to the google API commands.

In this approach the customer must trust you and your architecture when passing the password because you could store it by breaking the security, but this can be negotiable.

    
07.03.2014 / 20:31
0

There is a better alternative today because Google has provided a scripting platform to run as a WEB application or linked to Google Drive documents. This solution is called Google Apps Script and is available at link .

See example below:

function doGet() {
    var app = buildApp();
    return app;
}

function myClickHandler(e) {
    var app = UiApp.getActiveApplication();

    var label = app.getElementById('statusLabel');
    label.setVisible(true);

    app.close();

    return app;
}

function buildApp() {
    var app = UiApp.createApplication();
    app.setTitle('criando aplicação')
    var button = app.createButton('Click Me');
    app.add(button);

    var label = app.createLabel('The button was clicked.').setId('statusLabel')
        .setVisible(false);
    app.add(label);

    var handler = app.createServerHandler('myClickHandler');
    handler.addCallbackElement(label);
    button.addClickHandler(handler);

    app.setTitle('aplicação criada com id ' + app.getId());

    return app;
}

You can see in this DOC that I wrote some more details.

This approach is better than the one I suggested earlier because Google Apps Script allows you to interact directly with GMail and the entire Google Cloud infrastructure.

    
07.05.2014 / 15:08