Hi user123,
Great question! Setting up OAuth 2.0 for custom connectors can be a bit tricky. Here's a breakdown of what you typically need:
1. Identity Provider: If your third-party API uses a standard OAuth 2.0 flow, you'll often select "OAuth 2.0" from the dropdown. Some providers might have specific entries, but usually, the generic OAuth 2.0 works. If it's a well-known provider like Azure AD, Google, etc., you might see those listed.
2. URLs:
- Client ID URL: This is often the same as your Authorization URL or sometimes a specific endpoint for client registration confirmation. Check your API's documentation. Often, it's not strictly required if the authorization server handles it implicitly.
- Authorization URL: This is the endpoint where the user is redirected to grant permission. Example:
https://api.example.com/oauth/authorize
- Token URL: This is the endpoint where your connector exchanges the authorization code (or other grant type) for an access token. Example:
https://api.example.com/oauth/token
- Refresh URL: This is where your connector sends a refresh token to get a new access token when the current one expires. Example:
https://api.example.com/oauth/token (often the same as the Token URL)
Make sure to consult your third-party API's documentation for the exact URLs. They are crucial.
3. Common Pitfalls:
- Redirect URI Mismatch: Ensure the redirect URI registered in the third-party portal exactly matches the one provided by Power Apps (it will be shown in the custom connector editor).
- Scope Issues: If your API uses scopes, make sure you specify the correct scopes in the custom connector definition.
- Client Secret Handling: The client secret is sensitive. Power Platform handles this securely, but double-check you're not exposing it elsewhere.
- Token Expiration: Power Apps custom connectors generally handle token refresh automatically if you've configured the Refresh URL correctly and the API supports refresh tokens.
Can you share the name of the third-party API you're trying to connect to? That might help if there are known specific configurations.
Best regards!