Xilnex Auth Integration Guide

Xilnex Auth Integration Guide

Introduction

Xilnex Auth implements OAuth 2.0, a widely adopted authorization framework that enables secure access to protected resources by issuing access tokens to client applications. This document provides a comprehensive guide on how to use Xilnex Auth.

Terminology

TermDescription
ClientApplication
Public ClientApplication involves user interaction
Private ClientApplication without user interaction such as API
User / Resource OwnerEnd user
ResourcesData related to user or business
Resource ServerService where data is stored
Auth ServerService that authenticates and authorizes the client to access data
Grant TypesWays to get tokens from Auth Server
Authorization CodeA temporary code received by the client after the user successfully authenticates and authorizes the app, used to obtain an access token
ID TokenToken that contains user identity information
Access TokenToken that allows a client to access protected resources
Refresh TokenToken used to obtain a new access token if the current access token expires
JWTA type of token encoded in JSON format with claims, represented as a compact string consisting of a header, payload, and signature
Reference TokenA type of token that is non-readable and typically a randomly generated string, where the contents are not accessible or interpretable without validation by the authorization server
Client IDA unique identifier issued to a client application by the authorization server
Client SecretA secret value associated with the client ID, used to authenticate the client application during token requests
ScopeA set of permissions defined by the client, indicating the level of access the client has for accessing the protected resources
Redirect URIThe URL to which the user is redirected after authentication and authorization, where the authorization code or access token is sent (in the context of PKCE)


Auth Server Specifications

  1. The base address of Xilnex Auth is https://wb-api-auth-server.azurewebsites.net. [updated on 18 Sept 2026]
  2. Client ID and Client Secret are required to use any of the grant types.
  3. The default expiration time of an authorization code is 5 minutes.
  4. The default expiration time of an access token (JWT type) is 1 hour.
  5. The default expiration time of a refresh token (JWT type) is 30 days; however, it will be revoked upon user logout or password change, if applicable.
  6. For reference tokens, both the access token and refresh token will be revoked upon user logout or password change, if applicable.

Grant Types

OAuth 2.0 defines several grant types, which are different ways a client can obtain an access token.
Notes
Notes: Xilnex Auth currently only supports client credentials and JWT.

Client Credentials

The Client Credentials Grant type allows a client application to obtain an access token by using its own credentials, without involving a user. It is used in server-to-server communication.

Request

QuoteEndpoint: POST /connect/token
NameData TypeRequiredDescription
Content-TypeStringYesSet it to "application/x-www-form-urlencoded"

Request Body (application/x-www-form-urlencoded):
NameData TypeRequiredDescription
grant_typeStringYesMust be set to "client_credentials" to indicate the use of the Client Credentials grant type
client_idStringYesThe unique identifier of the client application that makes the request
client_secretStringYesThe secret value of the client application that makes the request

Example:
  1. curl --location 'https://wb-api-auth-server.azurewebsites.net/connect/token' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'grant_type=client_credentials' \
    --data-urlencode 'client_id=yourclientid' \
    --data-urlencode 'client_secret=yourclientsecret'

Response

If everything goes well, a 200 OK response will be returned, along with the following JSON data in the response body.

Response Body:
NameData TypeRequiredDescription
access_tokenStringYesThe access token issued by the authorization server
expires_inIntegerYesThe number of seconds until the access token expires
token_typeStringYesThe type of token issued specifies how the access token may be used. Always "Bearer"
scopeStringYesA space-separated list of scopes which have been granted with this token

Example:
  1. {
    "access_token": "<token>",
    "expires_in": 3600,
    "token_type": "Bearer",
    "scope": "coreapi"
    }


Access Token

To use the access token, include it in the following header in API calls:
NameData TypeRequiredDescription
AuthorizationStringYesValid access token following the format "Bearer <Access Token>"

Example: 
  1. curl --location 'https://wb-api-auth-server.azurewebsites.net/data' \
    --header 'Authorization: Bearer <token>'