bennadel / JSONWebTokens.cfc

Thi is a ColdFusion gateway to help encode and decode JSON web tokens.
Other
59 stars 26 forks source link

Not working with google api JWT #2

Open Tropicalista opened 8 years ago

Tropicalista commented 8 years ago

I've tested this lib with google api JWT, but I got error:

can't decode the base64 input string [notasecret], because the input 
string has an invalid length

notasecret is the default password for google Jwt. The error is probably due to Base64url encoding.

Something like this:

reReplace(reReplace(reReplace(str, "\+", "-", "all"), "\/", "_", "all"),"=", "", "all")

could resolve the issue.

Here are some reference: https://developers.google.com/identity/protocols/OAuth2ServiceAccount