Call Graph on ticket received #1773
Unanswered
xperiandri
asked this question in
Q&A
Replies: 3 comments 8 replies
-
@xperiandri : you can use the following sample as an example on how to call Graph from the OnTokenValidated event: cc: @kalyankrishna1 to help if needed. |
Beta Was this translation helpful? Give feedback.
2 replies
-
@xperiandri : can you pre-authorize this scope (admin consent)? |
Beta Was this translation helpful? Give feedback.
6 replies
-
How can I change login claims set on the fly? builder
.AddMicrosoftIdentityWebApp(
options =>
{
var events = options.Events;
events.OnRedirectToIdentityProvider = ctx =>
{
if (ctx.HttpContext.Request.RouteValues["area"] == TDL.Model.Common.Constants.Areas.Marketplace)
{
var options = ctx.Options;
var scope = options.Scope;
// This manipulation does not work
scope.Remove("Team.ReadBasic.All");
scope.Add("Directory.Read.All");
}
return Task.CompletedTask;
};
events.OnTokenValidated = MicrosoftAuthenticationEventsHandler.OnTokenValidated;
},
openIdConnectScheme: IdentityProviders.Microsoft,
displayName: "Microsoft Account",
cookieScheme: null) How can I achieve that? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wanted to gather additional AAD user info and merge it into principal claims.
Because UserInfo endpoint is not being called (#1771) and I need some more info (#1772) decided to use Graph.
So I provided a delegate to
events.OnTicketReceived
property.But as long as a user is not authenticated there yet, Graph authentication fails.
Moreover, it cannot find an authentication schema. As long as I override it to use Cookie as default.
So I provided a delegate to
OnTokenResponseReceived
property to dobut AccessToken is null because of #880 which I fixed in #1771
So my question is how to instruct Graph to take the token received before signing in completed in order to gather user info and merge it into claims?
Beta Was this translation helpful? Give feedback.
All reactions