Hello I am new in Auth0,
I hava a case, an app using SPA login with Auth0, and I need to authorize that user login on server side.
What I am thinking right now:
- login using Auth0 SPA
- get access token fron login
- send data using access token in header Authorization
- and verify it in graphql context or express middleware?
const auth0Client = await auth.createClient();
console.log(await auth0Client.getTokenSilently()) // return access token
console.log(await auth0Client.getUser());
const token = await auth0Client.getTokenSilently();
fetch('/api', {
method: 'POST',
headers: {
'Authorization': `bearer ${token}`
},
});
on server side, I need to validate it manually and get user data from that token
how to do that?