Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

How to pass Azure bearer Token in Soap Webservice

(0) ShareShare
ReportReport
Posted on by 30

Hi,

In my old webservice (Dynamics AX20112), I usually pass the credentials as follow.
MyService.ClientCredentials.UserName.UserName = U;
MyService.ClientCredentials.UserName.Password = P;

Now our service is on Dynamics 365 (Azure), we need to pass the bearer token to this soap webservice? How can that be done or is there anything similar to the above?

Thanks in advance.

  • wandal Profile Picture
    30 on at
    RE: How to pass Azure bearer Token in Soap Webservice

    I am able to get the it working. Here is how I add the "Authorization" header':

    sc = myService.Client...

                using (new OperationContextScope(sc.InnerChannel))

                {

                    // Add a HTTP Header to an outgoing request

                    string auth = "Bearer " + authToken;

                    HttpRequestMessageProperty requestMessage = new HttpRequestMessageProperty();

                    requestMessage.Headers["Authorization"] = auth;

                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = requestMessage;

                    sc.GetServiceInfo(c, out ret);               

                }        

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Product updates

Dynamics 365 release plans