locked
How to implement OAuth authentication for WCF-WebHttp endpoint in BizTalk 2013. RRS feed

  • Question

  • How to implement OAuth authentication for WCF-WebHttp endpoint  in BizTalk

    or 

    Any suggestible extensions for performing authentication between mobile and Biztalk WCF-WebHttp endpoint.

    Advance thanks..... MKS
    Sunday, January 24, 2016 6:39 AM

Answers

All replies

  • Hi MKS,

    You can authenticate with Salesforce while sending messages using the REST interface. The authentication methods for REST calls supported by Salesforce are not available out of the box with the WCF-WebHttp adapter, which is use to invoke Salesforce’s REST interface. So, you have create a custom WCF endpoint behavior and then attach it to WCF-WebHttp send adapter that we’ll configure to invoke the Salesforce REST interface.

    For this you can refer: Enabling BizTalk Server to Send and Receive Messages from Salesforce

    On how to implement this you can refer the below links:

    Calling the Force.com REST API from BizTalk Server

    BIZTALK SERVER 2013 SUPPORT FOR RESTFUL SERVICES

    Integrating BizTalk Server 2013 with Salesforce

    Alternatively,

    For some basic authentication you also implement your own custom authorization manager.

    Refer: BizTalk WCF-WebHTTP Basic Authentication Authorization Manager


    Rachit Sikroria (Microsoft Azure MVP)


    Sunday, January 24, 2016 7:06 AM
    Moderator
  • Hi Rachit,

    Actually, my question is about authentication between mobile and BizTalk services. OAuth implementation or any suggestions for performing authentication between mobile and Biztalk WCF-WebHttp endpoint also help me a lot

    Thanks & Regards,

    Kalyan Srinivas .M

    Sunday, January 24, 2016 7:46 AM
  • While OAuth is all trendy, it's still has a very narrow practical usability case.  Basically, if you're Twitter or Facebook, it makes sense.  If you're writing a business app for a specific user community, it's a lot of complexity for really no gain.

    As for implementing OAuth with a BizTalk app, sure, you can just implement a custom authentication provider or behavior, with OAuth, that's actually the easy part.  All the infrastructure behind OAuth is what gets tricky.  I've had to do it and it wasn't worth it.

    Before you pursue OAuth, make sure none of the other standard authentication methods don't suite your needs.  Yes, implemented well, OAuth will provide a better performance profile for high volume continuous re-authentication.  Unless you're expecting thousands of calls over a distributed platform, I'd stick with certs or even just username/password.

    Sunday, January 24, 2016 2:48 PM
    Moderator
  • Hi,

    Like Rachit pointed out you need to implement a WCF behaviour. In that behaviour try MessageInspector. Therefore, you wil have to dig around the provided links.

    Kind Regards,

    Steef-Jan (Microsoft Azure MVP)


    BizTalk

    Sunday, January 24, 2016 2:50 PM
    Moderator
  • Hi ,

    Have you looked into the below blog for defining the Authentication  for the service call

    https://mikearnett.wordpress.com/2014/05/26/biztalk-wcf-webhttp-basic-authentication-authorization-manager/

    You can also look into http://microsoftintegration.guru/2015/02/07/azure-service-bus-relay-authorization-tokens-webhttp/ for some workaround

    Thanks

    Abhishek


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply

    Sunday, January 24, 2016 8:23 PM
  • Hi Steef,

    In my scenario, we have implemented custom behaviour that gives us OAUTH 2.0 token:

                   {
                        aadToken = GetAADToken(_authority, _appID, _clientID, _clientSecret).GetAwaiter().GetResult();
                    }
                    catch (Exception ex)
                    {
                        System.Diagnostics.EventLog.WriteEntry("BeforeSendRequest", ex.ToString());
                    }
                    //set the header
                    httpRequestMessage.Headers["Authorization"] = "Bearer" + aadToken;

    Configured WCF-WebHTTP adapter and when tested, receives below error.

    HTTPrequest is unauthorized with client authentication scheme 'Anonymous'. The
    authentication header received from the server was 'Bearer'


    Tuesday, January 17, 2017 11:59 PM