0

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

https://blog.nikkipunjabi.com/2018/03/sitecore-federated-authentication-part-3-sitecore-user-and-claims-identity.html

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 ?

8
  • can you please specify sitecore version and if you can, post what you have implemented -not clear
    – josedbaez
    Commented Aug 2, 2019 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
    Commented Aug 2, 2019 at 10:02
  • @josedbaez we are using sitecore 9.0.2
    – ganesh
    Commented Aug 2, 2019 at 10:31
  • Are you not just getting a compiler warning?
    – josedbaez
    Commented Aug 2, 2019 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.
    – ganesh
    Commented Aug 2, 2019 at 10:44

1 Answer 1

2

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 and acknowledge you have read our privacy policy.

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