Join our Newsletter — 33% off our NHI Course
Home› Guides› How Apps Talk to Servers for Beginners: Front…
Guide Web & API Security

How Apps Talk to Servers for Beginners: Front End, Back End and the Keys and Tokens in Between

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 1 December 2026 10 min read
On this page

Apps talk to servers by sending short request messages over the internet and getting reply messages back.

This guide is for anyone who uses apps and websites and wonders what happens behind the screen. You do not need to code. If your business has an app, a website or tools that connect to each other, they all work this way.

In short

  • The part you see is the front end, or client. The part that does the work out of sight is the back end, or server.
  • They talk by requests and responses, using rules called HTTP.
  • Many requests carry a key or token that proves the caller may get in.
  • When software holds those keys and tokens, it is a non-human identity, so keep them secret, limited and owned.

What you will learn

  • Explain the difference between a front end and a back end.
  • Describe what a request and a response contain.
  • Spot where an API key or token travels in a request.
  • Check where your own apps keep their keys.
What you see (front end or client)
the app or web page on your screen that sends requests.
What works out of sight (back end or server)
the computer that receives requests, does the work and replies.
Pass for software (token)
a secret that software shows to prove it may use a service.

What is the client-server model?

Think of a shop with a counter at the front and a stockroom at the back. You speak to the person at the counter. They fetch what you asked for from the stockroom and hand it over.

Apps work in a similar way. The app on your phone, or the page in your browser, is the front end, also called the client. The computer that holds the data and does the work is the back end, also called the server.

They talk using a set of rules called HTTP. The client sends a message called a request, and the server sends back a message called a response [1]. The request is always started by the client, never by the server [1].

Where the comparison stops working: a shop worker can see your face. A server usually sees only the message and any key or token inside it. If the key is right, it may answer whoever sent it.

Why does it matter?

Every request that reaches private data needs some proof of who is asking. That proof is often a key or token, and those can be copied.

If you own a small business app

What could happen: a payment key is built into the app on customers' phones, where someone can dig it out.

Check this: ask your developer whether powerful keys stay on the server, not in the app.

Next: API Keys for Beginners

If you connect tools together at work

What could happen: a token you paste into an automation tool has full access and never expires.

Check this: choose the narrowest access the tool offers, and note who owns the token.

Next: APIs for Beginners

If you are new to IT work

What could happen: you copy a request with its token into a support ticket, and many people can read it.

Check this: remove keys and tokens before sharing any request or log.

Next: API Security for Beginners

What does it look like?

Here is a made-up request from a shop app and the server's reply, simplified.

Example only. All values are made up.

REQUEST from app
GET /orders/0001                                (1)
Host: api.example.invalid                       (2)
Authorization: Bearer EXAMPLE-TOKEN-0000-FAKE  (3)

RESPONSE from server
200 OK                                          (4)
{"order": "0001", "status": "FAKE - sent"}      (5)
  1. The method and path: "get order 0001".
  2. Which server the request is for.
  3. In a real message, this line would contain a token. It proves the caller may see the order.
  4. A status code. 200 means the request worked.
  5. The data sent back.

Why this is risky: anyone who copies the token may be able to send the same request.

The safer way: send requests only over HTTPS. Use short-lived tokens with narrow access. Keep tokens out of tickets and chats.

How does it work?

  1. You tap or click. The front end turns your action into a request. A request names a method, such as GET to fetch or POST to create, and the path of what it wants [2].
  2. Proof is added. If the data is private, the request carries proof, often in a part called the Authorization header [3].
  3. The server checks and works. The back end checks the proof, then fetches data, often from a database, and builds a reply [2].
  4. A response comes back. It carries a status code, such as 200 for success or 404 for not found, and usually some data [2].
  5. The front end shows it. You see your order, without seeing the server behind it.
Diagram titled How an app talks to a server, with four boxes in a row joined by arrows. Box 1, Front end: the app or web page on your screen. Box 2, Request: method, path and a key or token. Box 3, Back end: checks the proof, fetches data. Box 4, Response: status code and data. A dark note underneath says when software sends a key or token on its own, it is a non-human identity; keep keys on the server, use HTTPS, and give each key narrow access and an owner.
Figure 1. One round trip from the app to the server, and where the key or token travels.

The rules one program offers for others to call it are its API (application programming interface), a kind of contract between programs [4]. Servers also call other servers' APIs, such as a payment or email service. To do this on its own, a server uses an API key or token. That makes it a non-human identity (software with its own access).

Many tokens are "bearer" tokens. The standard that defines them says any party holding one can use it to get access [5]. The same standard says clients must always use HTTPS, or similar protection, when sending them [5]. One security guide also advises changing secrets regularly, so a stolen copy only works for a short time [6].

A worked example

Marek Quist runs a small online tea shop. His website has a front end where customers browse, and a back end that stores orders and talks to a payment service.

A customer emails to say the site showed an error. Marek asks his developer to explain how the pieces fit together.

The developer draws three boxes on a page. The customer's browser is the front end. The shop's server is the back end. The payment service is another server that the back end calls with an API key.

Marek asks where that payment key lives. The developer checks and finds a problem. An old test page in the front end still has the key written into it. Anyone viewing that page's code could have copied it.

They fix it in order. First, the developer cancels the old key in the payment service and creates a new one. Once that change has taken effect, the old copy should no longer give access. Second, the new key is kept only on the back end, in a locked secrets store. The test page is removed.

Third, the developer gives the new key the narrowest access the payment service offers. Marek records himself as its owner, with a review date.

Finally, they check the payment service's records together. They see no payments they cannot explain, in the records available to them. Marek now knows that keys belong on the server, not in anything the customer's browser can read.

Myths and mistakes

What people thinkWhat is true
The server knows who is sending each request.It usually sees only the message and the key or token in it.
A key hidden inside an app is safe.Treat anything inside an app as readable. Keep powerful keys on the server.
HTTPS alone keeps a token safe.HTTPS protects it in transit. A token copied from a log, ticket or file can still be reused.
Only people use APIs.Servers, scripts and AI agents call APIs all the time, each with its own key or token.

What can I do this week?

  • Ask your developer to draw your app's front end, back end and the services it calls.
  • List the API keys and tokens your back end uses, and who owns each one.
  • Check that no powerful key is built into the app or web page.
  • Make sure every request that carries a key or token goes over HTTPS.

Checklist

  • We know which servers and outside services our app talks to.
  • Powerful keys are kept on the back end, not in the app.
  • Keys and tokens are kept in a locked secrets store.
  • Each key or token has a named owner.
  • Each key has only the access it needs.
  • All requests with keys or tokens use HTTPS.
  • Tokens are removed before requests or logs are shared.

Common questions

What is the difference between a front end and a back end?

The front end is what you see and touch: the app or web page. The back end runs on a server out of sight. It stores data, checks who may do what and sends answers back to the front end.

Is an API the same as a server?

No. The server is the computer that does the work. The API is the set of rules that says which requests it accepts and what it sends back. One server can offer several APIs.

What is a bearer token?

It is a token that works for whoever holds it, like a ticket with no name on it. That is why it should travel only over HTTPS, last a short time and never be pasted into chats, tickets or code.

Why are API keys called non-human identity credentials?

Because software uses them on its own, with no person signing in. The server trusts the key, not a face. Each key acts as the identity of the program holding it, so it needs an owner and limited access.

Where next?

Ready for the detail? Read the practitioner guide: API Security Guide. It goes further into authentication choices, access checks on each request, rate limits and monitoring.

Also useful:

Related NHI Mgmt Group resources: Non-Human Identities for Beginners, API Key Management Guide and API Keys vs OAuth Tokens Guide.

Key terms

Client-server model
A set-up where one system sends requests and another processes them and sends responses.
API
A defined set of rules that lets one system ask another for data or actions.
API key
A secret code that identifies a program when it calls an API; often long-lived, so it needs careful storage.
Access token
A credential that lets a client call a service for a limited time with set permissions.
Bearer token
A token that gives access to whoever holds it.
HTTP status codes
Three-digit numbers in a response that show whether a request worked.
HTTPS
The secure version of HTTP, which encrypts traffic between client and server.

Sources and further reading

  1. MDN Web Docs, "Overview of HTTP". https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Overview (accessed 1 Dec 2026).
  2. MDN Web Docs, "Client-Server overview", Learn web development. https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Server-side/First_steps/Client-Server_overview (accessed 1 Dec 2026).
  3. MDN Web Docs, "Authorization header". https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Authorization (accessed 1 Dec 2026).
  4. MDN Web Docs, "API", Glossary. https://developer.mozilla.org/en-US/docs/Glossary/API (accessed 1 Dec 2026).
  5. M. Jones and D. Hardt, "The OAuth 2.0 Authorization Framework: Bearer Token Usage", RFC 6750, IETF, October 2012. https://www.rfc-editor.org/rfc/rfc6750 (accessed 1 Dec 2026).
  6. OWASP, "Secrets Management Cheat Sheet", OWASP Cheat Sheet Series. https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html (accessed 1 Dec 2026).

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.