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 8385313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:38:19+00:00 2026-06-09T17:38:19+00:00

How can an application check if the user has the correct key? certificate and

  • 0

How can an application check if the user has the correct key? certificate and validate those requirements against those in the xero api? my current algorithm only checks the accessibility of what is required in-order to make an initial connection to the api but doesn’t necessarily check that information is valid.

//check for files/keys before running xero
function provideXeroConnection($request = 'xml'){
    //validate everything is inplace
    if(validateXeroAuth()){
        //if it is then bubble the object up to (XeroAc & JSONEngine or XMLEngine)
        return new Xero(XeroAuths::getSetting('xero_consumer'), XeroAuths::getSetting('xero_secret'), XERO_PUBLIC_KEY_PATH, XERO_PRIVATE_KEY_PATH, $request );
    } else return false;
/*
* @TODO validate xero authentication
*/
function validateXeroAuth(){
    $xero_key = XeroAuths::getSetting('xero_consumer');
    $xero_secret = XeroAuths::getSetting('xero_secret');
    if(file_exists(XERO_PUBLIC_KEY_PATH) && file_exists(XERO_PRIVATE_KEY_PATH)){
        if(validateValue($xero_key) && validateValue($xero_secret)){
            return true; //feature not completely implemented @TODO
        } else return false;
    } else return false;
}
//validate the value for xero
function validateValue($value){
    if(isset($value)){
        if(!is_null($value)){
            if(!empty($value)){
                return true;
            } else return false;
        } else return false;
    } else return false;
}

The script in use is opensource and is available at github here. I’ve also read the example implementation of the script here. But I haven’t really found anything for a quick authentication.

The reason I’m asking this.. is I’d much rather have my users keys and certificates authenticated in a couple of seconds rather than minutes (give and take how many invoices or contact information has to be recieved). Any help on this issue would be much appreciated! 🙂

  • 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-09T17:38:21+00:00Added an answer on June 9, 2026 at 5:38 pm

    The quick answer to your question is to do a GET Organisation call – if that fails with a 401, you know you have done something wrong.

    The long answer is: are you sure you should be using a private API application if you are getting users to authenticate? There are other application types that may be better suited to this scenario (I’ve made some assumptions so I may be wrong). This might help: API Application type guide.

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

Sidebar

Related Questions

How can i check that a user has input a url into the terminal
In my application I have the requirement to check if the user has paid
How can I check the status of an IIS6 application pool with C# ?
I wonder if my adobe air application can communicate with external hardware's API functions.
In my PHP application, I used UserName & Pwd and check the user table
The set-up: I have an android application that so far can register a user
i need to know is there any way to check that the user has
I can check user in active directory, if he exist then I give him
Possible Duplicate: How can I make my application check if Adobe flash player is
I have a facebook open graph application where the user can 'Read' (Action Types)

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.