Skip to content
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

OIDC/OAuth2 authentication support #2

Closed
mrtamm opened this issue Jan 23, 2024 · 3 comments
Closed

OIDC/OAuth2 authentication support #2

mrtamm opened this issue Jan 23, 2024 · 3 comments
Assignees

Comments

@mrtamm
Copy link
Contributor

mrtamm commented Jan 23, 2024

At the moment, Funnel supports only Basic authentication (which is optional to configure).

  1. Add support for the API being protected as an OAuth2.0 resource server:
    • (is able to consume a Bearer access token in addition to Basic)
  2. Perform OAuth 2.0 Token Introspection (RFC: https://www.rfc-editor.org/rfc/rfc7662.html)
    • location = "GET issuer well-known endpoint"["introspection_endpoint"]
    • uses the client_id and client_secret that will be generated when service is registered into the AAI (so should be provided e.g. as ENV var or configuration option)
  3. To validate response, check at least following claims match:
    • the token is active (has not expired)
    • the token was issued by the configured OIDC service
    • audience: array contains funnel_id or the audience string equals funnel_id
      • funnel_id might be e.g. URL of the API, or the client_id (from config/param)
    • scope: contains "tes_api" value
  4. The command-line client needs to support providing the Bearer token.
@mrtamm
Copy link
Contributor Author

mrtamm commented Feb 3, 2024

Please review the associated pull-request: #3

@mrtamm
Copy link
Contributor Author

mrtamm commented Feb 15, 2024

Regarding the issue description, here is a sample configuration snippet to support it:

Server:
  OidcAuth:
    ServiceConfigUrl: "https://login.elixir-czech.org/oidc/.well-known/openid-configuration"
    ClientId: your-client-id
    ClientSecret: your-client-secret
    RequireScope: "tes_api ga4gh_passport_v1"
    RequireAudience: your-funnel-id

@mrtamm
Copy link
Contributor Author

mrtamm commented Feb 15, 2024

Development successfully merged to the master branch.

@mrtamm mrtamm closed this as completed Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant