We are implementing federated authentication using Google & Facebook by referring below blog post,


User is able to logging but sitecore create user name as base64 string, So as suggested in blog we are trying to use "CreateUniqueUserName()" method of "Sitecore.Owin.Authentication.Services.DefaultExternalUserBuilder" class. But we are getting below error,

CS0618 'DefaultExternalUserBuilder.DefaultExternalUserBuilder(bool)' is obsolete: 'Use DefaultExternalUserBuilder(IHashEncryption hashEncryption) instead. Set IsPersistentUser through property setter.'

While I go to class definition i had found the constructor which i need to use is obsolete.

enter image description here

We are using Sitecore 9.0.2 version, Can anyone has gone through same issue? Is there any other way to use "CustomExternalUserBuilder" class ?

  • can you please specify sitecore version and if you can, post what you have implemented -not clear
    – josedbaez
    Aug 2 '19 at 8:07
  • I agree. Much of the information on the net currently is for Sitecore 9.0. Much of the Identity Server integration has changed for 9.1.
    – Mark Cassidy
    Aug 2 '19 at 10:02
  • @josedbaez we are using sitecore 9.0.2
    – Sam
    Aug 2 '19 at 10:31
  • Are you not just getting a compiler warning?
    – josedbaez
    Aug 2 '19 at 10:39
  • @josedbaez the strange thing is that on vanila instance i am getting compiler warning where i did POC, but on project where i have to actually implement this, i am getting compiler error , not able to build solution. Both instance has same Sitecore version.
    – Sam
    Aug 2 '19 at 10:44

As your screenshot suggests, the 2 constructors have been marked as Obsolete. You have the following options.

  1. Mark your class as obsolete so compiler ignore these.
  2. Ignore the warning and make sure your project doesn't have "Treat warning as errors" set on it.
  3. Remove obsolete constructors from your class and add one that uses valid constructor. Make sure this doesn't break the functionality. e.g.

    public CustomExternalUserBuilder(IHashEncryption hashEncryption)
    : base(hashEncryption)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.