Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormatException (FormatException: Missing padding character (at character 280) on example project sign up #77

Open
ryanhz opened this issue Oct 1, 2024 · 2 comments · May be fixed by #87

Comments

@ryanhz
Copy link

ryanhz commented Oct 1, 2024

FormatException (FormatException: Missing padding character (at character 280)
...Tmk0c0EiLCJhbmRyb2lkUGFja2FnZU5hbWUiOiJjb20uY29yYmFkby5wYXNza2V5cy5wdWIifQ=
^
)

It turns out that the raw is not correctly base64 padded, replace this line:
final raw = '${response.clientDataJSON}=';
with
final raw = padBase64(response.clientDataJSON);

and add function:

String padBase64(String rawBase64) {
  return (rawBase64.length % 4 > 0)
      ? rawBase64 += List.filled(4 - (rawBase64.length % 4), "=").join("")
      : rawBase64;
}

should fix the issue.

@stensonb
Copy link

stensonb commented Nov 8, 2024

just ran into this (same?) issue (https://passkeys.flutter.corbado.io/#/sign-up):
Screenshot 2024-11-07 at 10 40 52 PM

@thiwa8
Copy link

thiwa8 commented Dec 17, 2024

Same
image

@Dopeamin Dopeamin linked a pull request Jan 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants