Aaron
Aaron

Reputation: 846

Custom authentication provider for Azure logic apps

I have an existing web API using ASP.NET web API 2 which has it own token based authentication using x-auth-token.

I want to add Azure logic apps to this existing API, but the logic apps have to use that API for authentication. Azure AD, Facebook, Google... are not an option.

Is this possible? How?

Upvotes: 0

Views: 231

Answers (2)

Aaron
Aaron

Reputation: 846

So what I did was create a IOperationFilter (Swashbuckle) in ASP.NET and add the x-auth-token parameter to the Swagger export when required. Then the parameter shows up correctly in Azure and be filled in with the response of the previous authentication action.

Upvotes: 0

Szymon Wylezol
Szymon Wylezol

Reputation: 1466

In this case you would want to specify the header directly under the headers property of the action.

    "Http": {
        "conditions": [],
        "inputs": {
            "headers": {
                "x-auth-token": "the auth token"
            },
            "method": "POST",
            "uri": "https://myapiendpoint.com/action"
        },
        "type": "Http"
    }

As a best practice you would want to specify the actual token value as a parameter of type 'securestring'. You can find more information on secure parameters here https://msdn.microsoft.com/library/azure/mt643789.aspx

Upvotes: 1

Related Questions