WSO2 is now Choreo LabsLearn more

Trusted AI Governance
Build

Create agents and AI apps with the tools and languages your teams already use.

Connect

Link agents securely to your APIs, data, models and business systems.

Run

Deploy, observe and operate agents and AI apps reliably at any scale.

Govern

Control identity, access, cost and policy for every agent in production.

Agent Management

Developer Platform

  • API Management Cloud

    Design, secure and publish APIs with governance and analytics built in.

    Sign Up Now
  • Integration Cloud

    Connect apps, data and AI agents with low-code and pro-code integration.

    Sign Up Now
  • Identity & Access Management Cloud

    Secure sign-in and access for customers, partners, workforce and agents.

    Sign Up Now
  • Agent Management Cloud

    Build, run and govern AI agents with full visibility and control.

    Sign Up Now
  • Developer Platform Cloud

    Ship cloud-native apps faster on an internal developer platform.

    Sign Up Now

Self-Hosted

Full control over your stack. Deploy directly to your own servers, bare metal, cloud, or Kubernetes environment. Your data never leaves your perimeter.

Product Downloads
Choreo Labs
AI Governance
Platform
Solutions
Resources
Blog

Authorization code grant with PKCE to invoke your APIs via mobile/single-page applications

Public clients, such as mobile or single-page applications, are bound to encounter security threats when requesting access tokens over Authorization Code flow alone. This is because mobile apps cannot securely store a client secret. Decompiling the mobile app will reveal the client secret. Another security challenge is that authorization code can be intercepted by third-party applications. When it comes to single-page apps, such apps cannot securely store a client secret because their entire source is available to the browser.

To mitigate these security threats, OAuth 2.0 recommends Proof Key for Code Exchange (PKCE) as an extension to the authorization code flow to securely perform access token exchange using public clients.

WSO2 API Cloud has inbuilt support for the authorization code grant with PKCE security standard, which allows you to focus only on the implementation aspect of your mobile/single-page application. Thus, you can securely consume your WSO2 API Cloud APIs via mobile/single-page applications.

We have written a sample cross platform Flutter-based mobile application to demonstrate how you can securely invoke an API through WSO2 API Cloud with PKCE. Do take a look at our documentation to find out more details and try out the sample.

Why is it worth trying out the sample?

The sample demonstrates the end-to-end flow of how you can securely invoke your WSO2 API Cloud APIs via a simple mobile application. You only have to improve your mobile app to cater to your business requirements after trying out the sample.

If you are a single page application developer, you can grab the complete security flow by going through the GitHub README.