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 functions for provider.auth and provider.token #461

Open
charlesbjohnson opened this issue Jun 1, 2020 · 2 comments · May be fixed by #463
Open

Support functions for provider.auth and provider.token #461

charlesbjohnson opened this issue Jun 1, 2020 · 2 comments · May be fixed by #463
Labels
feature New functionality or improvement

Comments

@charlesbjohnson
Copy link

charlesbjohnson commented Jun 1, 2020

Support plan

  • which support plan is this issue covered by? (e.g. Community, Core, Plus, or Enterprise): Community
  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: latest
  • module version: latest
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): @hapi/hapi@latest
  • any other relevant information: n/a

What problem are you trying to solve?

I'm attempting to use this module in a Shopify app that integrates with Shopify's OAuth2 authentication workflow.

Shopify works slightly differently from the current providers in that the authorization step is per store, such that the provider.auth and provider.token options differ depending on the store that initiated the OAuth flow (AKA the store that installed the "app").

In other words, in order for "Store A" authenticate it must redirect to https://store-a.myshopify.com/admin/oauth/authorize, while a "Store B" must redirect to https://store-b.myshopify.com/admin/oauth/authorize.

Do you have a new or modified API suggestion to solve the problem?

As far as I can tell, @shopify/koa-shopify-auth is able to determine which store to redirect to through a query parameter in the request. I think a similar approach could be taken here.

Would you support expanding the provider schema so that auth and token options can alternatively accept functions with access to request, similar to the providerParams or scope options (#233)?

Thanks!

@charlesbjohnson charlesbjohnson added the feature New functionality or improvement label Jun 1, 2020
@hueniverse
Copy link
Contributor

I'm open to it. Want to draft an PR?

@charlesbjohnson
Copy link
Author

Sure thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants