PyGrid-deprecated---see-PySyft- icon indicating copy to clipboard operation
PyGrid-deprecated---see-PySyft- copied to clipboard

Add JWT support for FL workflow

Open cereallarceny opened this issue 6 years ago • 4 comments

As per the new authentication workflow in https://github.com/OpenMined/PyGrid/issues/445, we need to allow PyGrid's FL workflow to be extended via some sort of oAuth 2.0 token check.

In short, the following will need to happen:

Situation 1 - no auth required

  1. The worker sends a request to be assigned a worker_id
  2. PyGrid checks for the existence of an oAuth setup and finds nothing
  3. Continue to Condition - success

Situation 2 - auth required

  1. The worker sends a request to be assigned a worker_id and also passes an authentication token (in the request payload: auth_token)
  2. PyGrid checks for the existence of an oAuth setup and finds one
  3. PyGrid passes the value from auth_token to a method on the oAuth setup for validation of authentication tokens a. Assuming the token is valid, continue to Condition - success b. Assuming the token is invalid, continue to Condition - invalid

Situation 3 - auth required, no token

  1. The worker sends a request to be assigned a worker_id and DOES NOT pass an authentication token
  2. PyGrid checks for the existence of an oAuth setup and finds one
  3. Continue to Condition - not found

Condition - success Create a worker_id and send it back to the worker that made the authentication request

Condition - invalid Do not create a worker_id and inform the user of their mistake (see issue #445)

Condition - not found Do not create a worker_id and inform the user of their mistake (see issue #445)


As for how this oAuth middleware should work is open to discussion. Quite frankly I don't have a ton of experience here, so I'll be relying on the wisdom of others. We simply need to extend PyGrid to have some way of validating authentication tokens that are passed by a worker and correspond to some specified third-party oAuth service.

cereallarceny avatar Feb 26 '20 17:02 cereallarceny

I'll get this one! :)

IonesioJunior avatar Mar 03 '20 13:03 IonesioJunior

@IonesioJunior I'm going to get @Prtfw to work on this one.

cereallarceny avatar Mar 17 '20 13:03 cereallarceny

issue for tests: https://github.com/OpenMined/PyGrid/issues/541 (currently in progress)

Prtfw avatar Apr 28 '20 12:04 Prtfw

I'm going to close this since we're only testing now.

cereallarceny avatar May 31 '20 14:05 cereallarceny