Meri Pehchaan Client Integration Document v1.1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Meri Pehchaan

JanParichay

Client Integration Document


For
MERI PEHCHAAN
(Single Sign-On)

Submitted by

National Informatics Centre


4th Floor, Block III, Delhi IT Park, Shastri Park
New Delhi – 110053
Website: www.nic.in

National Informatics Centre 1


Meri Pehchaan
JanParichay

DOCUMENT CONTROL
DOCUMENT NAME: Client Integration Document for Pehchaan.

DOCUMENT ID REFERENCE:

AUTHORIZATION:
Prepared By Reviewed By Reviewed By Authorized By
Name: Akshay Name: Prashant Name: Amit Kumar Name: Seema
Dhama Sharma Khanna
Designation: Sr. Designation: Project Designation: Scientist C Designation:
Content Writer Manager Scientist G

SECURITY CLASSIFICATION: Restricted

VERSION HISTORY:
Issue Date Effective Date Description
11-07-2022 V1.0

DISTRIBUTION LIST:
The following persons hold the copies of the documents; all amendments and updates to the document
must be distributed to the distribution list.
S.No. Name Location Document type
1 Amit Kumar NIC, New Delhi Soft copy
2 All Clients Soft copy

CONFIDENTIAL:
This document contains restricted information pertaining to the National Informatics Centre. The
access level for the document is specified above. The addressee should honor this access right by
preventing intentional or accidental access outside the access scope.

DISCLAIMER:
This document is solely for the information of the National Informatics Centre and should not be
used, circulated, quoted or otherwise referred to for any other purpose, nor included or referred to
in whole or in part in any document without our prior written consent.

National Informatics Centre 2


Meri Pehchaan
JanParichay

TABLE OF CONTENTS

Definitions, Acronyms & Abbreviations .......................................................................................... 4


Background ..................................................................................................................................... 5
Introduction ..................................................................................................................................... 5
Pre-Requisite ................................................................................................................................... 5
What JAN Parichay Provides.......................................................................................................... 6
Jan Parichay Integration Process .................................................................................................... 6
Login Process .............................................................................................................................. 6
Handshaking Process ................................................................................................................... 8
Token Validation Process ............................................................................................................ 9
Logout Process .......................................................................................................................... 11
Timeout Process ........................................................................................................................ 15
Additional Framework/API .......................................................................................................... 18
HMAC Generator ...................................................................................................................... 18
Encryption ................................................................................................................................. 19
Decryption ................................................................................................................................. 20
Client Framework Implementation ............................................................................................... 22
Running The Service..................................................................................................................... 23
Annexure A ................................................................................................................................... 24
Annexure B ................................................................................................................................... 26
Annexure C ................................................................................................................................... 27
Annexure D ................................................................................................................................... 28
Annexure E ................................................................................................................................... 29
Annexure F .................................................................................................................................... 30

National Informatics Centre 3


Meri Pehchaan
JanParichay

DEFINITIONS, ACRONYMS & ABBREVIATIONS

Terms Meaning

Service Name Name of the client service (client application)

Client Token / Local The identifier generated by the Jan Parichay-Meri Pehchaan
Token Id application after successful user authentication which is used to
identify usersession per application.
Browser Id Unique key to identify browser (set as a cookie in user’s
browser)
Encrypted String The string contains user attributes (JSON format) encrypted with
the service API key. Refer to Annexure C for UserAttribute
details.
Client Service Home URL Home URL of the client service.

Client Signature Hash generated using HMAC Algorithm

Client Session Id Any random number or session Id generated at client end

TTL/TID Time to live in milliseconds


(Ex: 1622544184996)

Session Id The unique key that identifies a user’s pre-login session (set as
a cookie in user’s browser)

Post Login Session Id The unique key that identifies a user’s logged in session (set as
a cookie in user’s browser)

National Informatics Centre 4


Meri Pehchaan
JanParichay

BACKGROUND

