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

  • SEARCH
  • Home
  • 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 9210893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:10:40+00:00 2026-06-18T01:10:40+00:00

EDIT Originally I thought Oauth2 is the way to go but maybe it is

  • 0

EDIT Originally I thought Oauth2 is the way to go but maybe it is not. I’ll leave that out of this question for now as it is confusing things.

I’m creating a mobile app (Android/iOS). I’d like the user to enter their credentials (user/pass) in the mobile device which would then get sent to my server (Joomla CMS) to verify the credentials and create/send a token. I don’t want to store the user/pass on the device just the token.

In addition this token needs to have a timeout to be refreshed when needed. Such as credentials have changed.

At this point I’m trying to figure out what the architecture of this will look like.

Are there any tutorials on how you can achieve this (ideally with Joomla)? Anything that someone could point me to?

  • 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-06-18T01:10:41+00:00Added an answer on June 18, 2026 at 1:10 am

    The end solution is to create my own Joomla component. Pretty much everything is in my controller. Not the final code but something like this will work.

    defined('_JEXEC') or die;
    jimport('joomla.application.component.controller');
    
    class FooauthController extends JController
    {
    function __construct() {
        // params
        $jinput = JFactory::getApplication()->input;
        $this->username = $jinput->get('user', '', 'STRING');
        $this->password = $jinput->get('password', '', 'STRING');
        $this->checkParameters();
    }
    
    private function checkParameters() {
        // datatype checks
    
        if ($this->username == '' || $this->password == '') {
            header('HTTP/1.1 400 Bad Request', true, 400);
        }
    
    }
    
    private function createToken() {
        // token generation - what Joomla does (just an example)
        jimport('joomla.user.helper');
        $salt   = JUserHelper::genRandomPassword(32);
        $crypted  = JUserHelper::getCryptedPassword($password, $salt);
        $cpassword = $crypted.':'.$salt;
        return $cpassword;
    }
    
    function execute() {
        // Get the global JAuthentication object
        jimport( 'joomla.user.authentication');
        $auth = & JAuthentication::getInstance();
        $credentials = array( 'username' => $this->username, 'password' => $this->password );
        $options = array();
        $response = $auth->authenticate($credentials, $options);
    
        // success
        if ($response->status === JAUTHENTICATE_STATUS_SUCCESS) {
            $response->status = true;
            echo json_encode($this->createToken());
        } else {
            // failed
            $response->status = false;
            echo json_encode($response);
        }
    
    }
    

    }

    This represents a component called com_fooauth. Now the native app will send a query like this:

    http://www.myhost.com/index.php?option=com_fooauth&user=username&password=pass&format=raw
    

    Kind of a short cut to put everything in the controller, but hopefully you get the idea.

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

Sidebar

Related Questions

Edit: original question below, but I revise it now that I have some code
EDIT: This post was originally specific to ASP.NET, but after thinking about it I'm
this is an edit of the original post now that I better understand the
(function() { //do stuff })(); EDIT: I originally thought this construct was called a
I originally thought this was a INotifyPropertyChanged/Binding issue because I'm not sure how to
EDIT 07/14 As Bill Burgess mentionned in a comment of his answer, this question
I'm debugging a fairly large project I've been working on (but did not originally
There seems to be variations to this question, but none seem to address the
edit: I completely rewrote the question as the original one didn't clearly explain my
EDIT: I was an idiot. I simply had an image that was vertically long,

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.