惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
博客园_首页
H
Help Net Security
博客园 - Franky
V
Visual Studio Blog
Jina AI
Jina AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
V2EX
宝玉的分享
宝玉的分享
酷 壳 – CoolShell
酷 壳 – CoolShell
J
Java Code Geeks
L
LangChain Blog
腾讯CDC
Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
C
Check Point Blog
博客园 - 聂微东
罗磊的独立博客
量子位
M
MIT News - Artificial intelligence
F
Fortinet All Blogs

Kreya Blog

Kreya 1.21 - What's New REST vs. gRPC - Which should You choose for your next API? The new HTTP QUERY method explained Kreya 1.20 - What's New The Hidden Cost of Cloud-First API Clients Testing REST APIs with Kreya How to call Google Cloud APIs with Kreya Getting Started with GraphQL in Kreya gRPC in the browser: gRPC-Web under the hood Postman vs Kreya Virtual Scrolling: Rendering millions of messages without lag Kreya 1.19 and 1.19.1 - What's New gRPC deep dive: from service definition to wire format Looking back on 2025 Transfering files with gRPC Catching API regressions with snapshot testing 5 Best API Testing Tools Kreya 1.18 - What's New Comparing the privacy of popular API clients Demystifying the protobuf wire format - Part 2 Import HAR Files in Kreya: Debug APIs & gRPC-Web
Calling Auth0 Secured APIs with Kreya
Justin · 2026-02-16 · via Kreya Blog

Securing your APIs with Auth0 is a smart move for production, but it often adds extra steps to the development and testing cycle. No one wants to spend their afternoon manually swapping expired tokens.

In this post, we'll show you how to use Kreya to automate the entire Auth0 handshake, allowing you to call secured endpoints effortlessly.

Setting up authentication in Kreya

One of the major benefits of Kreya is that authentication is built into the core of the app. Instead of manually adding headers to every request, you define an authentication configuration once and reuse it throughout your project.

Navigate in Kreya to the Project menu and select Authentications (or use the shortcut Ctrl++a).

The configuration in Kreya depends on the type of Auth0 Application you are using.

Get your Auth0 credentials

To configure the authentication in Kreya, you need to gather specific values from the Auth0 dashboard. You need values from your Application settings (who is asking for the token) and your API settings (what the token is for).

For the Application values, navigate in the Auth0 dashboard to Applications > Applications in the left-hand menu and select the application. This applies to all applications regardless of the type.

Auth0 M2M Application Settings

To get the audience value for your auth configuration, navigate in the Auth0 dashboard to Applications > APIs and select your API.

Auth0 API Settings

Machine to machine application (M2M)

This is used, if your API is being called by another backend service or a background worker. You don't require a user login with this type of application.

PropertyValue
TypeOAuth2 / OpenID-Connect
Grant typeClient credentials
Issuer#AUTH0_APPLICATION_DOMAIN (can be found in the Auth0 application settings)
Client Authorize MethodBasic
Client-ID#AUTH0_APPLICATION_CLIENT_ID (can be found in the Auth0 application settings)
Client-Secret#AUTH0_APPLICATION_CLIENT_SECRET (can be found in the Auth0 application settings)
Token-Type to authorize on APIsAccess-Token
Additional token parametersKey = audience, Value = #AUTH0_API_IDENTIFIER (can be found in the Auth0 Api Settings)

It should look similar to this:

Kreya Auth0 Backend API Config

note

You may have noticed that we use the environment variable {{ env.backend.clientSecret }} instead of inserting a raw value for the client secret.

This is a security best practice that prevents sensitive credentials from being accidentally committed to version control or shared with team members who shouldn't have access to it.

Single-page application

If you are developing a web frontend, which is built with Angular or React, you likely have a single-page application (SPA) set up in Auth0. SPAs are considered public clients, because they cannot securely store a client secret.

By using the Authorization Code flow, Kreya allows you to simulate a user's login eperience exactly as it would happen in your web app.

