Base solution for your next web application
Open Closed

Get Token From Successful MS Login #7538


User avatar
0
naurinrr created

Hi everyone,

I have enabled ms login succesfully but I need to get a token that can be passed to graph api and other react components I am using. Unfortunately there is no work around at the moment to providing the token and I have not been able to get the token. ExternalLoginInfo just has the isAuthenticated property.

Thanks in advance.


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

    Hi @naurinrr

    • Are you using Angular version ?
    • Could you share how did you implement MS Login ?

    Thanks,

  • User Avatar
    0
    naurinrr created

    Hi,

    I am using ASP NET .CORE MVC and Javascript version and have implemented using the following app settings;

    "Microsoft": {
          "IsEnabled": "true",
          "ConsumerKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
          "ConsumerSecret": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
        }
    

    I can login successfully but I can't get the token. I am using React componnent in MVC html pages.

    Thank you

  • User Avatar
    0
    naurinrr created

    I found that if I enable saveTokens option then I get the token in ExternalLoginCallback method in ExternalLoginInfo but login manager does not add it to the loginResult.Identity or loginResult.User even though the user has a token property. Anyway to fix it?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Yes, this is not implemented yet, see https://github.com/aspnetzero/aspnet-zero-core/issues/973. If you can write your opinion to this issue, we can bring it to a closer milestone.

    Thanks,

  • User Avatar
    0
    naurinrr created

    The link to the issue returns page not found. How can I request Scope (API permissions) when logging in using external microsoft login?

    How come I can't make graph api calls even after logging in using MS account? Can you please help as it is causing me major headache when trying to integrate with office 365. Thank you in advance.

  • User Avatar
    0
    naurinrr created

    Nevermind, I fixed it. Thanks