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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:58:13+00:00 2026-05-27T16:58:13+00:00

Am working with phil sturgeon REST_Controller for codeigniter to create a REST api, so

  • 0

Am working with phil sturgeon REST_Controller for codeigniter to create a REST api, so far i’ve been able to create a simple library for generating api keys for the users.
My problem is now sending the api key to the API for each request, how i do this without having to manually send it for every request.

  • 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-27T16:58:14+00:00Added an answer on May 27, 2026 at 4:58 pm

    You should look into request signing. A great example is Amazon’s S3 REST API.

    The overview is actually pretty straightforward. The user has two important pieces of information to use your API, a public user id and a private API Key. They send the public id with the request, and use the private key to sign the request. The receiving server looks up the user’s key and decides if the signed request is valid. The flow is something like this:

    1. User joins your service and gets a user id (e.g. 123) and an API
      key.
    2. User wants to make a request to your API service to update their email address, so they need to send a request to your API, perhaps to
      /user/update?email=new@example.com.
    3. In order to make it possible to verify the request, the user adds the user id and a signature to the call, so the call becomes
      /user/update?email=new@example.com&userid=123&sig=some_generated_string
    4. The server receives the call, sees that it’s from userid=123, and looks up the API key for that user. It then replicates the steps to create the signature from the data, and if the signature matches, the
      request is valid.

    This methodology ensures the API key is never sent as part of the communication.

    Take a look at PHP’s hash_hmac() function, it’s popular for sending signed requests. Generally you get the user to do something like put all the parameters into an array, sort alphabetically, concatenate into a string and then hash_hmac that string to get the sig. In this example you might do:

    $sig = hash_hmac("sha256",$params['email'].$params['userid'],$API_KEY)
    

    Then add that $sig onto the REST url as mentioned above.

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

Sidebar

Related Questions

I got the rest of the library working fully, just trying to generate api
I'm working on a new project where I want to use Phil Haack Areas
Working with an API where I need to send a value over in an
I have strictly followed the how-to article by Phil Sturgeon , to extend the
I've been spending some time looking at Phil Haack's article on Grouping Controllers very
Working on a end of the year project for school and chose to create
Working with an API that can handle multiple connections (i.e. sessions), each of these
I have been studying, playing with and working with ASP.NET MVC since Preview 1
Working on a simple poker script in PHP and need a way to determine
Working with a PHP library class, and I'd like to wrap all of its

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.