data.gov icon indicating copy to clipboard operation
data.gov copied to clipboard

add auth to flask admin app

Open rshewitt opened this issue 10 months ago • 3 comments

User Story

In order to secure the datagov harvesting admin app, datagov wants to authenticate the user to provide access.

Acceptance Criteria

[ACs should be clearly demoable/verifiable whenever possible. Try specifying them using BDD.]

  • [ ] GIVEN the harvest admin app
    WHEN a user requests the app
    THEN they must supply credentials to get access to the app \

Background

[Any helpful contextual notes or links to artifacts/evidence, if needed]

Security Considerations (required)

[Any security concerns that might be implicated in the change. "None" is OK, just be explicit here!]

Sketch

[Notes or a checklist reflecting our understanding of the selected approach]

rshewitt avatar Mar 27 '24 17:03 rshewitt

Flask basic auth? As an interim step, knowing eventual production requires login.gov

hkdctol avatar Mar 28 '24 20:03 hkdctol

  • Tested Flask basic auth with Flask-Login for a single username/password setup.
  • Created an application on the login.gov sandbox dashboard using localhost as the redirect URI, leading to a "redirect_uri not match" error.
  • Explored other public protocols like Auth0 and Keycloak, successfully found the root cause and resolved the redirect_uri error.
  • Encountered an acr_values error message from login.gov and currently investigating this issue.

Jin-Sun-tts avatar May 08 '24 15:05 Jin-Sun-tts

https://developers.login.gov/oidc/getting-started/

Switched from using the client_secret parameter to private_key_jwt. Now have the capability to log in using an ID card, and currently working on decoding the id_token.

Jin-Sun-tts avatar May 09 '24 16:05 Jin-Sun-tts

By testing with a simple Flask app, the login.gov authentication works successfully.

Now, working on the integration this into the current Flask admin app and ensure the user is registered and added to HarvestDB as well.

Jin-Sun-tts avatar May 28 '24 16:05 Jin-Sun-tts

@Jin-Sun-tts this depends on flask login integration. let's discuss this week

rshewitt avatar May 28 '24 17:05 rshewitt

Integrated with Flask admin app and tested on development. And changes were merged into main branch.

Jin-Sun-tts avatar Jun 10 '24 12:06 Jin-Sun-tts