Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Allow createUser to be authenticated/restricted only to the current user #89

Closed
morgothulhu opened this issue Feb 5, 2017 · 2 comments

Comments

@morgothulhu
Copy link

Scenario is self-served portal.

Any user can sign-in using Auth0, thus get their id_token.
Using https://jwt.io/, the encoded id_token can be modified, to alter the sub field
Then the createUser(authProvider: {auth0: {idToken: $idToken}} ... mutation can be invoked with the forged id_token.

Two possible solutions I see:

  • allow 'authenticated' condition to allow matching user (as long as the proper Authentication Bearer idToken) is passed even if the row is not yet created in User
  • replace auth0: {idToken} to use JWT (as mentioned here) to validate on graph.cool proper signature
@sorenbs
Copy link
Member

sorenbs commented Feb 6, 2017

Thanks for reporting this @morgothulhu

I will look into this today and get back to you.

@sorenbs
Copy link
Member

sorenbs commented Mar 3, 2017

This is resolved by validating the jwt. Thanks again @morgothulhu

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants