generated from magda-io/magda-auth-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Add New User Sign Up Feature
Technical Notes
- The magda-auth-internal will comes with default sign-up & complete sign-up screens (are supposed to be opened in popups). Those pages are only accessible when the sign up feature are enabled for this auth plugin. Can be accessed at:
- sign-up screen:
https://[your magda domain]/auth/login/plugin/internal/sign-up - complete sign-up screen:
https://[your magda domain]/auth/login/plugin/internal/complete-sign-up?code=xxxx- a valid sign code is required to supplied via
codequery parameter - this link will be supplied via confirmation email
- a valid sign code is required to supplied via
- sign-up screen:
- All operations should be done via API requests. And we need the following APIs.
- Apis are accessible at
https://[your magda domain]/auth/login/plugin/internal/api/* - POST
/api/sign-up- request body: JSON with the following fields:
email: the user's email address. A confirmation email (with a confirmation link) will be sent to this email address. A back-off time window apply. The user can only re-sent another confirmation email via this API after certain time (configurable. default to 90 seconds).
- 200 status code successful response: JSON with the following fields:
isError:false
- 400: bad request error: JSON with the following fields:
isError:true,errorCode:400,errorMessage: e.g. A confirmation email was sent recently. Please wait xx seconds before trying again.
- Any other non 200 status code: JSON with the following fields:
isError:true,errorCode:500,errorMessage: any relevant message
- request body: JSON with the following fields:
- POST
api/complete-sign-up- request body: JSON with the following fields:
code: a valid sign-up code generated by system and supplied via sign-up link in confirmation emailpassword: user select password
- 200 status code successful response: JSON with the following fields:
isError:false
- request body: JSON with the following fields:
- GET
api/sign-up- this API can be used to retrieve sign up record information.
anonymoususers can only retrieve sign-up record before it's completed. - query parameter
code: a valid sign-up code generated by system and supplied via sign-up link in confirmation email - 200 status code successful response: JSON with the following fields:
email: user sign-up emailcreation_time: the record creation time. String. ISO 8601 formatis_complete: whether the sign-up is completelast_confirmation_email_sent_time: when the last confirmation email was sent. String. ISO 8601 formatwait_time_before_resent: INT. no. of seconds before the user can re-send the confirmation email.
- this API can be used to retrieve sign up record information.
- this module should maintain sign-up related db schema in a seperate DB. DB schema version should be maintained using migrator similar to this one: https://github.com/magda-io/magda/tree/main/magda-migrator-authorization-db
- this plugin was created as a magda plugin. Repo README.md file include the information of installing this plugin with Magda deployment
- Apis are accessible at
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

