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

Enable oauth_flow_auth_code to parse URL for component code and state #326

Merged
merged 10 commits into from
Oct 11, 2023

Conversation

fh-mthomson
Copy link
Contributor

If a redirect_uri is a static redirect i.e., does not parse results via Javascript (as done in https://www.tidyverse.org/google-callback (parsing source code), users currently need to manually parse code and state from the URL itself, which is time consuming (and error prone).

Rather, it would be more efficient to just copy the URL itself, rather than require users to host a site that parses the result.

@hadley this suggested change is based on our convo during the Posit conf workshop!

@fh-mthomson fh-mthomson changed the title Enable oauth_flow_auth_code to parse URL rather than component code and state Enable oauth_flow_auth_code to parse URL rather than component code and state Sep 29, 2023
@fh-mthomson fh-mthomson changed the title Enable oauth_flow_auth_code to parse URL rather than component code and state Enable oauth_flow_auth_code to parse URL for component code and state Sep 29, 2023
@hadley
Copy link
Member

hadley commented Oct 8, 2023

Can you explain a bit more about how you expect the user experience to work? You'll forward them to a page that just says "copy this url"? If you're hosting that page, why is it any harder to copy in the javascript that would parse the components for them?

@fh-mthomson
Copy link
Contributor Author

You'll forward them to a page that just says "copy this url"?

Yeah, exactly!

If you're hosting that page, why is it any harder to copy in the javascript that would parse the components for them?

It's a very static page, i.e.,: https://gitlab.com/<internalrepo>/-/blob/main/readme.md

So, it would be ideal to not have to create javascript (our team doesn't have immediate expertise) and instead defer to the httr2 workflows to handle all OAuth parsing workflows.

The current alternative is to have folks manually extract code and state entries from the URL.

@hadley
Copy link
Member

hadley commented Oct 9, 2023

You don’t have to create JavaScript, you can just copy it onto that page?

@calkunz
Copy link

calkunz commented Oct 10, 2023

To clarify Michael's comment,

It's a very static page, i.e.,: https://gitlab.com/<internalrepo>/-/blob/main/readme.md

For our redirect, the Gitlab markdown file we're using is a static page that's essentially a page of documentation within a larger repo, so it isn't a full site where we are able to interact with the JavaScript and have it handle the parsing

@hadley
Copy link
Member

hadley commented Oct 11, 2023

Ah, it's not even an HTML page.

@hadley hadley merged commit defedec into r-lib:main Oct 11, 2023
12 checks passed
@fh-mthomson fh-mthomson deleted the mthomson/oauth_flow_auth_code_url branch October 18, 2023 01:30
@fh-mthomson
Copy link
Contributor Author

thank you, @hadley !

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

Successfully merging this pull request may close these issues.

3 participants