{"id":274,"date":"2016-11-28T06:00:56","date_gmt":"2016-11-28T14:00:56","guid":{"rendered":""},"modified":"2025-06-11T08:16:34","modified_gmt":"2025-06-11T15:16:34","slug":"custom-api-with-authentication","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-apps\/custom-api-with-authentication\/","title":{"rendered":"Guest Blog: Build Custom API on Microsoft Flow and PowerApps with Authentication"},"content":{"rendered":"<p>We came across <a href=\"https:\/\/blogs.msdn.microsoft.com\/tsmatsuz\/2016\/11\/18\/custom-api-on-microsoft-flow-and-powerapps-with-authentication\/\" rel=\"noopener\" target=\"_blank\">a great blog post<\/a> by our colleague Tsuyoshi Matsuzaki from Microsoft Japan. Tsuyoshi Matsuzaki is a technical evangelist whose mission is educating and supporting ISV developers on Microsoft Azure, Office 365 , and other enterprise platforms.<\/p>\n<p>Thanks Tsuyoshi, on behalf of the PowerApps team!<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>The custom api enables you to connect your own web api (REST api) in Microsoft Flow (including SharePoint workflow) and PowerApps. You can connect Microsoft Flow and PowerApps with your in-house applications or unknown 3rd party (ISV) applications.<\/p>\n<p>In this post I show you how to build and use the custom api, and in most cases the authentication is needed, then I also explain with real authentication scenario. (First I explain using Azure AD, and next I show you the other cases, such as Google account.)<\/p>\n<h3>Build your own web api<\/h3>\n<p>In the first example, we use the Azure Active Directory (Azure AD)\u00a0 as the authentication provider with custom api.<br \/>\nIn this case, your web api must handle the OAuth access token.<\/p>\n<p>I don\u2019t describe how to build the web api secured by the Azure AD, but if you\u2019re using ASP.NET Web API, you just click [Change Authentication] button in the project creation wizard and set-up the Azure AD information. (See the following screen.)<\/p>\n<p>If you\u2019re using other programming language, see \u201c<a href=\"https:\/\/blogs.msdn.microsoft.com\/tsmatsuz\/2015\/02\/17\/azure-ad-service-access-token-validation-check\/\" rel=\"noopener\" target=\"_blank\">How to build API secured by Azure AD<\/a>\u201d (Japanese) in my previous post.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_1.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5362\" height=\"335\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_1.jpg\" width=\"460\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_1.jpg 460w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_1-300x218.jpg 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/a><\/p>\n<p>Note : You can also use the Azure App Service (API App) and [Authentication \/ Authorization] settings (so called \u201cEasy Auth\u201d) for every programming languages.<br \/>\nSee \u201c<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/app-service-authentication-overview\" rel=\"noopener\" target=\"_blank\">Authentication and authorization in Azure App Service<\/a>\u201d for details.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5363\" height=\"424\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_2.jpg\" width=\"395\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_2.jpg 395w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_2-279x300.jpg 279w\" sizes=\"auto, (max-width: 395px) 100vw, 395px\" \/><\/p>\n<p>Next you must prepare the swagger specification file (json file).<br \/>\nIf you use ASP.NET Web API, you can insert \u201cSwashbuckle\u201d Nuget package and download this json by accessing http:\/\/{your root URL}\/swagger\/docs\/v1.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_3.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5364\" height=\"315\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_3.jpg\" width=\"460\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_3.jpg 460w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_3-300x205.jpg 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/a><\/p>\n<p>The next is one of the swagger specification example. Especially, you must remember operationId value (the following \u201cValues_Get\u201d), because we use this operation in the PowerApps later.<\/p>\n<p>In the swagger specification, you must add the following \u201csecurityDefinitions\u201d section, and set Azure AD authentication information as follows.<\/p>\n<pre class=\"prettyprint\">{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"v1\",\n    \"title\": \"TestApi01\"\n  },\n  \"host\": \"demo.azurewebsites.net\",\n  \"schemes\": [\n    \"https\"\n  ],\n  \"paths\": {\n    \"\/api\/Values\/{id}\": {\n      \"get\": {\n        \"tags\": [\n          \"Values\"\n        ],\n        \"operationId\": \"Values_Get\",\n        \"consumes\": [\n        ],\n        \"produces\": [\n          \"application\/json\",\n          \"text\/json\",\n          \"application\/xml\",\n          \"text\/xml\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int32\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"OK\",\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        }\n      },\n      . . .\n    }\n  },\n  \"definitions\": {\n  },\n  <strong>\"securityDefinitions\": {\n    \"oauth2\": {\n      \"type\": \"oauth2\",\n      \"flow\": \"implicit\",\n      \"authorizationUrl\": \"https:\/\/login.windows.net\/common\/oauth2\/authorize\",\n      \"scopes\": {\n      }\n    }\n  }<\/strong>\n}<\/pre>\n<p>If you use Swashbuckle in your ASP.NET Web API project, you just insert the following code (bold font) in App_Start\\SwaggerConfig.cs.<\/p>\n<pre class=\"prettyprint\">public class SwaggerConfig\n{\n  public static void Register()\n  {\n    var thisAssembly = typeof(SwaggerConfig).Assembly;\n    GlobalConfiguration.Configuration\n      .EnableSwagger(c =&gt;\n        {\n          c.SingleApiVersion(\"v1\", \"TestApi01\");\n          . . .\n          <strong>c.OAuth2(\"oauth2\")\n            .AuthorizationUrl(\"https:\/\/login.windows.net\/common\/oauth2\/authorize\")\n            .Flow(\"implicit\")\n            .Scopes(scopes =&gt;\n            {\n              \/\/scopes.Add(\"xxxxx\", \"Some access to protected resources\");\n            });<\/strong>\n        })\n      .EnableSwaggerUi(c =&gt;\n        {\n          . . .\n        });\n  }\n}<\/pre>\n<h3>Register APIs in Azure AD<\/h3>\n<p>In the case of Azure AD, the custom api proxy in the Microsoft Flow or PowerApps retrieves the access token for your web api resource, and calls your web api by setting this token in the http header.<br \/>\ni.e, <strong>you must register both the custom api proxy app and your web api app<\/strong> in the Azure AD, and set the permission between custom api proxy and your web api.<\/p>\n<p>Note : If you have used the previous [Change Authentication] button in ASP.NET Web API, the web api app is already registered in Azure AD.<\/p>\n<p>The following illustrates this.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5365\" height=\"359\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_4.jpg\" width=\"510\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_4.jpg 510w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_4-300x211.jpg 300w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/p>\n<p>When you register the custom api proxy (Azure AD app of Microsoft Flow or PowerApps side), you must add the following url (fixed value) as the redirect url. Both Microsoft Flow and PowerApps uses this redirect url, when processing OAuth.<\/p>\n<pre><code>https:\/\/msmanaged-na.consent.azure-apim.net\/redirect<\/code><\/pre>\n<p>Currently (in Nov 2016), the Azure AD v2 endpoint is not supported (but v1 only) for this scenario, and you must use the Azure Classic Portal (<a href=\"https:\/\/manage.windowsazure.com\/\" rel=\"noopener\" target=\"_blank\">https:\/\/manage.windowsazure.com\/<\/a>), not Azure Ibiza Portal (<a href=\"https:\/\/portal.azure.com\/\" rel=\"noopener\" target=\"_blank\">https:\/\/portal.azure.com<\/a>).<br \/>\nAnd you must set the custom api proxy\u2019s permissions for accessing your web api in the Azure Classic Portal. (You cannot set this permission and cannot see the resource id in the Ibiza portal today.)<\/p>\n<p>See the following screenshot.<\/p>\n<p>Note : Strictly speaking, v2.0 endpoint (Azure AD v2 endpoint) is supported in the custom api. But, this proxy and web api flow (see the illustration above) is not supported for v2.0 endpoint.<br \/>\nPlease refer the next Google scenario (flow) for the v2.0 endpoint.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_5.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5366\" height=\"336\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_5.jpg\" width=\"509\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_5.jpg 509w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_5-300x198.jpg 300w\" sizes=\"auto, (max-width: 509px) 100vw, 509px\" \/><\/a><\/p>\n<h3>How to work (or use) in PowerApps<\/h3>\n<p>Now you\u2019re ready to use the custom api in Microsoft Flow and PowerApps. Here I show you the step of setting PowerApps.<\/p>\n<p>Note : For the details of this procedure, please refer the official document \u201c<a href=\"https:\/\/powerapps.microsoft.com\/en-us\/tutorials\/register-custom-api\/\" rel=\"noopener\" target=\"_blank\">Register Custom APIs in PowerApps<\/a>\u201c.<\/p>\n<p>First you login to PowerApps (<a href=\"https:\/\/web.powerapps.com\/\" rel=\"noopener\" target=\"_blank\">https:\/\/web.powerapps.com\/<\/a>), and select [Connections] in the navigation, and click [New connection].<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_6.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5367\" height=\"155\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_6.jpg\" width=\"460\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_6.jpg 460w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_6-300x101.jpg 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/a><\/p>\n<p>Select [Custom] tab and click [New custom API].<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_7.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5368\" height=\"180\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_7.jpg\" width=\"460\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_7.jpg 460w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_7-300x117.jpg 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/a><\/p>\n<p>In the next window, upload the swagger specification file (json) previously created.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_8.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5369\" height=\"350\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_8.jpg\" width=\"460\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_8.jpg 460w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_8-300x228.jpg 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/a><\/p>\n<p>The swagger specification is parsed and the identity provider is auto-detected by the PowerApps.<br \/>\nYou must set some api information in the next window like the following screenshot. Note that this client id and secret is for the previous custom api proxy, not your web api. The Resource URL (the accessing scopes) is the ID\/URI of your web api, not the custom api proxy.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_9.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5370\" height=\"400\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_9.jpg\" width=\"460\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_9.jpg 460w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_9-300x261.jpg 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/a><\/p>\n<p>The connection settings of the custom api has done. Next you start to create the app in the PowerApps.<\/p>\n<p>Click [New App] button, and select [Phone layout] in the [Blank app].<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_10.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5371\" height=\"324\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_10.jpg\" width=\"460\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_10.jpg 460w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_10-300x211.jpg 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/a><\/p>\n<p>In the design window, select [Content] \u2013 [Data sources] menu.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2016\/11\/custom-api-with-authentication_11.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5383\" height=\"332\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2016\/11\/custom-api-with-authentication_11.jpg\" width=\"448\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2016\/11\/custom-api-with-authentication_11.jpg 448w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2016\/11\/custom-api-with-authentication_11-300x222.jpg 300w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/a><\/p>\n<p>The data source window is displayed in the right pane, and click [Add data source] button, and [New connection] button.<br \/>\nYou can find the previously created custom api, and select (connect) that.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_12.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5373\" height=\"469\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_12.jpg\" width=\"323\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_12.jpg 323w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_12-207x300.jpg 207w\" sizes=\"auto, (max-width: 323px) 100vw, 323px\" \/><\/a><\/p>\n<p>Then the Azure AD sign-in UI is displayed, and you must enter your credential.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_13.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5374\" height=\"293\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_13.jpg\" width=\"510\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_13.jpg 510w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_13-300x172.jpg 300w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p>The custom api is inserted as the data source.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_14.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5375\" height=\"420\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_14.jpg\" width=\"510\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_14.jpg 510w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_14-300x247.jpg 300w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p>Let\u2019s test this custom api !<\/p>\n<p>Please insert the button control into your app, and input the following expression as the button \u201cOnSelect\u201d function (fx).<br \/>\nThis is calling the \u201cValuesGet\u201d method (see the previous \u201coperationId\u201d in the swagger file) in the custom api named \u201cTestApi01\u201d, and setting the string result in the context variable named \u201cResultValue\u201d.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_15.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5376\" height=\"347\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_15.jpg\" width=\"509\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_15.jpg 509w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_15-300x205.jpg 300w\" sizes=\"auto, (max-width: 509px) 100vw, 509px\" \/><\/a><\/p>\n<pre class=\"prettyprint\">UpdateContext( { ResultValue : TestApi01.ValuesGet(3) } )<\/pre>\n<p>Note : You can use auto-correct or suggestions when you\u2019re writing functions.<\/p>\n<p>Next you insert the text box, and set \u201cResultValue\u201d (the context variable previously created) in the text box function.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_16.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5377\" height=\"233\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_16.jpg\" width=\"511\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_16.jpg 511w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_16-300x137.jpg 300w\" sizes=\"auto, (max-width: 511px) 100vw, 511px\" \/><\/a><\/p>\n<p>Push run button, and this app is launched in the web browser.<br \/>\nWhen you push the button in the app, your web api is called by the PowerApps and the returned value is displayed in the text box.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_17.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5378\" height=\"370\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_17.jpg\" width=\"460\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_17.jpg 460w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_17-300x241.jpg 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/a><\/p>\n<p>In the backend, the following http request is called against your web api.<br \/>\nThen your web api can verify the token (the following \u201cAuthorization\u201d header value) and retrieve the claims. Please see\u00a0 \u201c<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/active-directory-devquickstarts-webapi-dotnet\" rel=\"noopener\" target=\"_blank\">Protect a Web API using Bearer tokens from Azure AD<\/a>\u201d for this programming when you\u2019re using ASP.NET Web API..<\/p>\n<pre class=\"prettyprint\">GET \/api\/Values\/3\nAccept: *\/*\nAuthorization: Bearer eyJ0eXAiOi...\nOrigin: https:\/\/us.create.powerapps.com\nX-Ms-Apim-Tokens: ew0KICAidG...\n<\/pre>\n<pre class=\"prettyprint\">HTTP\/1.1 200 OK\nContent-Type: application\/json; charset=utf-8\n\"you entered 3\"\n<\/pre>\n<p>Note : The \u201cX-Ms-Apim-Tokens\u201d header is also important, and I explain this later. (In the case of Azure AD, there\u2019s no need to use this token.)<\/p>\n<p>This token (\u201cAuthorization\u201d header value) is the Azure AD access token itself. Then you can also get the access token for another resources in your web api by calling the following OAuth on_behalf_of flow.<br \/>\nThat is, your web api can collaborate another Azure AD resources like Office 365 API, Azure ARM REST, Power BI REST, etc.<\/p>\n<pre class=\"prettyprint\">POST https:\/\/login.microsoftonline.com\/common\/oauth2\/token\nContent-Type: application\/x-www-form-urlencoded\ngrant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&amp;assertion={received access token}&amp;requested_token_use=on_behalf_of&amp;resource={resource id that your api wants to access}&amp;scope=openid&amp;client_id={client id of your web api}&amp;client_secret={client secret of your web api}<\/pre>\n<p>You can share your app to other people in the same organization.<br \/>\nThe sign-in for this custom api, i.e, Azure AD sign-in is needed, when the user launch this app for the first time.\u00a0 (see the following screenshot)<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_18.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5379\" height=\"385\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_18.jpg\" width=\"329\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_18.jpg 329w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_18-256x300.jpg 256w\" sizes=\"auto, (max-width: 329px) 100vw, 329px\" \/><\/a><\/p>\n<h3>Other Providers (the case of Google)<\/h3>\n<p>You can also use the OAuth 2.0 of Google, Facebook, Salesforce and other SaaS applications including the generic OAuth 2.0 providers. (see the official document \u201c<a href=\"https:\/\/flow.microsoft.com\/en-us\/documentation\/register-custom-api\/\" rel=\"noopener\" target=\"_blank\">Register Custom APIs in Microsoft Flow<\/a>\u201c. The flow by API Key and Basic Authentication are also supported.)<\/p>\n<p>Let\u2019s see the case of Google account.<\/p>\n<p>Google and most providers are not having api registration, only client registration. (Except for the app context like api key.)<br \/>\nTherefore, you register only the custom api proxy as OAuth client into Google Developer Console, get access token for pre-defined Google scopes only (profile, email, etc), and pass this token to your web api. (Or you could use the api key instead.)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5380\" height=\"385\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_19.jpg\" width=\"566\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_19.jpg 566w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_19-300x204.jpg 300w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><\/p>\n<p>Next is the swagger example for Google account settings. (see the bold font)<\/p>\n<pre class=\"prettyprint\">{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"v1\",\n    \"title\": \"TestApi01\"\n  },\n  \"host\": \"demo.azurewebsites.net\",\n  \"schemes\": [\n    \"https\"\n  ],\n  \"paths\": {\n    \"\/api\/Values\/{id}\": {\n      \"get\": {\n        \"tags\": [\n          \"Values\"\n        ],\n        \"operationId\": \"Values_Get\",\n        \"consumes\": [\n        ],\n        \"produces\": [\n          \"application\/json\",\n          \"text\/json\",\n          \"application\/xml\",\n          \"text\/xml\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int32\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"OK\",\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        }\n      },\n      . . .\n    }\n  },\n  \"definitions\": {\n  },\n  <strong>\"securityDefinitions\": {\n    \"oauth2\": {\n      \"type\": \"oauth2\",\n      \"flow\": \"accessCode\",\n      \"authorizationUrl\": \"https:\/\/accounts.google.com\/o\/oauth2\/auth\",\n      \"tokenUrl\": \"https:\/\/www.googleapis.com\/oauth2\/v4\/token\",\n      \"scopes\": {\n      }\n    }\n  }<\/strong>\n}<\/pre>\n<p>PowerApps (or Microsoft Flow) automatically detects Google account, and when you connect to the custom api, the Google account login is displayed as the following screenshot.<\/p>\n<p><a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_20.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5381\" height=\"261\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_20.jpg\" width=\"460\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_20.jpg 460w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_20-300x170.jpg 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/a><br \/>\n<a href=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_21.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5382\" height=\"359\" src=\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_21.jpg\" width=\"510\" srcset=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_21.jpg 510w, https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_21-300x211.jpg 300w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p>Next is the http request for your web api.<br \/>\nIt is the same like Azure AD, but not. The \u201cAuthorization\u201d header value is the access token for Google scopes, not for your web api.<\/p>\n<pre class=\"prettyprint\">GET \/api\/Values\/3\nAccept: *\/*\nAuthorization: Bearer ya29.Ci-aAy...\nOrigin: https:\/\/us.create.powerapps.com\nX-Ms-Apim-Tokens: ew0KICAidG...<\/pre>\n<p>Therefore you cannot verify this access token in your web api, but you can verify the login user instead of using <strong>X-Ms-Apim-Tokens<\/strong>. This token (X-Ms-Apim-Tokens) is the Base64 Url encoded value (see RFC 4648) of the following json string, and as you can see, the value includes the refresh token and id token of Google account. As a result, you can decode the id token value, and retrieve the user claims, verify the digital signature.<\/p>\n<pre class=\"prettyprint\">{\n  \"token\": {\n    \"AccessToken\": \"ya29.Ci-aAy...\",\n    \"ExpiresIn\": \"3600\",\n    \"IdToken\": \"eyJhbGciOi...\",\n    \"RefreshToken\": \"1\/udVjULwb...\",\n    \"TokenType\": \"Bearer\",\n    \"OAuth2TokenEndPointCredentialLocation\": \"Body\",\n    \"ExpiresOn\": \"636150505441694110\",\n    \"LoginSettingId\": \"msmanaged-na_customapidemo02.5f989...\",\n    \"TokenAcquireTime\": \"11\/18\/2016 6:22:24 AM\"\n  },\n  \"sku\": \"Enterprise\",\n  \"$connectionCreator\": {\n    \"objectId\": \"cf258756-2623-47cb-be46-c85d436265bb\",\n    \"tenantId\": \"3c839350-a414-442a-9585-8db0b0f5f300\",\n    \"userPrincipalName\": \"tsmatsuz@o365directory.onmicrosoft.com\"\n  },\n  \"$ConnectionKey\": \"Key eyJ0eXAiOi...\",\n  \"$callerIdentity\": {\n    \"objectid\": \"cf258756-2623-47cb-be46-c85d436265bb\",\n    \"prinicipaltype\": \"ActiveDirectory\",\n    \"tenantid\": \"3c839350-a414-442a-9585-8db0b0f5f300\",\n    \"email\": \"tsmatsuz@o365directory.onmicrosoft.com\"\n  }\n}<\/pre>\n<p>If your web api doesn\u2019t need the login user, you could use the api key instead.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Guest blog post from Tsuyoshi Matsuzaki, where he shows us how to build an use a custom api and the authentication with Azure AD and Google account<\/p>\n","protected":false},"author":100,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ms_queue_id":[],"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","_alt_title":"","ms-ems-related-posts":[],"footnotes":""},"audience":[3378],"content-type":[],"job-role":[],"product":[3473],"property":[],"topic":[3421],"coauthors":[2098],"class_list":["post-274","post","type-post","status-publish","format-standard","hentry","audience-it-professional","product-power-apps","topic-application-modernization"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Guest Blog: Build Custom API on Microsoft Flow and PowerApps with Authentication - Microsoft Power Platform Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Guest Blog: Build Custom API on Microsoft Flow and PowerApps with Authentication - Microsoft Power Platform Blog\" \/>\n<meta property=\"og:description\" content=\"Guest blog post from Tsuyoshi Matsuzaki, where he shows us how to build an use a custom api and the authentication with Azure AD and Google account\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-apps\/custom-api-with-authentication\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft Power Platform Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-11-28T14:00:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-11T15:16:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"460\" \/>\n\t<meta property=\"og:image:height\" content=\"335\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Pratap Ladhani\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pratap Ladhani\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/\"},\"author\":[{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/author\/pratap-ladhani\/\",\"@type\":\"Person\",\"@name\":\"Pratap Ladhani\"}],\"headline\":\"Guest Blog: Build Custom API on Microsoft Flow and PowerApps with Authentication\",\"datePublished\":\"2016-11-28T14:00:56+00:00\",\"dateModified\":\"2025-06-11T15:16:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/\"},\"wordCount\":1477,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_1.jpg\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/\",\"name\":\"Guest Blog: Build Custom API on Microsoft Flow and PowerApps with Authentication - Microsoft Power Platform Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_1.jpg\",\"datePublished\":\"2016-11-28T14:00:56+00:00\",\"dateModified\":\"2025-06-11T15:16:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#primaryimage\",\"url\":\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_1.jpg\",\"contentUrl\":\"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_1.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Guest Blog: Build Custom API on Microsoft Flow and PowerApps with Authentication\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/\",\"name\":\"Microsoft Power Platform Blog\",\"description\":\"Innovate with Business Apps\",\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization\",\"name\":\"Microsoft Power Platform Blog\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png\",\"width\":194,\"height\":145,\"caption\":\"Microsoft Power Platform Blog\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/person\/b65835b61629a2fd09f24a46fceb2bff\",\"name\":\"Pratap Ladhani\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/5618b02062e59f576de7da01b4a7df3f64188961e5588a611d8d09b7606c550f?s=96&d=mm&r=gef2fe6828f30df80244cfd43b7ca6b57\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5618b02062e59f576de7da01b4a7df3f64188961e5588a611d8d09b7606c550f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5618b02062e59f576de7da01b4a7df3f64188961e5588a611d8d09b7606c550f?s=96&d=mm&r=g\",\"caption\":\"Pratap Ladhani\"},\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/author\/pladhani\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Guest Blog: Build Custom API on Microsoft Flow and PowerApps with Authentication - Microsoft Power Platform Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/","og_locale":"en_US","og_type":"article","og_title":"Guest Blog: Build Custom API on Microsoft Flow and PowerApps with Authentication - Microsoft Power Platform Blog","og_description":"Guest blog post from Tsuyoshi Matsuzaki, where he shows us how to build an use a custom api and the authentication with Azure AD and Google account","og_url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-apps\/custom-api-with-authentication\/","og_site_name":"Microsoft Power Platform Blog","article_published_time":"2016-11-28T14:00:56+00:00","article_modified_time":"2025-06-11T15:16:34+00:00","og_image":[{"width":460,"height":335,"url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2019\/08\/custom-api-with-authentication_1.jpg","type":"image\/jpeg"}],"author":"Pratap Ladhani","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Pratap Ladhani","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#article","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/"},"author":[{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/author\/pratap-ladhani\/","@type":"Person","@name":"Pratap Ladhani"}],"headline":"Guest Blog: Build Custom API on Microsoft Flow and PowerApps with Authentication","datePublished":"2016-11-28T14:00:56+00:00","dateModified":"2025-06-11T15:16:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/"},"wordCount":1477,"commentCount":0,"publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#primaryimage"},"thumbnailUrl":"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_1.jpg","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/","name":"Guest Blog: Build Custom API on Microsoft Flow and PowerApps with Authentication - Microsoft Power Platform Blog","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#primaryimage"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#primaryimage"},"thumbnailUrl":"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_1.jpg","datePublished":"2016-11-28T14:00:56+00:00","dateModified":"2025-06-11T15:16:34+00:00","breadcrumb":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#primaryimage","url":"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_1.jpg","contentUrl":"https:\/\/powerappsblogmedia.azureedge.net\/powerappsblog\/2019\/08\/custom-api-with-authentication_1.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/2016\/11\/28\/custom-api-with-authentication\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/"},{"@type":"ListItem","position":2,"name":"Guest Blog: Build Custom API on Microsoft Flow and PowerApps with Authentication"}]},{"@type":"WebSite","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/","name":"Microsoft Power Platform Blog","description":"Innovate with Business Apps","publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization","name":"Microsoft Power Platform Blog","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png","contentUrl":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png","width":194,"height":145,"caption":"Microsoft Power Platform Blog"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/person\/b65835b61629a2fd09f24a46fceb2bff","name":"Pratap Ladhani","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5618b02062e59f576de7da01b4a7df3f64188961e5588a611d8d09b7606c550f?s=96&d=mm&r=gef2fe6828f30df80244cfd43b7ca6b57","url":"https:\/\/secure.gravatar.com\/avatar\/5618b02062e59f576de7da01b4a7df3f64188961e5588a611d8d09b7606c550f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5618b02062e59f576de7da01b4a7df3f64188961e5588a611d8d09b7606c550f?s=96&d=mm&r=g","caption":"Pratap Ladhani"},"url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/author\/pladhani\/"}]}},"bloginabox_animated_featured_image":null,"bloginabox_display_generated_audio":false,"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft Power Platform Blog","distributor_original_site_url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/posts\/274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/users\/100"}],"replies":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/comments?post=274"}],"version-history":[{"count":1,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/posts\/274\/revisions"}],"predecessor-version":[{"id":131379,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/posts\/274\/revisions\/131379"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/media?parent=274"}],"wp:term":[{"taxonomy":"audience","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/audience?post=274"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/content-type?post=274"},{"taxonomy":"job-role","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/job-role?post=274"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/product?post=274"},{"taxonomy":"property","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/property?post=274"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/topic?post=274"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/coauthors?post=274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}