protected void btnClientSecret_Click(object sender, EventArgs e) { var accessToken = AuthHelper.GetAccessToken($"{Common.WCFAppURI}/.default"); var client = new IdentityWCF.IdentityServiceClient("BasicHttpsBinding_IIdentityService", Common.WCFURL); using (OperationContextScope scope = new OperationContextScope(client.InnerChannel)) { OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = new HttpRequestMessageProperty() { Headers = { { HttpRequestHeader.Authorization, $"Bearer {accessToken}" } } }; GenerateTable(client.GetHeadersAndClaims()); } }
protected void btnOnBehalfOf_Click(object sender, EventArgs e) { var accessToken = AuthHelper.GetAccessTokenOBO(new string[] { $"{Common.WCFAppURI}/user_impersonation" }, Context.Request.Headers["X-MS-TOKEN-AAD-ID-TOKEN"]); var client = new IdentityWCF.IdentityServiceClient("BasicHttpsBinding_IIdentityService", Common.WCFURL); using (OperationContextScope scope = new OperationContextScope(client.InnerChannel)) { OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = new HttpRequestMessageProperty() { Headers = { { HttpRequestHeader.Authorization, $"Bearer {accessToken}" } } }; GenerateTable(client.GetHeadersAndClaims()); } }
protected void btnAnonymous_Click(object sender, EventArgs e) { var client = new IdentityWCF.IdentityServiceClient("BasicHttpsBinding_IIdentityService", Common.WCFURL); GenerateTable(client.GetHeadersAndClaims()); }