globus / globus/globus-sdk-javascript

Example on using state parameter to preserve query string

Open
#318 3 comments 0 reactions 1 assignee Claimed by @jbottigliero View on GitHub
documentation question
Dominant language
TypeScript
Stars
11
Forks
4
Avg merge
1d 21h
Merged PRs (30d)
10

Description

### What problem are you trying to solve?

When a page receives a set of query parameters like `https://example.org/plot.html?file=a.csv` I would like to know the appropriate way to persevere the query string `file=a.csv` after a login redirect. I believe this is typically handled via the `state` parameter in the OAuth flow, though I could be mistaken.

We are using this model to have a single page that view and interact with data from Globus Collections that require access tokens. This way, way can have a single viewer page and load different files based on the query parameters. Examples of doing this for public data are in our [Cheap and FAIR template repo](https://github.com/cheapandfair/cheapandfair-template) (see the [view.md](https://github.com/cheapandfair/cheapandfair-template/blob/main/view.md) and [chart.md](https://github.com/cheapandfair/cheapandfair-template/blob/main/chart.md) pages).

### Describe the solution you'd like

It would great to have an example like the [basic login page](https://github.com/globus/globus-sdk-javascript/blob/main/examples/basic/index.html) that shows how to use the state parameter or other means to do this.

### Describe alternatives you've considered

As a workaround, I will try collecting the parameters prior to creating the login manager and calling `manager.handleCodeRedirect()` or `login()`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.