private void AddCcsHeadersToTokenClient() { if (!string.IsNullOrEmpty(_clientInfo)) { var clientInfo = ClientInfo.CreateFromJson(_clientInfo); _tokenClient.AddHeaderToClient(Constants.CcsRoutingHintHeader, CoreHelpers.GetCcsClientInfoHint(clientInfo.UniqueObjectIdentifier, clientInfo.UniqueTenantIdentifier)); } else if (!string.IsNullOrEmpty(_interactiveParameters.LoginHint)) { _tokenClient.AddHeaderToClient(Constants.CcsRoutingHintHeader, CoreHelpers.GetCcsUpnHint(_interactiveParameters.LoginHint)); } }
public Task <MsalTokenResponse> FetchTokensAsync(CancellationToken cancellationToken) { if (!string.IsNullOrEmpty(_interactiveParameters.LoginHint)) { _tokenClient.AddHeaderToClient(Constants.CCSRoutingHintHeader, CoreHelpers.GetCCSUpnHeader(_interactiveParameters.LoginHint)); } return(_tokenClient.SendTokenRequestAsync(GetBodyParameters())); }
protected Task <MsalTokenResponse> SendTokenRequestAsync( string tokenEndpoint, IDictionary <string, string> additionalBodyParameters, CancellationToken cancellationToken) { string scopes = GetOverridenScopes(AuthenticationRequestParameters.Scope).AsSingleString(); var tokenClient = new TokenClient(AuthenticationRequestParameters); var CCSHeader = GetCCSHeader(additionalBodyParameters); if (CCSHeader != null && !string.IsNullOrEmpty(CCSHeader.Value.Key)) { tokenClient.AddHeaderToClient(CCSHeader.Value.Key, CCSHeader.Value.Value); } return(tokenClient.SendTokenRequestAsync( additionalBodyParameters, scopes, tokenEndpoint, cancellationToken)); }