...
Code Block |
---|
|
URI:
Method: POST
Request body:
{
"request": {
"firstName":"",
"email":"",
"loginType":"",
"verificationKey":"id_token in case of Google",
}
}
Response:
same as create user api
* This api will do following validation:
1. Make Google api call by appending verificationkey in URL as follows:
https://www.googleapis.com/oauth2/v3/tokeninfo?id_token={verificationKey}
2. once verified then it will make create user api call to create a user once user is created his/her email verified field will be true.
|
State sign-in
When user comes through state-portal, he/she will get a link to access Diksha portal.
- Once user clicks, internally user will check existence of the user in the diksha
- If found then user will be directly taken to the Diksha portal, through trampoline update.
- If not found, then we will invoke the user sing-up process, by reading the data from existing JWT token.
- OTP will be generated and sent to user's mobile phone. OTP Generation will be taken care by Design for One time password (OTP)
- On diksha user will be redirected to Enter OTP - for first time login.
- On successful OTP validation, user will be created within Diksha and user will be logged into the platform.
Code Block |
---|
language | js |
---|
title | Create user body |
---|
|
Create User api request body:
URI: v2/user/create
Method: POST
Request body:
{
"request":
{
"firstName":"name of user",
"phone":"valid phone number",
"username" : "auto-generated username",
"channel" : "rootOrgchannel value (Optional)"// if user pass it , it must be valid and user will be associated with this as "PUBLIC" role.
"organisationId": "",
"OTP":"entered OTP by user"
}
}
|
** Open Questions:
- What should be userName in this case? (As discussed username will be auto-generated - internally system will make sure that auto-generated username will be related to user and not very hard to remember.)
- Does system need to generate password for Google signup user? (As per discussion , no need to generate password.)
- Do we need to send any welcome email to user? if yes then what should be content? (As per discussion, for Google user creation no need to send any email.)
- What will happen if some old Google user won't have firstName or name itself?
- There might be scenario user already exist but his status is deleted? (As per discussion, user creation will fail.)
- Do we need to carry loginId as well?
- In Old implementation during user create we have to send phoneVerified as true?
...