graphql-boilerplates / react-fullstack-graphql

Starter projects for fullstack applications based on React & GraphQL.
1.44k stars 325 forks source link

Login/Signup currently fails - (Auth0 Example (with React & Apollo)) #29

Closed afishler-zz closed 7 years ago

afishler-zz commented 7 years ago

When running the code, after creating an account/client with Auth0, the result of signing up and completing the form is a redirect back to login.

The error is thrown in the catch part below of CreateUser, in the createUser function this.props.createUser({ variables }) .then((response) => { this.props.history.replace('/') }).catch((e) => { console.error(e) this.props.history.replace('/') })

with error: CreateUser.js:80 Error: GraphQL error: The provided idToken is invalid. Please see https://auth0.com/docs/tokens/id_token for how to obtain a valid idToken at new ApolloError (apollo.umd.js:2075) at apollo.umd.js:2798 at

georgelam0306 commented 7 years ago

I'm also getting the same issue

OGPoyraz commented 7 years ago

Hey, Did you tried to change Auth0 JWT encryption ? Go to your Auth0 Dashboard - Client - Advanced Settings. Then set JsonWebToken Signature Algorithm to HS256 inside OAuth tab.

afishler-zz commented 7 years ago

HS256 worked. Thank you. However, don't recall this is indicated within the tutorial....would help to put it in clearly.

andnilsson commented 7 years ago

I´m getting the same invalid token error, but when i change to HS256 encryption I get this error response: "Algorithm HS256 is not supported. (Expected algs: [RS256])"

marktani commented 7 years ago

Thanks everyone for chiming in! We're currently running a beta for custom authentication, that allows you to build a RS256 compatible integration with Auth0. For further information, please join the discussion in the Forum: https://www.graph.cool/forum/t/feedback-schema-extensions-beta/405?u=nilan.

javdl commented 7 years ago

Besides setting JsonWebToken Signature Algorithm to HS256, you also need to disable OIDC Conformant to make this example work. #43