Jan Parichay is a single sign-on application designed to integrate NIC services under a single
authentication domain. It is a centralized session and user authentication service in which one set
of login credentials can be used to access multiple applications. The service authenticates user one
on one designated platform, enabling the user to use a plethora of services without having to log
in and logout each time. Once the user login to the Jan Parichay, all the services that comply with
the integration of JanParichay will be auto-logged in by sharing its session. It authenticates the user
forall the services and does authorization based on the rights given to the user so it eliminates
further authentication/authorization prompts when the user switches services during the same
session.

INTRODUCTION

 Clients interested in availing the service of the e-Authentication framework should initially
integrate their service with Jan Parichay.
 Client Integration Framework enables Jan Parichay to provide secure access to respective
backend services through a well-defined gateway service that is consistent across all
backend services, regardless of the service implementation.
 As a part of the framework, various services will be able to integrate with Jan Parichay
through offered Application Programming Interfaces (API) Web Service Interfaces
smoothly and conveniently without affecting the existing architecture of the running
services.

PRE-REQUISITE

 The client needs to submit the checklist mentioned in Annexure A.


 Verify connectivity to Jan Parichay application (Refer Annexure B)
 The client service developers must have ample knowledge of their client service
functionality (login/logout/timeout) and understanding of basic API functionality including
knowledge of technology Jargons like Session/Cookies/Encryption-Decryption.

National Informatics Centre 5


Meri Pehchaan
JanParichay

WHAT JAN PARICHAY-MERI PEHCHAAN PROVIDES

1. Auth Key - A 32 digit alphanumeric key generated per client application (client service)
Integrated with Jan Parichay. The service API key is used to encrypt data shared between
Jan Parichay and the client application as well as used to generate Hash based message
Authentication Code (HMAC).
2. Rest Auth Id - A 10 digit numeric key generated per client application (client service)
integrated with Jan Parichay. Rest Auth Id is used to map Service API key per client
application.
3. AES IV - An initialization vector (IV) is an arbitrary number that can be used along with a
secret key for data encryption.
4. Service Id – A random key which uniquely identify a service.

JAN PARICHAY INTEGRATION PROCESS

Client service needs to perform certain integration, which includes


 Login Process Note:
 Logout Process Before starting the integration process,
 Timeout Process configure and start the Jan Parichay client
 Token Validation Process service at Client service end. Refer to section
 Handshaking Process “CLIENT FRAMEWORK IMPLEMENTATION”

LOGIN PROCESS

Redirect Call

Client Service Jan Parichay


Redirect Call
User authenticates
using Parichay
credentials

Service
Homepage

National Informatics Centre 6


Meri Pehchaan
JanParichay

1. When the user tries to access the client service (https://vahan.nic.in/), the service should
check for service session validation by looking at the session cookie for the respective
client service domain.

a) If the service found the required session cookies, the user should be redirected to
the Service Home page.
b) If the service does not found the required session cookies or the session cookies
found are already invalidated previously by the server, the client service web server
should redirect the user to the Jan Parichay URL (As mentioned below).

https://JAN
URL PARICHAY_URL/v1/api/login?sid=ServiceId&tid=TimeToLive&
cs=ClientSignature&string=EncryptedClientSessionId

HTTP Method GET

Note
1. Client Signature (cs) is created by calling the HMAC Generator API (refer to
Additional Framework/API Section) and this API will generate the Hash of the
following string
“JanParichay”+tid+“https://JANPARICHAY_URL/v1/api/login”+sid
Ex: JanParichay1622544184996https://JANPARICHAY_url/v1/api/login5674523190

2. string is created by calling an Encryption API (refer to Additional Framework/API


Section) and this API will generate the encrypted version of Client Session Id.

2. If Jan Parichay doesn’t found any user session, the user will be asked for the credentials
followed by the Two-step verification (if enabled) on the Jan Parichay login page. After
successful user authentication, Jan Parichay calls HTTP redirect to the landing page of the
registered client service (As mentioned below) with Server Handshaking Id.

URL ClientServiceHomeURL?string=< Server Handshaking Id >

HTTP Method GET

National Informatics Centre 7


Meri Pehchaan
JanParichay

HANDSHAKING PROCESS

Client Service Jan Parichay

Jan Parichay
Client
API

1. After receiving the Server Handshaking Id, the client service should take the string from
the above URL and call the below-mentioned Handshaking API.

API http://JAN PARICHAY_CLIENT_URL/handshake

HTTP Method GET/POST

Note: Port is configurable

Request Parameters

Attributes Data Type Required Remarks

handshakingId String Yes Query Parameter


sid String Yes Query Parameter

Sample Request

National Informatics Centre 8


Meri Pehchaan
JanParichay

http://JAN
PARICHAY_CLIENT_URL/handshake?handshakingId=ServerHandshakingId&sid=Service
Id

Note
1. Success Response HTTP Status- 202 Accepted
2. Server Handshaking Id used in the above URL is received from Jan Parichay

Response Payload Format


a) Encrypted string, if string is found valid.
b) False, if string is invalid.

2. The client service needs to decrypt the encrypted string receivedinresponseofHandShakingAPI


by calling the Decryption API
3. Now, Client service can start their session using the user parameters. (Refer to Annexure C
for Parameters)

TOKEN VALIDATION PROCESS

Client Service Parichay

Jan Parichay
Client
API
1. Token validation is one of the mandatory API of the Jan Parichay application as it validates

National Informatics Centre 9


Meri Pehchaan
JanParichay

the user session throughout the Jan Parichay integrated services. If the user logout from
any of the client service other client services of Jan Parichay will not get to know that the
client has been logged out until or unless the client service has performed the token
validation.

2. Every time the user performs any functionality on client service, the client service must call
the below mentioned Rest API to validate the user session.

API http://JAN PARICHAY_CLIENT_URL/isTokenValid

HTTP Method GET/POST

Note: Port is configurable

Request Parameters

Attributes Data Type Required Remarks

clientToken String Yes Query Parameter


sessionId String Yes Query Parameter
Sid String Yes Query Parameter
browserId String Yes Query Parameter
Sample Request

http://JAN PARICHAY_CLIENT_URL/isTokenValid?clientToken=ClientToken&sid
=ServiceId&sessionId=6B1F1ECD-624B-D701-2980-
AF4DC93DEA60&browserId=125A72 DF-19FF-CED0-E084-25DB3A7B0655

Note
(A) Success Response HTTP Status- 202 Accepted

National Informatics Centre 10


Meri Pehchaan
JanParichay

Response Payload Format

Attributes Remarks
Status API Response Status
tokenValid Token Status
Sample Response Payload

{
"status":"success", "tokenValid":"true"
}

Note
1. Response status can be either "success" or "failure"
2. "tokenValid" key value is either "true" or "false"

LOGOUT PROCESS

Logout
Callback API

Client Service Jan Parichay

Jan Parichay
Client
API

National Informatics Centre 11


Meri Pehchaan
JanParichay

1. On clicking the Logout button on client service, the client service should first clear its session
and call logout URL.

https://JAN
URL PARICHAY_URL/v1/salt/api/client/logout?clientToken=ClientTok
en&sid=ServiceId&sessionId=SessionId&browserId=BrowserId&u
a=UserAgent&tid=TimeToLive&cs=ClientSignature

HTTP Method GET

Note
1. Client Signature (cs) is created by calling the HMAC Generator API (refer to
Additional Framework/API Section) and this API will generate the Hash of the
following string
“JanParichay”+tid+“https://JANPARICHAY_URL/v1/salt/api/client/logout”
+clientToken+sid+sessionId
Ex: JanParichay1622544184996https://JANPARICHAY_url/v1/salt/api/client/logout
02KHfU5XvGWs3i1ZaCxMxVy4hBFPEGs95674523190D1xCGuyfHPTpz5gpFK7
YXXgemLB91xcr11

2. If API is unreachable the client service should show the “Internal Server Error”
page to the user instead of redirecting back to Jan Parichay. In this case, refer to Jan
Parichay support for help.

2. The client service may also choose to call Jan Parichay logout API followed by re-direct URL.

API http://JAN PARICHAY_CLIENT_URL/logoutAll

HTTP Method POST

Note: Port is configurable

National Informatics Centre 12


Meri Pehchaan
JanParichay

Request Parameters

Attributes Data Type Required Remarks

clientToken String Yes Query Parameter


sid String Yes Query Parameter
sessionId String Yes Query Parameter
browserId String Yes Query Parameter

Sample Request

http://JAN
PARICHAY_CLIENT_URL/logoutAll?clientToken=ClientToken&sid=ServiceId&sess
ionId=6B1F1ECD-624B-D701-2980-AF4DC93DEA60&browserId=125A72 DF-
19FF-CED0-E084-25DB3A7B0655

Note
(A) Success Response HTTP Status- 202 Accepted

Response Payload Format

Attributes Remarks
status API response status
message Standard message

Sample Response Payload

{
"status":"success",
"message":"Respective
message"
}

National Informatics Centre 13


Meri Pehchaan
JanParichay

Note:
(A) Response status can be either "success" or "failure"

3. To validate the user session throughout the integrated services, Jan Parichay also uses Logout
Callback API provided by the Client Service. It sets a callback function to inform all the
integrated client services that the user has been logged out from one of the client services.

a) To use logout Callback API, client service needs to call the above Jan Parichay logout API
(provided in point 2).
b) Client should also create an API and expose it to Jan Parichay. Through this API, Jan
Parichay will inform the client service to end their session as Jan Parichay session has been
already logged out.

Request Parameters

Attributes Data Type Required Remarks

clientToken String Yes Query Parameter


sid String Yes Query Parameter
sessionId String Yes Query Parameter
browserId String Yes Query Parameter
ua String Yes Query Parameter
Sample Request Body

{"BrowserId":"","ClientToken":"","ServiceId":"","SessionId":"","UserAgent":""}

To know how to create service client API, kindly refer to Annexure E.

Note: Clients may either use Logout Callback API or Token Validation API to validate the session.

National Informatics Centre 14


Meri Pehchaan
JanParichay

TIMEOUT PROCESS

Redirect Call

Client Service Jan Parichay

Jan Parichay
Client
API

1. The session timeout for Jan Parichay is 12 hours. However, each client service can also
have its own session timeout.

2. If there is a session timeout of the client service, the client service should redirect the user
to the Jan Parichay password page via URL.

https://JAN
URL PARICHAY_URL/v1/salt/api/client/timeout?sid=ServiceId&tid=Ti
meToLive&cs=ClientSignature

HTTP Method GET

National Informatics Centre 15


Meri Pehchaan
JanParichay

Note
1. Client Signature (cs) is created by calling the HMAC Generator API and this API
will generate the Hash of the following string
“JanParichay”+tid+“https://JANPARICHAY_URL/v1/salt/api/client/timeout” +sid
Ex:JanParichay1622544184996https://JANPARICHAY_url/v1/salt/api/client/tim
eout5674523190

2. If API is unreachable the client service should show the “Internal Server Error”
page to the user instead of redirecting back to Jan Parichay. In this case, refer to Jan
Parichay support for help.

3. The client may also choose to call timeout API followed by re-direct URL.

API http://JAN PARICHAY_CLIENT_URL/timeout

HTTP Method GET/POST

Request Parameters

Attributes Data Type Required Remarks

clientToken String Yes Query Parameter


sid String Yes Query Parameter
sessionId String Yes Query Parameter
browserId String Yes Query Parameter
ua String Yes Query Parameter

Sample Request

http://JAN
PARICHAY_CLIENT_URL/timeout?clientToken=ClientToken&sid=test&sessionId=6B1F
1ECD-624B-D701-2980-AF4DC93DEA60&browserId=125A72 DF-19FF-CED0-
E084-25DB3A7B0655&ua=UserAgent

National Informatics Centre 16


Meri Pehchaan
JanParichay

Note
(A) Success Response HTTP Status- 202 Accepted

Response Payload Format

Attributes Remarks
Status API response status
Message Standard message
Sample Response Payload

{
"status":"success",
"message":"Respective
message"

Note:
(A) Response status can be either "success" or "failure"

National Informatics Centre 17


Meri Pehchaan
JanParichay

ADDITIONAL FRAMEWORK/API

HMAC GENERATOR

Hash-based Message Authentication Code (HMAC) generator uses Algorithms and secret key
to generate the HMAC

API URL http://JAN PARICHAY_CLIENT_URL/hmac


HTTP Method POST

Request Body
Attribute Data Type Required Remarks
HmacString String Yes Message Body
Note: Port is configurable

Request Body

{
"HmacString":"Jan Parichay18147832"
}

Note: Success Response HTTP Status- 202 Accepted

Response Payload Format


Attribute Remarks
status API response status

{
"status":"success",
"message":"Success message",
"data":{"signature":"HMAC
Sign"}
}

National Informatics Centre 18


Meri Pehchaan
JanParichay

message Standard message


Data Response Data Object
data.signature Generated HMAC Signature

Sample Response Payload

Note: Response status can be either "success" or "failure"

ENCRYPTION

Advanced Encryption Standard (AES) generator uses Algorithms with secret key and
initialization vector to generate the encrypted string.
Note: Port is configurable

API http://JAN PARICHAY_CLIENT_URL/encryption

HTTP Method POST

Response Payload Format

Attribute Data Type Required Remarks


AESString String Yes Message Body

Sample Request

"AESString":"Jan Parichay18147832"
}

Note: Success Response HTTP Status- 202 Accepted

Response Payload Format

National Informatics Centre 19


Meri Pehchaan
JanParichay

Attributes Remarks

Status API Response Status


Message Standard Message
Data Response Data Object
data.signature Generated HMAC Signature

{
"status":"success",
"message":"Success message",
"data":{"signature":"Encrypted"
}
}

Sample Response Payload

Note: Response status can be either "success" or "failure"

DECRYPTION

Advanced Encryption Standard (AES) generator uses Algorithms with secret key and
initialization vector to decrypt the encrypted string.
Note: Port is Configurable

API http://JAN PARICHAY_CLIENT_URL/decryption

HTTP Method POST

Response Payload Format

Attribute Data Type Required Remarks

National Informatics Centre 20


Meri Pehchaan
JanParichay

AESString String Yes Message Body

Sample Request

"EncryptedString":"sahdbhbshsah"
}

Note: Success Response HTTP Status- 202 Accepted

Response Payload Format

Attributes Remarks

Status API Response Status


Message Standard Message
Data Response Data Object
data.signature Generated HMAC Signature

Sample Response Payload

{
"status":"success",
"message":"Success message",
"data":{"signature":"Decrypted"
}
}

Note: Response status can be either "success" or "failure"

National Informatics Centre 21


Meri Pehchaan
JanParichay

CLIENT FRAMEWORK IMPLEMENTATION

Client Framework is packaged for deployment to support both Linux and Windows environments
including container platform. The following deployment packages are available,
1. Win64 Executable (JanParichayClient.exe)
2. Linux Executable (JanParichayClient)
3. Docker Image

The service is configured using the JSON configuration file (config.json). The configuration
parameters are given below:

Parameter Description
ClientServicePort The port on which the service is configured
within the application/web server.
This port must not be exposed outside the local
server.

ClientServiceHost The host of Client Integration Framework:


localhost

ServiceName Service Name assigned to client


ServiceId Service Id assigned to client
ParichayAPIBaseURL Parichay API URL as mentioned in Annexure B
Auth Key Auth Key provided to client

AES IV AES IV provided to client

Logging Whether wants to enable logs or not

LogLevel INFO/DEBUG

Note:
1. Executable file and config.json should be in the same directory
2. JAN PARICHAY CLIENT URL formed using ClientServiceHost:ClientServicePort as
mentioned in the above table
For Ex: 0.0.0.0:8082

National Informatics Centre 22


Meri Pehchaan
JanParichay

RUNNING THE SERVICE

Make sure the configuration file config.json is in the same folder as that of the JanParichay client
service

Linux
 Set executable permission in Linux environment
chmod +x JanParichayClient

 Run the service in foreground (to see the console logging)


./JanParichayClient

 Run the service in background


nohup ./JanParichayClient &

Windows
 Run JanParichayClient.exe to start the service

National Informatics Centre 23


Meri Pehchaan
JanParichay

ANNEXURE A

Requirements to Avail Jan Parichay

Sr. Requirements
No.
1. Name of the Service
*Name of the client application
2. Single Login/Multiple Login
*Single login services can be accessed only in Single browser at a time while multiple login
services can be accessed in multiple browsers (e.g. Chrome and Mozilla) at a time
3. Enforce Multi-Factor Authentication
Yes/No
*Should all users enforced for Multi-factor authentication by client service or not.
4. Force Multi-Factor Authentication
Yes/No
*Should all users forced for Multi-factor authentication by client service or not
5. Service Description
*A small description of the service which will be shown on the hover of the application
logo
6. Department Name
*Name of the Department the application belongs
7. Client Service Home URL
*Landing URL of the client application. User will be redirected back to this URL after
successful authentication from Jan Parichay
8. Client Service Login URL
*Login page URL of the client service. User will be redirected to this URL in case of any
error while accessing the service
9. Client Service Logout URL
*A re-direct Logout URL of the client service
10. Enforce Multi-Factor Authentication per user (If yes, mention user details as per
below format)
Primary mail Id, Role (Admin/HR/Department Head/Manager/Other), Multi-Factor
Authentication (Yes/No)

* Should a user enforced for Multi-factor Authentication by client service or not


11. Select Environment
Staging/ Pre-Production/ Production
12. Is the application enabled over https
Yes/No

National Informatics Centre 24


Meri Pehchaan
JanParichay

13. Is the application security audit cleared (Only for Production Environment)
Yes/No
If yes, share the Security Audit Certificate
14. Enforce Geofencing
Geofencing per user: Yes/No

Geofencing per service: Yes/No

* Should a service restricts access to a particular state or a country


15. Service owner details
 Name
 Email
 Mobile
16. Service State

Note: In case of adding any new parameter, kindly contact Jan Parichay support (Refer
Annexure D).

National Informatics Centre 25


Meri Pehchaan
JanParichay

ANNEXURE B

Verify Connectivity with Jan Parichay

Jan Parichay Jan Parichay Port Connectivity


Environment Domain s
(JAN PARICHAYURL)

janparichaystag.meripehchaan 443 telnet janparichaystag.meripehchaan.gov.in 443


Staging .gov.in
telnet apijanparichaystag.meripehchaan.gov.in 8081
Jan Parichay apijanparichaystag.meripe 8081
APIs hchaan.gov.in

Production https://janparichay.meripehch 443 telnet janparichay.meripehchaan.gov.in 443


aan.gov.in
https://apijanparichay.meri telnet apijanparichay.meripehchaan.gov.in 8081
Jan Parichay 8081
pehchaan.gov.in
APIs

Note: In case, IP or Port doesn’t respond, ask Network or Firewall team to check respectively.

MeriPehchaan Environment Domain IP

13.126.134.109
janparichaystag.meripehchaan.gov.in 3.6.1.236
13.235.201.65
Staging

apijanparichaystag.meripehchaan.gov.in 65.2.115.161

65.1.163.97
janparichay.meripehchaan.gov.in 52.66.159.237
13.126.138.174
Production
65.0.150.218
apijanparichay.meripehchaan.gov.in 43.204.48.64
43.204.208.212

National Informatics Centre 26


Meri Pehchaan
JanParichay

ANNEXURE C

User Attribute details in JSON

Key Value
firstName First Name
lastName Last Name
Email Email
mobileNo Mobile No
designation Designation
address Address
status User Account Status
userId User Id
parichayId Jan Parichay Id
ip IP
browserId Browser Id
ua User Agent
sessionId Post Login Session Id
clientToken Client Token
loginId Login Id
serviceAccessTime Time at which user accessed the service
verificationParameters User Role (If service has required)

Note: In case of adding any new parameter, kindly contact Jan Parichay support (Refer
Annexure D).

National Informatics Centre 27


Meri Pehchaan
JanParichay

ANNEXURE D

Jan Parichay Support

Contact Number 011-22902494

VoIP 7494

Email Id [email protected]

National Informatics Centre 28


Meri Pehchaan
JanParichay

ANNEXURE E

How to create Service Client API

Step 1: Fetch following keys from POST parameters:

a) ClientToken

b) ServiceId

c) SessionId

d) UserAgent

e) BrowserId

Example: {"BrowserId":"","ClientToken":"","ServiceId":"","SessionId":"","UserAgent":""}

Step 2: Fetch following parameters from request headers:

a) Signature

b) TTL

Step 3: Signature is created by calling the HMAC Generator API and this API will generate
the Hash of the following string

1605533336176http://JanParichaytesting1.dev.nic.in/logouttest.php8076123F37A50E
5D7F2447BDA702BA02B00C843B698844CCC747C51C08767E41E46C3C9D7E3A1892
6FF7CD1EBD89DEE28B141627DC39BB3E8BCAF9D09C5461CAservice1user.nknsp
@nic.in7B4D5923-7033-4439-C197-5FEB341224F48760AC52-AB5D-B11B-6F02-
2829260D445D
Here,
o 1605533336176 is Current Timestamp in microseconds (ttl).
o http://Jan Parichaytesting1.dev.nic.in/logouttest.php is Logout API URL.
o 8076123F37A50E5D7F2447BDA702BA02B00C843B698844CCC747C51C0876
7E41E463C9D7E3A18926FF7CD1EBD89DEE28B141627DC39BB3E8BCAF9D0
9C5461CA is Client Token
o service1 is Servicename
o [email protected] is Username
o 7B4D5923-7033-4439-C197-5FEB341224F4 is SessionID
o 8760AC52-AB5D-B11B-6F02-2829260D445D is BrowserID

National Informatics Centre 29


Meri Pehchaan
JanParichay

Step 4: Match the Client Hash with Server Signature:

a) If not matched, return "FAILURE" as API response.

b) If matched, return "SUCCESS" as API response.

National Informatics Centre 30


Meri Pehchaan
JanParichay
ANNEXURE F

API for registration of new ServicePlus system users to JanParichay:

https://JAN PARICHAY_API_URL/v1/serviceplus/user/registration
URL

HTTP Method POST

Header Parameters:

Attribute Data Type Required Remarks


Content-Type String Yes Message Body
RestAuthID String Yes Message Body
TTL String Yes Message Body
Signature String Yes Message Body

Note
Signature is created by calling the HMAC Generator API (refer toAdditional
Framework/API Section) and this API will generate the Hash of the following
String:

“JanParichay”+TTL+“https://JANPARICHAY_API_URL/v1/serviceplus/user/registration
”+ServiceId+Username+Password

Ex: JanParichay1622544184996https://api.janparichay.staging.nic.in
/v1/serviceplus/user/registrationServicePlusprashnat.nknsp@janparichay.gov.injksadjksdhskahdjkah
djahsdjksahdkjhaskd

National Informatics Centre 31


Meri Pehchaan
JanParichay

Request Parameters:
Attribute Data Type Required Remarks
ServiceId String Yes Message Body
Username String Yes Message Body
Password String Yes Message Body

Request Body

{
"ServiceId":"",
"Username":"",
"Password":"",
}

Note: Success Response HTTP Status- 202 Accepted

Response Payload Format


Attribute Remarks
status API response status

{
"status":"success",
"message":"Successfully
registered"
}

National Informatics Centre 32

You might also like