PropertyValue
TypeOAuth2 / OpenID-Connect
Grant typeAuthorization code
Issuer#AUTH0_APPLICATION_DOMAIN (can be found in the Auth0 application settings)
Client Authorize MethodNone
Client-ID#AUTH0_APPLICATION_CLIENT_ID (can be found in the Auth0 application settings)
Use native browserCheck (optional)
ScopeExample: openid profile email
Token-Type to authorize on APIsAccess-Token
Additional login parametersKey = audience, Value = #AUTH0_API_IDENTIFIER (can be found in the Auth0 Api Settings)

Kreya Auth0 SPA Config

note

We use the native browser to redirect the login. When Kreya attempts to authenticate, it will open your native browser (where you have access to locally stored credentials).

info

On redirect flows, ensure that the Kreya Redirect-URI is added in the Allowed Callback URLs in the corresponding Auth0 application.

Native application

If you are building a mobile or desktop application, you likely have a native application set up in Auth0 which uses the Authorization Code with PKCE flow.

In Kreya, the configuration for a native application is identical to the SPA setup. Kreya automically manages the PKCE handshake under the hood.

PropertyValue
TypeOAuth2 / OpenID-Connect
Grant typeAuthorization code
Issuer#AUTH0_APPLICATION_DOMAIN (can be found in the Auth0 application settings)
Client Authorize MethodNone
Client-ID#AUTH0_APPLICATION_CLIENT_ID (can be found in the Auth0 application settings)
Use native browserCheck (optional)
ScopeExample: openid profile email
Token-Type to authorize on APIsAccess-Token
Additional login parametersKey = audience, Value = #AUTH0_API_IDENTIFIER (can be found in the Auth0 Api Settings)

Regular web application

Unlike SPAs or native apps, a regular web application is considered a confidential client, because it runs on a server you control, allowing it to securely store a client secret.

In Kreya, this setup uses the Authorization Code flow. While it looks similar to the SPA setup, we need to provide the client secret and change the Client Authorize Method. This ensures that Kreya authenticates itself to Auth0 using your application's credentials during the token exchange.

PropertyValue
TypeOAuth2 / OpenID-Connect
Grant typeAuthorization code
Issuer#AUTH0_APPLICATION_DOMAIN (can be found in the Auth0 application settings)
Client Authorize MethodBasic
Client-ID#AUTH0_APPLICATION_CLIENT_ID (can be found in the Auth0 application settings)
Client-Secret#AUTH0_APPLICATION_CLIENT_SECRET (can be found in the Auth0 application settings)
Use native browserCheck (optional)
ScopeExample: openid profile email
Token-Type to authorize on APIsAccess-Token
Additional login parametersKey = audience, Value = #AUTH0_API_IDENTIFIER (can be found in the Auth0 Api Settings)

Kreya Auth0 Regular Web App Config

Invoking the request

To use an authentication configuration in Kreya, go to the Auth tab and select the configuration.

Kreya Auth Configuration Selection

To explicitly get a new Access-Token click the Update Button. If no token is present, it will fetch one when we send the request.

Kreya Auth Configuration Refresh

Depending on your authentication configuration, it will directly fetch the token or open your browser, where you can login with an authorized user.

If the retrieval is successful, Kreya displays the JWT and its expiry date directly in the UI. You don't need to re-authenticate for every request, Kreya caches the token and automatically includes it in the request.

You can click the icon to see the current JWT claims:

Kreya JWT Claims

In this example, we are calling a local API, which reads all user claims of the authenticated user and returns it.

Kreya Dotnet API Response

Pro tip: Set the auth per directory settings

Instead of manually assigning the authentication configuration to every single request, you can use Directory settings.

By setting the authentication at the directory level, all requests within that directory and its subdirectories will automatically inherit those credentials.

Kreya Auth Directory Settings

Conclusion

Testing secured APIs doesn't have to be a manual burden. By integrating Auth0 with Kreya, you can automate the complex OAuth2 handshakes and focus on what actually matters.

Whether you are working with machine-to-machine tasks or simulating complex single-page application user flows, Kreya's inheritance-based settings and automated token management make your development workflow faster and more secure.

Ready to try it out? Download Kreya today and start testing your secured endpoints.