[Help] Example of Apple SignIn implementation with POST_FORM
See original GitHub issueHi š ,
Iāve would like to implement Apple SignIn authentication with Grant + Purest, but Iām unable to find great configuration with Purest (not update since 4 years with latest providers like āAppleā)
Grant
is unable to read POST_FORM access_token
and itās return oAuth2 missing code parameter
error.
Grant config (not sure about this)
apple: {
key: '', // reverse.domain.name
secret: '', // Need to be refer with "Generate client secret"
callback: `[domain.name]/auth/apple/callback`,
nonce: true,
state: true,
scope: ['name', 'email'],
custom_params: {
response_type: 'code id_token',
response_mode: 'form_post' // necessary... Apple constrain š¢
},
},
Purest configuration testing :
const apple = purest({
provider: 'apple',
config: {
apple: {
'https://appleid.apple.com': {
__domain: {
auth: {
auth: { bearer: '[0]' },
},
},
'{endpoint}': {
__path: {
alias: '__default',
},
},
},
},
}
});
apple
.query()
.post('auth/token') // not sure about this ? apple want post request only
.auth(access_token)
.request((err, res, body) => {
if (err) {
callback(err);
} else {
// let do some stuff...
callback(null, {body});
}
});
Iāve successfully sign in with other libraries (apple-signin
and apple-auth
) but I would like to perform signIn request only with Grant + Purest and not implement a tierce package.
But Grant
return the same error with the access_token
(code
for Apple) and itās unable to return and read it from POST_FORM request.
The project āPlaygroundā implement Apple SignIn testing example, but I canāt find any code to understand how itās working. Apple documentation is clearlyā¦ pitiable.
Thanks for your help !
Issue Analytics
- State:
- Created 3 years ago
- Comments:33 (16 by maintainers)
Top GitHub Comments
Not sure if this will be useful to your use case @forgot or maybe others who find their way to this thread, but I threw together a short guide to using Apple Oauth with FeathersJS. I had a lot of misconceptions going into it, but once I got myself sorted out, this is what I ended up with: https://gist.github.com/rxb/e596c66b03e3262f26d9ede5d7dbab81
The fix for the user profile was published in v5.4.14