Skip to content

Add New User Sign Up Feature #22

@t83714

Description

@t83714

Add New User Sign Up Feature

Image

Image

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 code query parameter
      • this link will be supplied via confirmation email
  • 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
    • 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 email
        • password: user select password
      • 200 status code successful response: JSON with the following fields:
        • isError: false
    • GET api/sign-up
      • this API can be used to retrieve sign up record information. anonymous users 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 email
        • creation_time: the record creation time. String. ISO 8601 format
        • is_complete: whether the sign-up is complete
        • last_confirmation_email_sent_time: when the last confirmation email was sent. String. ISO 8601 format
        • wait_time_before_resent: INT. no. of seconds before the user can re-send the confirmation email.
    • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions