问题
So im building a ASP.NET web app that uses ADAL with Office 365 but I would like to have ADAL save the tokens so that the user will not have to log into Office each Session.
I've looked all over the place and have figured out how to implement a token cache but I still don't know how to create the token with the current Users info so that I can retrieve it.
Im sure it's as simple as adding a argument to one of the AcquireToken methods but I cant find out how. For referance this is what I have so far in terms of ADAL
Uri authUri = await authContext.GetAuthorizationRequestUrlAsync(scopes,null, clientId,
redirectUri, new UserIdentifier(User.Identity.GetUserId(), UserIdentifierType.RequiredDisplayableId),null);
AuthenticationContext authContext = new AuthenticationContext(authority, cache);
var authResult = await authContext.AcquireTokenByAuthorizationCodeAsync(
authCode, redirectUri, credential, scopes);
And I want to call this
var authResult = await authContext.AcquireTokenSilent(
scopes, clientId, new UserIdentifier(User.Identity.GetUserId(), UserIdentifierType.UniqueId)
);
But none of the Tokens have any user info on them
If you need any other info feel free to ask, thanks
来源:https://stackoverflow.com/questions/34849612/how-to-set-the-userinfo-of-a-adal-token