Error using apple.validateAuthorizationCode(code)
Closed this issue · 4 comments
Ionmi commented
Hi,
I'm encountering an error when passing the Apple code to validateAuthorizationCode. The error message is "Invalid character":
Error: Invalid character:
at Base64Encoding.decode(.../node_modules/oslo/dist/encoding/base64.js:67:27)
at decodeBase64(.../node_modules/oslo/dist/encoding/base64.js:92:19)
at parsePKCS8PEM(.../node_modules/arctic/dist/providers/apple.js:64:12)
at Apple.createClientSecret(.../node_modules/arctic/dist/providers/apple.js:50:46)
at Apple.validateAuthorizationCode(.../node_modules/arctic/dist/providers/apple.js:25:37)
at Module.validateAppleAuthorizationCode
By the way I love what you are doing.
Thank you!
Ionmi commented
There where \n in the .p8
zestsystem commented
@Ionmi I am facing the same issue. what did you do to fix this?
Ionmi commented
@zestsystem The issue wasn't with the authorization code but with the Apple certificate instead. Internally, the function uses the certificate, and there were '\n' characters in it, which caused it to be undecodable.
zestsystem commented
@Ionmi Thank you so much! I would've never guessed that certificate was causing the issue