You can set the
SaveTokens
to true:.AddMicrosoftAccount(MicrosoftAccountDefaults.AuthenticationScheme, options => { //Personal Microsoft accounts as an example. options.AuthorizationEndpoint = "https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize"; options.TokenEndpoint = "https://login.microsoftonline.com/consumers/oauth2/v2.0/token"; options.SaveTokens = true; options.Events.OnCreatingTicket = ticketContext => { ticketContext.Identity.AddClaim(new Claim("urn:microsoftaccount:access_token", ticketContext.AccessToken)); return Task.CompletedTask; }; })
HttpContext.GetTokenAsync(scheme: MicrosoftAccountDefaults.AuthenticationScheme,"access_token");
Hi, I added this code in my application, but whe i check into the httpContext to find the value of token, it's empty I must have its value available in the controller Thank you
Thank you liangshiwei. Last question... is there a link where it is explain embedding PowerBI in angular abp application? With API calls, of course. tnx
Thank you so much Now, I would to have the token in Controller or Service, but when I look into the "CurrentUser", after Microsoft Login to retireve Claims, it's Empty. What is the best practice to do this? The Token is necessary to call PowerBI Dashboard, thank you.
Hi, I logged into my abp application with Microsoft account; now, I would like to embed PowerBI Dashboard, but to do this I need to have a Token to pass to PowerBI. I can't intercept the token... How can I do it? Thank you