I'm trying to implement custom auth (spotify) and ...
# prisma-whats-new
s
I'm trying to implement custom auth (spotify) and wondering if there's any plan to allow for graphcool functions to respond to arbitrary http events instead of just mutations. basically I need to register an oauth callback for spotify and issue a graphql query to create a user. I know I could explore doing this via auth0 but would prefer not having to use an additional service dependency and cost using auth0.
n
@stephenhandley just hypothetically, could we turn it around by initiating this workflow with a GraphQL mutation that would call the Spotify custom auth endpoint?
s
@nilan potentially, but the main issue there is that spotify needs a public auth callback url. https://developer.spotify.com/web-api/authorization-guide/#authorization-code-flow
so basically after the user grants access they are redirected to some endpoint with the auth token. presumably I could have some dedicated gcloud function or lambda that would then make the associated graphql mutation, but I’m ideally wondering if its possible to not have the need for an additional infrastructure provider. auth0 doesn’t support spotify out of the box, so looking into what would be needed there.
i’ve got the above auth flow working on firebase functions and their custom auth, but then saw graphcool released functions and would prefer using graphql to firebase’s api so evaluating whether I want to make the switch and what the changes needed would be