VOOZH about

URL: https://thenewstack.io/to-truly-secure-apis-go-beyond-api-keys/

⇱ To Truly Secure APIs, Go Beyond API Keys - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2022-07-05 07:59:05
To Truly Secure APIs, Go Beyond API Keys
contributed,sponsor-curity,sponsored,sponsored-post-contributed,
Security / Software Development

To Truly Secure APIs, Go Beyond API Keys

Validating the identity of requesting parties and standardizing the process with centralized trust is the best way to ensure critical information is safe.
Jul 5th, 2022 7:59am by Jacob Ideskog
👁 Featued image for: To Truly Secure APIs, Go Beyond API Keys
Feature image via Pixabay
Curity sponsored this post.

What is the most important lesson we can learn regarding API security?

Jacob Ideskog
Jacob is an identity specialist and CTO at Curity. Most of his time is spent working with security solutions in the API and webspace. He has worked on both designing and implementing OAuth and OpenID Connect solutions for large enterprise deployments as well as small startups.

Apart from that it should be of paramount concern for all modern enterprises, it’s my view that API security should revolve around identity. If companies fail to consider identity when securing APIs, they might find themselves victims of API attacks resulting in data loss and security breaches.

To approach this challenge, it’s essential to understand that not all API security measures are equally effective. There are several ways to approach API security, each with varying degrees of protection. I’ll discuss some of them below:

  • API keys and basic authentication
  • Token-based authentication
  • Token-based authorization
  • Centralized trust using claims

API Keys and Basic Authentication 

Many companies start their API security journey by using API keys. They verify API calls and use basic authentication. In this case, API keys are inserted in the header or body of the URL of the API request.

This method is still quite popular and widely used, but it has major drawbacks. First, API keys are easily compromised. Second, the API key verification doesn’t rely on the user’s identity at all; it just depends on machine-to-machine verification. While there are instances where API keys are sufficient, I’d recommend you consider increasing your security measures if this is how you protect your APIs.

Curity is a leading IAM and API security technology provider that enables user authentication and authorization for digital services. The Curity Identity Server is highly scalable, handles the complexities of the leading identity standards, making them easier to use, customize and deploy.
Learn More
The latest from Curity

Token-Based Authentication 

One way to level up your API security is by implementing token-based authentication. This means using access tokens for authentication. In this kind of implementation, access tokens determine the type of user, and privileged access can be established in environments where internal and external user separation is required.

Token-based authentication partially focuses on identity, since it’s part of the request, but this approach still has some vulnerabilities. First, privileged access is not necessarily soundproof — it can still be hacked, as anyone with a token might be able to modify the API since the privilege is not bound to the token. So, while access tokens can delineate the type of user, there is no way to determine permissions without writing custom code.

Token-Based Authorization 

This approach has obvious advantages in comparison to the previous methods. It involves not only token-based authentication but also OAuth-based authorization. This means that the requesting party is not only authenticated by answering the question “Who are you?” but also authorized and assigned certain privileges on what an entity is allowed to do.

One of the advantages of OAuth is the use of scopes. They can contain more valuable data and can be built more easily into a system than if statements. In addition, scopes can specify privileges, allowing you to create custom scopes tailored to your APIs.

However, token-based authorization is not free from issues even with identity in focus. Since the identity is built directly into the API, the logic errors might become a potential threat. Also, within a complex system, in which some API requests rely on other API responses, it becomes problematic if one API calls another failing API.

The scope is bound to the token but not to the user, so it still does not provide fine-grained authorization on a user level.

Practical tip: If you choose to follow the scope-only approach, spend extra time mapping out how the identity information is used and keep track of ALL the APIs — a big task but worth it.

Centralized Trust Using Claims 

The most evolved API security approach is establishing centralized trust with claims and — as an additional option — signed JSON Web Tokens (JWTs). If used correctly, this method safely addresses all the above issues.

JWTs are signed pieces of data used by OAuth flows to carry identity information. In addition, JWTs can be used to share scopes, which provide a logical grouping for claims. Claims are assertions containing a subject (about whom a claim is made), an attribute (a particular property about the subject) and an asserting party making a claim.

A claim can be made in plain text: “Jim is a father,” Alexa says. This claim can be trusted only if we trust Alexa. In the OAuth context, it would look like this: “Identity Provider X states that the User Y has attribute Z.” Your API should only put trust in the asserting party (the identity provider).

Instead of trusting attributes, it is far better to trust claims made by familiar parties. This way, the requesting party would first call the asserting party (or the issuer). The issuer returns data, signed with a private key, which is then sent to the replying party. As a result, the signature is verified with a public key, and the claim’s trust is established.

Practical tip: Follow the best practices of using JWTs and claims

Why Strong API Security Matters

Placing trust only in the issuer of tokens does not give a 100% guarantee that all APIs are protected. However, validating the identity of the requesting parties and standardizing the process with centralized trust is the best way to ensure that critical information is safe and the whole system is less vulnerable. It also means you can limit the need for custom code and decrease the risk of cascading trust issues due to failing API calls.

Without advanced security, APIs become vulnerable with a rogue key left in a GitHub repository, for example. As a result, API providers must make security decisions that safeguard the integrity of the entire platform.

Curity is a leading IAM and API security technology provider that enables user authentication and authorization for digital services. The Curity Identity Server is highly scalable, handles the complexities of the leading identity standards, making them easier to use, customize and deploy.
Learn More
The latest from Curity
TRENDING STORIES
Jacob Ideskog is an identity specialist and CTO at Curity. Most of his time is spent working with security solutions in the API and webspace. He has worked on both designing and implementing OAuth and OpenID Connect solutions for large...
Read more from Jacob Ideskog
Curity sponsored this post.
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Pragma.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.