Custom connector with OAuth2: three auth pitfalls we debugged
The article discusses three common pitfalls encountered when creating custom connectors using OAuth2 in Power Automate. These issues can lead to significant delays in development and require careful attention to detail. The author provides solutions to each problem to improve the connector setup process.
- ▪The first pitfall involves hardcoding a tenant-specific redirect URL, which can cause failures when moving between environments.
- ▪The second pitfall relates to refresh token handling, where the absence of a refreshUrl in the connector's configuration leads to unauthorized errors.
- ▪The third pitfall is the requirement of a custom parameter by the API that is not part of the OAuth2 specification, necessitating additional configuration.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3948393) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } SapotaCorp Posted on May 24 • Originally published at sapotacorp.vn on May 24 Custom connector with OAuth2: three auth pitfalls we debugged #powerplatform A client uses a third-party logistics API that is not in Power Automate's built-in connector catalog. The API speaks OAuth2 authorization code flow. The platform has a "Create a custom connector" flow that claims to handle OAuth2 in a couple of clicks. The first two connectors we built this way worked.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).