OAuth base64 decode bug?
I'm trying to get Oauth token using [this app}(https://takahashim.github.io/mastodon-access-token/), however pleroma responded with 500 at last step.
Request: POST /oauth/token
** (exit) an exception was raised:
** (ArgumentError) non-alphabet digit found: "=" (byte 61)
(elixir) lib/base.ex:1002: Base.dec64url/1
(elixir) lib/base.ex:1017: Base."-do_decode64url/2-lbc$^0/2-0-"/2
(elixir) lib/base.ex:1012: Base.do_decode64url/2
(pleroma) lib/pleroma/web/oauth/oauth_controller.ex:121: Pleroma.Web.OAuth.OAuthController.fix_padding/1
(pleroma) lib/pleroma/web/oauth/oauth_controller.ex:60: Pleroma.Web.OAuth.OAuthController.token_exchange/2
(pleroma) lib/pleroma/web/oauth/oauth_controller.ex:1: Pleroma.Web.OAuth.OAuthController.action/2
(pleroma) lib/pleroma/web/oauth/oauth_controller.ex:1: Pleroma.Web.OAuth.OAuthController.phoenix_controller_pipeline/2
(pleroma) lib/pleroma/web/endpoint.ex:1: Pleroma.Web.Endpoint.instrument/4
And Here is the request:
client_id: xcJND-9bouqXbfGIL9W4aYJRdLTjHR-9YA80w5XsjH0=
client_secret: xwuTgOsHywG7R53a17piSMGYLyWf4M0HEAqkzjvMQKs=
redirect_uri: https://takahashim.github.io/mastodon-access-token/
grant_type: authorization_code
code: COED=&state=
It seems the pleroma didn't handle the "=" during base64 decode.