jackson icon indicating copy to clipboard operation
jackson copied to clipboard

Use a standard HTTP response for the jackson service

Open niwsa opened this issue 3 years ago • 1 comments

Currently we send the response payload back as either json or plaintext. It would be better to standardise the format into JSON with defined structure for error and data. Eg:- Error

{
 "status": 400 
 "error": {
  msg: "Please provide a defaultRedirectUrl" , 
  description: "Jackson needs the URL to complete the IdP flow"
 }
}

Success

{
"status": 200
"data": {
      client_id: clientID,
      client_secret: clientSecret,
      provider: idpMetadata.provider,
  }
}

niwsa avatar Jan 19 '22 07:01 niwsa

UPDATE: This issue is mainly to standardise the error response sent out from jackson service. Endpoints /oauth/authorize and /oauth/saml handles most errors by redirecting to the client redirect_uri. The endpoints /oauth/token and /oauth/userinfo can follow the spec as listed below.

Token endpoint - https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 Userinfo endpoint - https://openid.net/specs/openid-connect-core-1_0.html#UserInfoError and https://datatracker.ietf.org/doc/html/rfc6750#section-3.1

niwsa avatar Jun 30 '22 17:06 niwsa