Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
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.

  1. Once user clicks, internally user will check existence of the user in the diksha
  2. If found then user will be directly taken to the Diksha portal, through trampoline update.
  3. If not found, then we will invoke the user sing-up process, by reading the data from existing JWT token.
  4. OTP will be generated and sent to user's mobile phone. OTP Generation will be taken care by Design for One time password (OTP)
  5. On diksha user will be redirected to Enter OTP - for first time login.
  6. On successful OTP validation, user will be created within Diksha and user will be logged into the platform.


Code Block
languagejs
titleCreate 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:

  1. 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.)
  2.  Does system need to generate password for Google signup user? (As per discussion , no need to generate password.)
  3. 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.)
  4. What will happen if some old Google user won't have firstName or name itself?
  5. There might be scenario user already exist but his status is deleted? (As per discussion, user creation will fail.)
  6. Do we need to carry loginId as well?
  7. In Old implementation during user create we have to send phoneVerified as true?

...