Skip to main content
ICT Authority, Kenya: OneAccess API Documentation home

Developer Documentation

OneAccess API

OneAccess publishes a standards-based OAuth 2.0 and OpenID Connect interface. A connected application sends users to OneAccess to sign in, receives tokens, and reads the signed-in user's approved claims. OneAccess answers who the user is and how they signed in; your application owns its own permissions and sessions.

Quick start

  1. Register an application in the Developer Portal. Sign in with an account that has Developer Portal access (membership of a developer group), choose the application type and list your exact redirect URIs.
  2. Obtain approved credentials. Production registrations need approval before a client secret is issued.
  3. Request a token with the flow your application type uses: Authorization Code with PKCE for sign-in, or Client Credentials for a back-end service.
  4. Make a first call. Send the access token to /connect/userinfo to read the user's approved claims.
  5. Handle the response. Branch on the OAuth error code, and log the correlationId from any failure.

Read the full Getting Started guide

Authentication

Authorization Code with PKCE

For an application that signs users in. Only the S256 challenge method is accepted. Used by Web registrations, which hold a client secret on the server.

Choose a flow

Client Credentials

For a back-end service that calls an API as itself. Service registrations authenticate with a client secret; there is no user and no ID token.

Request a token

The security schemes, scopes and per-operation requirements are in the API Reference. Public (single-page) client registrations are described in the Developer Portal documentation and are not covered by this reference.

API families

OneAccess documents an OAuth and OpenID Connect protocol surface. It does not publish a separate resource API.

  • Discovery

    Public metadata a client reads before it starts: the issuer, endpoint addresses, supported capabilities and the public keys that verify tokens.

    2 operations

  • Sign-in and sign-out

    Browser redirects that start an Authorization Code with PKCE sign-in and end the user's OneAccess session.

    3 operations

  • Tokens

    Server-to-server calls that exchange an authorization code, or a service client's credentials, for an access token, and that revoke a token.

    2 operations

  • User information

    Reads the approved claims of the user a bearer access token was issued for.

    2 operations

A first request

Request an access token for a service application. The values are placeholders; the full example in ten languages is in the guide.

curl --fail-with-body --request POST "API_BASE_URL/connect/token" \
  --user "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
  --data-urlencode "grant_type=client_credentials" \
  --data-urlencode "scope=YOUR_SCOPE" \
  --data-urlencode "resource=YOUR_API_AUDIENCE"

Illustrative only. Never place a real client secret in documentation, source control or a browser.

The Developer Portal

Application registration, redirect URIs, scope requests, credentials and approval workflows stay in the authenticated Developer Portal. They are not repeated here.