2

eGov App SSO API v2


1 ) The exchange code is derived from the eGov app and is then transferred to the agency application that utilizes the Single Sign-On (SSO) functionality. To effectively simulate this particular scenario, you can employ your registered account within the eGov app alongside the partner code and partner secret, both of which are furnished by the eGov administrator.


2) The access token is a one-time encrypted string used to gain access to a specific resource API within the eGov system.

POST Generate Access Token

https://oauth.e.gov.ph/api/token

BODY FormData

partner_code

{{PARTNER_CODE}}

partner_secret

{{SECRET_CODE}}

scope

SSO_AUTHENTICATION

exchange_code

{{EXCHANGE_CODE}}

Example Request

curl --location 'https://oauth.e.gov.ph/api/token' \ --form 'partner_code="{{PARTNER_CODE}}"' \ --form 'partner_secret="{{PARTNER_SECRET_CODE}}"' \ --form 'scope="SSO_AUTHENTICATION"' \ --form 'exchange_code="{{EXCHANGE_CODE}}"'

Example Response

{ "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3N0Zy1zdXBlcmFwcC1zc28ub3VlZy5pbmZvIiwiaWF0IjoxNjg4Nzk1NTc0Ljg4ODU2LCJzY29wZSI6IlNTT19BVVRIRU5USUNBVElPTiIsInBjIjoiRVZJU0EiLCJ0a2kiOjEyLCJqdGkiOiJZVlZQWFg0RVlFNUo0IiwiZXhwIjoxNjg4Nzk5MTc0fQ.YQwnVizn0jjakThzAeQZeZcNGrNGSdDeWj9qiemWQOM" }

3 ) The SSO Athentication API is a powerful tool that provides single-sign-on functionality to in-app services. This API allows users to sign in to a variety of different services with a single set of credentials, improving the user experience and increasing security. By utilizing the SSO Athentication API, app developers can offer their users a seamless and secure way to access multiple services without the need for multiple logins.

POST SSO Authentication

https://oauth.e.gov.ph/api/partner/sso_authentication

HEADERS

Authorization

Bearer {{ACCESS_TOKEN}}

Example Request

curl --location \ --request POST 'https://oauth.e.gov.ph/api/partner/sso_authentication' \ --header 'Authorization: Bearer "{{ACCESS_TOKEN}}"' \ --header 'Cookie: cross-site-cookie=bar'

Example Response

{ "status": 200, "message": "OK", "data": { "uniqid": "MVPCBEUVCGPZR", "email": "[email protected]", "birth_date": "08/22/1999", "first_name": "JUAN", "middle_name": "DELA", "last_name": "CRUZ", "suffix": "JR", "gender": "MALE", "nationality": "FILIPINO", "photo": "https://samplephoto.com", "mobile": "+639123123123", "address": "123 Sample St. Quezon City", "street": "123 Sample St.", "barangay": "Doña Imelda", "municipality": "QUEZON CITY", "region": "NATIONAL CAPITAL REGION (NCR)", "province": "NATIONAL CAPITAL REGION (NCR)", "country": "Philippines", "postal": 1012, "address_line_2": "SAMPLE ADDRESS LINE 2", "barangay_code": "137404031", "province_code": "133900000", "municipality_code": "137404000", "region_code": "130000000", "country_id": 175, "foreign_address": "ALBERTA, CANADA", "passport": { "first_name": "JUAN", "middle_name": "DELA", "last_name": "CRUZ", "suffix": "JR", "gender": "Male", "birth_date": "08/22/1999", "passport_number": "SAMPLE-PASSPORT-NUMBER", "place_issued": "SAMPLE PLACE ISSUED", "expiry_date": "08/22/2024" } } }