Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Giovanni Sidoel 93 posts 232 karma points
    Feb 19, 2018 @ 17:38
    Giovanni Sidoel

    "The input is not a valid Base-64 string" when calling Members.Login

    Hi. I'm trying to log our members in using the following code

    Members.Login("jurian360", "password");

    However this keeps throwing the following error:

    The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

    I am running Umbraco version 7.7.7 assembly: 1.0.6554.23584.

    The only other similar thread I could find was but did not provide a solution for us.

    Looking forward to your help.

  • Joshua Lemli 52 posts 234 karma points
    Feb 19, 2018 @ 19:09
    Joshua Lemli

    Check out the encryption options for Umbraco passwords. In the DB, you can either store passwords as "plain text" or "encrypted".

    I believe "encrypted" stores them as a base-64 encoded URI (although there may be a hash involved, too).

    A work-around might be to simply check that their password matches, then log them in manually:

    System.Web.Security.FormsAuthentication.SetAuthCookie("membersEmailHere", true);
  • Giovanni Sidoel 93 posts 232 karma points
    Feb 19, 2018 @ 19:32
    Giovanni Sidoel

    Thanks for your input.

  • Giovanni Sidoel 93 posts 232 karma points
    Feb 19, 2018 @ 19:17
    Giovanni Sidoel

    I've been able to narrow it down further: It seems to only be a problem when I assign the password in code

    if (model.GoogleUser)
                    memberService.SavePassword(member, "HelloFromGoogle2018");
                    memberService.SavePassword(member, model.Password);

    If I assign the password via the normal Umbraco back-end, I am able to log in fine.

    Furthermore, I have tried assigning the password via .CreateWithIdentity. This gives the exact same result.

  • Giovanni Sidoel 93 posts 232 karma points
    Feb 19, 2018 @ 19:31
    Giovanni Sidoel

    Ok. It seems this was just a logical error on my part. I was calling .SavePassword before I had saved the member. All seems ok now.

  • Jonas Widenberg 17 posts 98 karma points
    Apr 04, 2019 @ 07:07
    Jonas Widenberg

    Ah. Thanks! This helped me solve the same issue.

  • Kasper 9 posts 80 karma points
    Apr 05, 2022 @ 09:48

    Thanks, this was my exact issue as well! Took a look at my created member in the backoffice and realised the "Last Password Change Date" property was empty.

  • Richard Ockerby 22 posts 147 karma points MVP 2x c-trib
    Feb 01, 2022 @ 00:44
    Richard Ockerby

    I too came across this problem today. To add to the above, this error will throw when the user doesn't have a password.

    In my case, MemberService.SavePassword was correctly throwing an error (the password didn't meet criteria) so trying to login to this user threw the error.

Please Sign in or register to post replies

Write your reply to: