Number Verification - Authserver APIs (1.0.0)

Service Enabling Network Function API to verify that the provided mobile phone number is the one used in the device. It verifies that the user is using a device with the same mobile phone number as it is declared. It also makes it possible for a Service provider to verify the number itself by returning the phone number associated to the authenticated user's access token.

In this API phone number term refers to the mobile phone number

API Functionality

This enables a Service Provider (SP) to verify the phone number of the mobile device being used to access their service where the mobile device is accessing the service provider over a mobile network (WiFi connections are out of this API scope). This can happen either by getting the comparison result or receiving the phone number of the device that is used, so they can verify it themselves.

Resources and Operations overview

This API currently provides two endpoints where both require a 3-legged token and authentication via mobile network (excluding for example by SMS/OTP or user/password as an authentication method):

  • The first one checks if the user mobile phone number matches the phone number associated with the mobile device. It can receive either a hashed or a plain text phone number as input and it compares the received input with the authenticated user's phone number associated to the access token in order to respond true/false.
  • The next one retrieves the phone number associated to the user's token and returns it so the verification can be made by the service provider.

Sequence Diagram

Number Verification API uses the standard OAuth2 Authorization Code grant. The following diagram will help to clarify the end-to-end process, including previous steps prior to this API call.

UML Sequence Diagram

Additional details:

  • (1): Authentication must be automatic without any user interactions. Authentication methods such as SMS OTP or user/password are incompatible, as the goal is to validate the mobile phone number that is accessing the App. So it is required to be authentication via mobile network and without the user being involved. the use of parameter prompt=none, as described in OIDC Connect, ensures no user interaction.

  • (2): The way in which the phone_number is retrieved depends on the implementation. For example, access token may be a self contained encrypted JWT, so API can decrypt and identify phone_number. Some other implementations might request the phone_number associated to the token from Authserver.

Languages
Servers
Mock server
https://developers.opgw.u.com.my/_mock/number-verification/number_verification/
Testbed Authentication
https://silent-auth.u.com.my/
API Sandbox server (uses test data)
https://api-sandbox.opgw.u.com.my/

Auth Request

APIs to manage auth request details

Operations

Get Token

APIs to manage authentication details

Operations

tokenFrontendRequest

Request

The request to the token endpoint must be sent using the HTTP POST method and have parameters populated in accordance with the rules. In the token request, either the Authorization header or the client_assertion_type and client_assertion parameters must be provided.

Headers
Authorizationstring

“Basic “ + base_64_encode (client_id + “:” + client_secret)

Example: Basic d3lCOHF1R0RPWTdXTnUyVUV2eGF5Sk9aNVpTSU1KM1Y6V2ZHQUJqSUJpRDIySg==
x-correlatorstring

unique trace id to trace end to end system call

Bodyapplication/x-www-form-urlencodedrequired

The request to the token endpoint must be sent using the HTTP POST method and have parameters populated in accordance with the rules.

codestringrequired

Code value from fetch code API

redirect_uristringrequired

Redirect URI value to where user want to redirect. This has to be same as what is given in the auth request.

grant_typestringrequired

"authorization_code"

client_assertion_typestringrequired

This parameter commonly used in OAuth 2.0 and OpenID Connect protocols to specify the type of client assertion being used for authentication in a client-server interaction.

client_assertionstringrequired

The client_assertion is a security measure used in authentication processes, especially within OAuth 2.0 and OpenID Connect, to authenticate the client (such as a web application, mobile app, or service) to an authorization server.

code_verifierstring

"number-verification-service-provided-by-nabstract"

curl -i -X POST \
  https://developers.opgw.u.com.my/_mock/number-verification/number_verification/ac/auth-service/openIDConnect/deviceinitiated/v1/token \
  -H 'Authorization: Basic d3lCOHF1R0RPWTdXTnUyVUV2eGF5Sk9aNVpTSU1KM1Y6V2ZHQUJqSUJpRDIySg==    
' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'x-correlator: string' \
  -d code=string \
  -d redirect_uri=string \
  -d grant_type=string \
  -d client_assertion_type=string \
  -d client_assertion=string \
  -d code_verifier=string

Responses

OK If the token request is successfully completed (i.e. without error), an acess_token is returned by Gateway, in an HTTP 200 response in json payload with parameters.

Bodyapplication/json
access_tokenstring

OAuth 2.0 access_token used to gain access to the end-user information. This token CANNOT can be reused

Example: "dUk4Bs0qgKQKujbGxQDvIdXkI6Bz"
token_typestring

The timeout available to make a request to the token endpoint. i.e. The request must be made before the “expires_in” time is reached.

Example: "Always \"Bearer\""
expires_innumber(number)

Expiration time of the Access Token in seconds since the response was generated.

Example: 3599
refresh_tokenstring
Example: "eyJraWQiOiJ0ZXN0IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYeyJpc3MiOiJodHRwczovL2FwaXN0YWdpbmdyZWYuZGV2ZWxvcGVyLnZvZGFmb25l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wd7pp0HKzgd1G8xw", "id_token": "dUk4Bs0qgKQKujbGxQDvIdXkI6Bz" }

Phone number verify

API operation to verify a phone number received as input It can be received either in plain text or hashed format.

Operations