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

Support Auth extension #81

Open
MattFerraro opened this issue Jul 15, 2021 · 8 comments · Fixed by #439
Open

Support Auth extension #81

MattFerraro opened this issue Jul 15, 2021 · 8 comments · Fixed by #439
Assignees
Labels
funding needed help wanted Extra attention is needed
Milestone

Comments

@MattFerraro
Copy link

I have a dynamic STAC catalog that requires me to specify my auth token as a header, like:

curl https://api.me.com/my-catalog.json -H 'accept: application/json' -H 'authorization: Bearer my.jwt.token'

The JWT is required because the catalog is dynamic and it shows different data to different users, depending on what you are authorized to view.

Now, to get a token in the first place I have to do something like:

curl --header "Content-Type: application/json" --request POST --data '{"email":"my@email.com","password":"my-password"}' https://api.me.com/auth/public/authenticate

Which returns back something like:

{
  "token": "my.jwt.token"
}

So I think what I'd want is something like a local .stac-browserrc file where I can put my username, password, the fact that I want to use token based auth, the URL to hit to get a token, and then have the server just recognize this on startup, adding the required token header to every request on my behalf.

The token has a limited lifetime, so I would prefer if the server could be configured with a timeout to re-fetch a new token, but that's just a nice-to-have. I can restart the server over manually when running locally.

@MattFerraro
Copy link
Author

Auth in general is a huge topic. I could imagine use cases for support basic auth as well, and probably others.

@m-mohr
Copy link
Collaborator

m-mohr commented Jul 16, 2021

As there are a lot of different authentication flows, I don't think this will be supported anytime soon, but I'm happy to accept and review PRs. Also, there are some security concerns. We need to ensure people don't deploy public catalogs with such credentials in them - the credentials are public then. There are request interceptors in STAC Browser 3 though so that could be a chance for some custom code that you could implement to support some of the individual authentication flows. So my recommendation would be to wait for a beta of STAC Browser 3 and start on top of that.

@m-mohr m-mohr added this to the future milestone Jul 16, 2021
@m-mohr m-mohr added the help wanted Extra attention is needed label Oct 6, 2021
@m-mohr
Copy link
Collaborator

m-mohr commented Feb 26, 2022

It would be interesting to know what authentication methods providers implement so that we can make informed decisions on which authentication methods to support.

The most commonly used I've seen is just a token in a query parameter, which is supported since today.

May help for OAuth: https://github.com/dgrubelic/vue-authenticate

@m-mohr m-mohr changed the title Support Token based Auth Support Auth procedures Mar 9, 2022
@m-mohr
Copy link
Collaborator

m-mohr commented Aug 10, 2022

There's now a configurable UI that can handle token/API key based authentication for query parameters and headers. See issue #210 (comment) and the authConfig documentation for details: https://github.com/radiantearth/stac-browser/blob/main/docs/options.md#authconfig

@simonff

This comment was marked as outdated.

@m-mohr

This comment was marked as outdated.

@m-mohr
Copy link
Collaborator

m-mohr commented Mar 4, 2024

There's no also the Authentication extension, which is not supported in STAC Browser yet: https://github.com/stac-extensions/authentication

@m-mohr
Copy link
Collaborator

m-mohr commented Jun 6, 2024

  • HTTP Basic
  • HTTP Bearer
  • HTTP Digest
  • HTTP (others) - NOT PLANNED
  • S3 - NOT PLANNED
  • Signed URL
  • OAuth 2
  • API Key (Header & Query Parameters, no cookie support planned)
  • OpenID Connect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment