Login to WBB from external page, API docs?

  • Looks like I found partial solution - externer Login - WCF 2.x / WBB 4.x
    Thanks for @MountainMaster @Josh and @sourcemaker :D

    See one bug here - if I will run login once more when I'm already logged in - it kicks me out...

    So now I'm able to login, still need to:
    - check online status
    - add ability to logout

    Would it be OK to check online status by calling wcf\system\WCF::getUser()->username ? As far as I see - if I'm logged - I got my username, and if I'm not logged - got nothing. Is it safe?

    Logout would be wcf\system\WCF::getSession()->delete(); ? Need to do some more actions here, delete cookies or something?

    Edited 5 times, last by PolUser (August 30, 2015 at 11:26 AM).

  • Additional question: if I will use methods written above to log in - are they limit login attempts? Is there any check which limit login attempts to avoid possible brute force attacks? Or I have to care about this on my own?

  • Thanks, I'm on WCF 2.1 :D This generates additional question:
    Is there any way to show user that it is temporary disabled because he exceeded login attempts?

    EDIT: Looks like time for which user is disabled can be configured and to get out faster from this lock user can solve captcha, so I deleted two questions from this post ;)

    Edited once, last by PolUser (December 27, 2015 at 2:11 AM).

  • I'm still fighting with this, I have working code, but I'm failing to login when I'm trying to run it from main domain.

    My situation looks like this:
    Board URL is: forum.example.com
    I want to login into board from main domain - example.com

    I created bridge which looks like this:

    This is saved ad t_login.php in forum.example.com main directory.

    If I run forum.example.com/t_login.php - I'm logged in, everything OK.

    But if I'm trying to do curl or file_get_contents from example.com (main domain) - I'm not logged in.

    Example of code which I'm trying to run.

    I want to add on main site login and password fields and Login button which will log me into forum from main website.

    Both example.com and forum.example.com are on the same physical machine, example.com is based on Laravel framework.

    Why I'm able to log in from forum.example.com but not from example.com with same method?

    Maybe I should change something in my code? loginManually is correct?

    I see no option to change cookies domain in WBB config to ".example.com"

    Please help :(

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!