Hi All!
I’ve been trying to follow the steps suggested in this guide Roles & Permissions - Strapi Developer Documentation and I’m struggling to create a Patreon custom provider. I have the entire auth process working on the frontend using NextJS, so I know there are no issues with the credentials and it’s likely just me still trying to acclimate to Strapi.
Following the Discord path laid out in the example, I created a Patreon Purest instance:
case 'patreon': {
const patreon = purest({
provider: 'patreon',
config: {
patreon: {
'https://www.patreon.com': {
__domain: {
auth: {
auth: {bearer: "[0]"}
}
},
'{path}': {
__path: {
alias: '__default'
}
}
}
}
}
});
patreon
.query()
.get('api/oauth2/api/current_user')
.qs({ access_token })
.request((err, res, body) => {
console.log(body)
if (err) {
callback(err);
} else {
callback(null, {
username: body.data.attributes.full_name,
email: body.data.attributes.email,
});
}
});
Pardon my confusion, but my understanding of the Patreon flow is to trigger the auth with https://www.patreon.com/oauth2/authorize/
API Reference
followed by a post request obtaining the access token via https://www.patreon.com/api/oauth2/token
then finally getting the user (or whatever Patreon) data from https://www.patreon.com/api/oauth2/api/current_user
and I feel like I’m missing a crucial part of generating a JWT token and adding a user. I’m currently getting an “invalid token” on the auth/patreon/callback.
Here is also my bootstrap.js:
patreon: {
enabled: false,
icon: 'comments',
key: '',
secret: '',
callback: `${strapi.config.server.url}/auth/patreon/callback`,
scope: [
'users'
]
}
If anyone could give me any guidance on this I’d appreciate it greatly.
Thanks and have a great day!