• Hi There,

    I would like to create a page(password protected) where the site owner could login to an external service with one click like email/facebook without having to provide login credentials and display that service in a modal box.

    Any plugin/service suggestions would be greatly appreciated!

    Thank you!
    Tony

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello ancuisle,
    you can do it by users username you can send it by query string, and if you want to do it for specific page then you need to put following code in page id if condition

    if($_GET[‘querystring’]){

    // Automatic login //
    $username = $_GET[‘querystring’];
    $user = get_user_by(‘login’, $username );

    // Redirect URL //
    if ( !is_wp_error( $user ) )
    {
    wp_clear_auth_cookie();
    wp_set_current_user ( $user->ID );
    wp_set_auth_cookie ( $user->ID );

    $redirect_to = user_admin_url();
    wp_safe_redirect( $redirect_to );
    exit();
    }
    }

    i hope that will work for you.

    Thread Starter ancuisle

    (@ancuisle)

    Thank you for taking the time to reply leadsoft!

    I was hoping to get a plugin to do this, at least the login to an external site with one click part.

    Have you find any plugin otherwise i can create plugin ??

    Thread Starter ancuisle

    (@ancuisle)

    I’m pretty sure one already exists for what I need to do and I don’t want to go the route of specifically creating a plugin for this. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘One click login to external site from link/button WordPress Page’ is closed to new replies.