Base solution for your next web application
Open Closed

Microsoft social login does not work #9725


User avatar
0
Gaurav.Mahajan created
  • What is your product version? 9.0.0
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .net core

Issue: This code in login.service.ts (see image below) is resulting in the Microsoft logins to fail. Could you please let me know if #1 is still an issue and why #2 had to be implemented in the first place? Removing the logic in #2 to strip the dashes fixes the login issue for us but I wanted to get your take on why was it needed in the first place? Did any of this implementation change as part of the 9.1.0 or 9.2.0 releases?

For your reference, the error occurs here in TokenAuthController becuase one of the keys has dashes and the other one does not:

Thank you!


12 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Gaurav.Mahajan

    Thank you for reporting this. In our tests, it was necessary to remove dashes but different providers might have different ID values. Could you share which provider you are trying ? Is it Office 365 ?

    Thanks,

  • User Avatar
    0
    Gaurav.Mahajan created

    Thanks for your response - Yes - it's O365 via Azure AD. Also, so I can account for them in my implementation if needed - what scenarios does the current implementation work with?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Gaurav.Mahajan

    We have implemented this with Azure AD. You can modify your code to strip dashes both on server side and client side to solve this issue. We will implement the same.

    Thanks,

  • User Avatar
    0
    Gaurav.Mahajan created

    Hi @ismcagdas

    Thank you for your inputs. When you say strip dashes on the server side, it's just in the GetExternalUserInfo method from TokenAuthController (image shown above) or other places as well?

    Also, what scenarios have you seen the dashes not come in from the provider, just so we can test and validate at our end?

    Thank you!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Gaurav.Mahajan

    Thank you for your inputs. When you say strip dashes on the server side, it's just in the GetExternalUserInfo method from TokenAuthController (image shown above) or other places as well?

    Yes, this should be the only place.

    Also, what scenarios have you seen the dashes not come in from the provider, just so we can test and validate at our end?

    I only faced this Office365.

  • User Avatar
    0
    Gaurav.Mahajan created

    Stripping the dashes on the server side resulted in errors for me. This is where it failed:

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Gaurav.Mahajan

    Could you share your entire Controller code ?

    Thanks,

  • User Avatar
    0
    Gaurav.Mahajan created

    Hi! Sorry for the delay. I replicated this issue in ANZ 9.0 out of the box so its the same controller.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Actually I thought you have implemented my suggestion here https://support.aspnetzero.com/QA/Questions/9725/Microsoft-social-login-does-not-work#answer-5880660b-a4ef-fce3-3408-39f8520e791c, so I asked your modified Controller code.

  • User Avatar
    0
    Gaurav.Mahajan created

    Sorry, I have removed that code since it did not resolve the issue but it was a simple string replace (only on the one side that had the dashes). Also, it was passing thiscondition (not throwing the error here) but was failing on line 423 as mentioned above. HTH but please let me know if I can further assist

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Gaurav.Mahajan

    Is it possible to share your project via email with us ? We can fix this problem for you and share it with you via email. You can send your project to [email protected] if that's OK with you.

    Thanks,

  • User Avatar
    0
    hra created

    @ismcagdas - I'm pretty sure this is contributing to our issue here: https://support.aspnetzero.com/QA/Questions/10620/Setting-up-Microsoft-Azure-AD-Login

    Where did this end up?