Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6732425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:38:58+00:00 2026-05-26T10:38:58+00:00

Atk4 has basic login functionality and I could build it out to add user

  • 0

Atk4 has basic login functionality and I could build it out to add user registration, forgotten password link, email verify etc using atk4, tmail templates and so on. But if I want to integrate it with an existing open source application that already provides that functionality, what do I need to do to allow that systems login to be allowed so that atk4 protected pages can be viewed after login on the third party app?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:38:59+00:00Added an answer on May 26, 2026 at 10:38 am

    There are four alternatives.

    Separate sites, separate domains, separate servers, separate database

    The most secure way to do that is by passing secure token from the other system to Agile Toolkit. The token should contain the username and hash of some secret passphrase along with that username $user.":".md5($secret.":".$user)

    You can check the argument inside API Class:

    $this->auth=$this->add('YourAuth');
    
    if($_GET['login_token'])){
        list($user,$token)=explode($_GET['login_token']);
        if(!verify_token($token))throw $this->exception('Break-in attempt');
        $this->api->auth->login($user);
    }
    
    $this->auth->check();
    

    Separate site, domain, but same user access

    You would need to build same encryption in Agile Toolkit Auth class. Fortunately you can easily do that, by re-defining encryptPassword

    class MyAuth extends SQLAuth {
        function encryptPassword($password,$salt=null){
            return ....
        }
    }
    

    If you need different connection to database you can also add:

       function init(){
           parent::init();
    
           // Ouch, last occurrence of static method use!
           $newdb=DBLite::connect(
               $this->api->getConfig('user_dsn'));
    
           $this->db=$newdb->dsql();
       }
    

    Sharing session – same domain and same computer, but no code access

    Agile Toolkit uses the Application’s realm as a name. That’s the argument you specify to the constructor when you create your app instance inside index.php:

    $api=new MyFrontend('myrealm');
    

    You would need to call

    session_name('myrealm');
    session_start();
    

    Then you need to set the session variable, something like myrealm_MyAuth_info, you can probably get this by dumping contents of $_SESSION from Agile Toolkit. You need to set it to something like array(‘user’=>’john’), as long as it’s not “false” anything is ok.

    Sharing computer, domain, session and some code

    This is similar to previous approach, but it should be easier to do:

    include 'yourapp/atk4/loader.php';
    include 'yourapp/lib/Frontend.php';
    $api = new Frontend();
    $api->auth->login('john');
    

    This assumes that your “Frontend” class properly sets the “auth”. If this does not work, some tweaks might be needed, for example you might want to move $auth->check() into initLayout() function, if you are calling it from within API.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does ATK4 supports LDAP authentication? I would like to query LDAP and automatically add
I want to know if it's possible to add an Iframe Element in ATK4
i've a question about atk4 MVCgrid, my db table doesn't have a field called
I'm building a buffet menu list form which has a lot of options for
I am developing a website using ATK4, a php framework with jquery . I
The last remaining part of my original application that doesnt use atk4 is the
Just started fumbling with ATK4. I'd like to use it both as a backend
Fatal error: Class 'h1' not found in /home/iracersr/public_html/atk4/lib/AbstractObject.php on line 131 I have installed
I have a list of stories defined and, in another table, a set of
I am using git / github and by accident I have been committing into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.