-
Notifications
You must be signed in to change notification settings - Fork 4
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
Will authentication be implemented? How? #5
Comments
Open data will be shared over harvest-api. Search-api will include open data and also embargoed data, so will require login via umbrellaid/orcid which is from WP6. The WP6 slides are below |
This does not answer the question how this is going to be implemented. I assume that the Umbrella AAI is able to generate some sort of a token suitable to identify a user, although I don't know enough details to understand the mechanism. But then, there are still at least two possible options:
I assume that the second option would be more efficient, because verifying an authentication token is likely more costly then checking a session id from a simple db look up. I guess we would need some input from WP6 people here. |
Authentication will not be required. An authenticated session will have access to the embargoed data the user has access to. |
@RKrahl WP6 will provide us with a couple of protocols, primarily OpenIdConnect and SAML. For the WP3 API - I would stipulate that an Authorization header will be sent for endpoints that require authorisation.
This JWT token will contain the relevant scopes (user attributes). The API will validate this token against the authentication endpoint (the cost factor is negligible). For obtaining said token, the Data Analysis portal will provide the login endpoint using OpenId Connect and implicit flow (used for SPAs). |
If the API endpoint needs to do this for each request, I guess the costs will not be negligible. But ok, the solution might be to cache the validation result. Then it's an implementation detail in the API endpoint at the local metadata catalogue, so it doesn't need to be solved in the API itself. |
We can't cache the validation results. JWT tokens are issued with a short expiration time so that the application is forced to continually refresh them. Normally tokens are only valid for 5 minutes (keycloak default for example). JWTs are signed using a secret (with the HMAC algorithm). When a token is validated, there is no database lookup. The signature is verified against an issuer and checks the token has not expired. Required user information is stored in the payload (scopes). This information can be used to do further checks for authorisation (at the API level) EDIT: To clarify. authorisation requests could be cached but authentication requests cannot be. EDIT2: If we would like to have clients to use the API that are not going through a web interface i.e. like facebook when you want to create an app then we could consider using Oauth2, but that seems to be outside of the scope of the API for the moment. None of this has been confirmed for the moment. Just my two cents :) |
Will the Search API only expose open data or will some data require authentication? How will this be implemented? Will there be a token carried in the HTTP Headers?
(I suppose I have not understood what are Work Package 4's requirements for this API).
(Including @louise-davies and @agbeltran in the discussion)
The text was updated successfully, but these errors were encountered: