Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] Collapse SP/CP/MyInfo login endpoints to new /api counterpart #1517

Closed
karrui opened this issue Mar 30, 2021 · 3 comments · Fixed by #1725
Closed

[API] Collapse SP/CP/MyInfo login endpoints to new /api counterpart #1517

karrui opened this issue Mar 30, 2021 · 3 comments · Fixed by #1725
Assignees
Labels
API API refactor
Milestone

Comments

@karrui
Copy link
Contributor

karrui commented Mar 30, 2021

This issue tracks the collapsing of /spcp, /myinfo related endpoints to their new /api/forms/:formId/auth counterparts.

The current /spcp routes require the client to pass in information such as the target endpoint, the current authType, and the esrvcId of the current form. However, all this information should be retrieved from the backend itself, and the new endpoint should only accept formId as a parameter, like the current /myinfo routes for consistency.

This also allows for the form's authType to be obtained from the form referenced by its id, which is the SSOT.

Collapsing all the various endpoints to just two endpoints (/redirect and /validate) also allows for less code to maintain and increases the consistency in the APIs.

The old endpoint should not be deleted for backwards compatibility (at least for a few weeks after the new endpoint has been released).

The current to new mapping is shown below:

# Existing endpoints New endpoints
(note that all routes are prefixed with /api/v3)
Description
20 GET /spcp/redirect
query: { target, authType, esrvcId }
GET /forms/:formId/auth/redirect redirect to SPCP endpoint to login
21 GET /spcp/validate 
query: { target, authType, esrvcId }
GET  /forms/:formId/auth/validate gets the spcp redirect URL and parses the returned page to check for error codes
22 GET /myinfo/redirect
query: {formId}
GET /forms/:formId/auth/redirect
23 GET /myinfo/validate
query: {formId}
GET /forms/:formId/auth/validate
@karrui karrui added the API API refactor label Mar 30, 2021
@karrui karrui added this to the API refactor milestone Mar 30, 2021
@seaerchin seaerchin assigned seaerchin and unassigned seaerchin Apr 1, 2021
@seaerchin
Copy link
Contributor

@karrui clarifications on this issue: this is actually a few things right?

  1. collapse spcp
  2. collapse myinfo
  3. migrate to new router

@seaerchin seaerchin assigned seaerchin and unassigned seaerchin Apr 13, 2021
@seaerchin
Copy link
Contributor

@karrui should we omit the formId query parameter since it is already part of the url path?

@karrui
Copy link
Contributor Author

karrui commented Apr 19, 2021

@karrui should we omit the formId query parameter since it is already part of the url path?

good point, yea no need thanks for the catch; but add persistantLogin query param, to be used by spcp auth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants