onaio / superset-patchup

Superset-patchup is a python package that "patches" Superset to add custom functionality that we find to be useful
https://canopyinsights.com
Apache License 2.0
8 stars 7 forks source link

Make a POST request to the user endpoint to fetch user profile details upon authorization. #46

Open JohnMwashuma opened 4 years ago

JohnMwashuma commented 4 years ago

Current requirement functionality


This functionality partially exists currently.

User Story


During ouath2 authorization with onadata, superset makes a GET request to fetch the user profile details on this endpoint api/v1/user.json. This is a problem because at the point of authorization, authentication credentials are usually stored in the master db before being synced to the read replica db, hence making a GET request will always go to the read replica db which at that point in time might not have the user's details. This results to a 401 error. The best way to handle this, is to make a POST request with no payload to the same endpoint, which will always go to the master db that will always have the user's credentials.

Proposed Implementation


Required Changes