Web User Auth API
The Web User Auth API allows Web User to carry out user authentication & authorization functions in the Web Portal.
Endpoints
# Endpoints
Login
This endpoint authenticates the user. It will return access token in the response body and refresh token in the header.
Request (EmailLoginDTO)
POST /web/auth/login
{
"email": "test@aritaone.com",
"password": "PasghWgf"
}
Response (AuthLoginResDTO)
{
"success": true,
"message": "",
"data": [
{
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyZGUwYjg3Ni1jNmM2LTExZWQtYTQ5Yy0wMjQyYWMxMjAwMDIiLCJleHAiOjE2NzkyODc3Mjd9.9c6BUnxi0Rruag2OCJKiHWquRf830Ma9yeI-atSH-TQ"
}
]
}
Refresh
This endpoint refresh the Web user's access token. Bearer Token is not needed while the "Cookie:refreshToken" must be included.
Request
GET /web/auth/refresh
Response (AuthLoginResDTO)
{
"success": true,
"message": "",
"data": [
{
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyZGUwYjg3Ni1jNmM2LTExZWQtYTQ5Yy0wMjQyYWMxMjAwMDIiLCJleHAiOjE2NzkyODc3Mjd9.9c6BUnxi0Rruag2OCJKiHWquRf830Ma9yeI-atSH-TQ"
}
]
}
Logout
This endpoint logout a user.
Request
DELETE /web/auth/logout
Response
{
"success": true,
"message": "",
"data": null
}
Send OTP
This endpoint triggers the one-time-password verification of four digits for email or phone.
Request (OtpReqDTO)
POST /web/auth/otp
{
"nature": 6,
"loginID": "test@aritaone.com"
}
Response (OtpResDTO)
{
"success": true,
"message": "",
"data": {
"otpToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcnkiOiIyMDI0LTA0LTIzVDA5OjA0OjQ1WiIsImxvZ2luSUQiOiJ0ZXN0QGFyaXRhb25lLmNvbSIsIm5hdHVyZSI6MX0.iTIbn6BUqsAAxLVrTSHYxkLV39ajcp8H-PL_KYb_3OI"
}
}
Login verify OTP
This endpoint verifies the one-time-password verification.
Request (OtpVerificationReqDTO)
POST /web/auth/login/verify
{
"otp": 37695,
"otpToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcnkiOiIyMDI0LTA0LTIzVDA5OjA0OjQ1WiIsImxvZ2luSUQiOiJ0ZXN0QGFyaXRhb25lLmNvbSIsIm5hdHVyZSI6MX0.iTIbn6BUqsAAxLVrTSHYxkLV39ajcp8H-PL_KYb_3OI"
}
Response
{
"success": true,
"message": "",
"data": {
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyZGUwYjg3Ni1jNmM2LTExZWQtYTQ5Yy0wMjQyYWMxMjAwMDIiLCJleHAiOjE2NzkyODc3Mjd9.9c6BUnxi0Rruag2OCJKiHWquRf830Ma9yeI-atSH-TQ"
}
}
Forgot password verify OTP
This endpoint verifies the one-time-password verification before setting password.
Request (OtpVerificationReqDTO)
POST /web/auth/forgot-password/verify
{
"otp": 37695,
"otpToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcnkiOiIyMDI0LTA0LTIzVDA5OjA0OjQ1WiIsImxvZ2luSUQiOiJ0ZXN0QGFyaXRhb25lLmNvbSIsIm5hdHVyZSI6MX0.iTIbn6BUqsAAxLVrTSHYxkLV39ajcp8H-PL_KYb_3OI"
}
Response
{
"success": true,
"message": "",
"data": {
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyZGUwYjg3Ni1jNmM2LTExZWQtYTQ5Yy0wMjQyYWMxMjAwMDIiLCJleHAiOjE2NzkyODc3Mjd9.9c6BUnxi0Rruag2OCJKiHWquRf830Ma9yeI-atSH-TQ"
}
}
Forgot reset password
Request (UserSetPasswordReqDTO)
PUT /web/auth/password
{
"password": "gdfhdjo33"
}
Response
{
"success": true,
"message": "",
"data": null
}
Resources
EmailLoginDTO
properties
email
stringrequiredemailThe login identification. This field can only be login email.
password
stringrequiredThe password length must be 6-40 uppercase and lowercase alphanumeric characters or the following special characters: @$!%?:&-_+=
AuthLoginReqDTO
properties
email
stringrequiredThe login identification. This field can only be login email.
password
stringrequiredThe login password
AuthLoginResDTO
properties
accessToken
stringrequiredThe access token is generated for the access to the JCCI resources
OtpReqDTO
properties
The nature of OTP.
loginID
stringrequiredThe login identification. This field can be login email or login phone. Login username is not supported in this method
OtpResDTO
properties
otpToken
stringrequiredToken is generated with expiry time, loginID and nature of OTP.The token generated for verification.
SetUserPasswordReqDTO
properties
oldPassword
stringrequiredThe old login password
password
stringrequiredThe new login password
ForgotPasswordReqDTO
properties
email
stringrequiredThe login email
ForgotPasswordResDTO
properties
otpToken
stringrequiredToken is generated with expiry time, loginID and nature of OTP.The token generated for verification.
OtpVerificationReqDTO
properties
otp
integerrequiredThe four-digit verification code.
otpToken
stringrequiredToken is generated with expiry time, loginID and nature of OTP.The token generated for verification.
UserLoginResDTO
properties
accessToken
stringrequiredThe access token is generated for the access to the JCCI resources
UserSetPasswordReqDTO
properties
password
stringrequiredat least 8 charsat most 40 charsonly letters, numbers and special characters are allowedat least one letterat least one numberThe login password. If password is not provided, it will be generated randomly by system.
OtpNature
Name | Value | Description |
---|---|---|
RESET_PASSWORD | 3 | The users need to verify their identity in the flow of "reset password" or "forgot password" |
UPDATE_EMAIL | 4 | The users update their own email or link the account to an email |
UPDATE_PHONE | 5 | The users update their own phone or link the account to a phone |
WEB_LOGIN | 6 | User for login to web portal |