Custom connectors, in Microsoft Power Automate, are user-defined schemas that enable a flow, an app, or a service to interact with a custom or legacy system. They extend the capabilities of Power Automate beyond its standard connectors. To ensure secure interactions between these systems, custom connectors need to implement some authentication method.
Authentication ensures the identity of the entities involved in a communication process. It is a crucial step in maintaining the security and integrity of the systems involved. There are four types of authentication supported by custom connectors in Power Automate:
- No authentication
- Basic
- API key
- OAuth 2.0
While ‘No authentication’ implies there is no need for a security mechanism, it is rarely recommended for production connectors due to associated security risks.
Basic Authentication
Basic authentication requires a username and password in every request sent to the API endpoint. This method is widely used and easy to implement; however, it requires handling sensitive data and should only be utilized over encrypted channels.
Example of a Basic authentication setup in custom connector’s configuration:
“authenticationType”: “Basic”,
“identityProviders”: [“basic”],
…
API Key Authentication
API key authentication is another approach where an API key serves as a secret token that the client must send in each API request. This API key can be in the header, query string, or body of the API request. Although very popular due to its simplicity, it does not have any built-in provisions for expiration, revocations or key rotations like modern authentication techniques like OAuth do.
Example of an API key authentication setup in custom connector’s configuration:
“authenticationType”: “apiKey”,
“identityProviders”: [“api key”],
…
OAuth 2.0 Authentication
OAuth 2.0 is a popular choice for custom connector authentication provided the target API supports it. It is a protocol that allows an application to access specific parts of a user’s data without sharing complete credentials. Instead, authorization tokens are used, which limit the scope of what an app can do and can be revoked at any time by the user.
Example of an OAuth 2.0 authentication setup in custom connector’s configuration:
“authenticationType”: “oauth2”,
“identityProviders”: [“oauth2”],
…
Conclusion
The authentication method you choose while implementing custom connectors in Power Automate depends on several factors, including the target API’s support and the sensitive nature of the data your app handles. While basic authentication and API key authentication are simple and easy to implement, OAuth 2.0 provides far more security and control over user data. Understanding these options is essential for the PL-500 Microsoft Power Automate RPA Developer exam and for effectively applying the principles of Power Automate in real-world scenarios.
Practice Test
True or False: Custom connectors, once created in Power Automate or Power Apps, do not require any form of authentication.
- True
- False
Answer: False.
Explanation: After creating a custom connector, you must define the authentication type that the connector uses to interact with the RESTful API.
What is the authentication type required if you’re connecting to an API secured via Azure Active Directory?
- A. OAuth 0
- B. API Key
- C. Basic
- D. None
Answer: A. OAuth 0
Explanation: OAuth 0 is commonly used to secure APIs tied to Azure Active Directory.
True or False: Anonymous authentication can be used for custom connectors in Power Automate.
- True
- False
Answer: True.
Explanation: There are several ways to authenticate a custom connector in Power Automate. One way is None or anonymous authentication. It’s used when a service doesn’t require any authentication.
In which of the following scenarios would API Key authentication be used for custom connectors?
- A. The service requires OAuth 0
- B. The service does not require any authentication
- C. The service requires a subscription key
- D. The service is secured by Azure Active Directory
Answer: C. The service requires a subscription key
Explanation: API Key authentication is used when the web service provides an API or subscription key on sign-up, which is passed in the header of HTTP requests.
True or False: Custom connectors can have multiple authentication methods.
- True
- False
Answer: False.
Explanation: A custom connector can only use one authentication method at a time.
Basic authentication in custom connectors requires which two pieces of information?
- A. Client ID and client secret
- B. Refresh token and access token
- C. Username and Password
- D. API Key and client secret
Answer: C. Username and Password
Explanation: Basic authentication requires a username and password to authenticate the connection.
True or False: Custom connectors can be used to connect to on-premises data sources.
- True
- False
Answer: True.
Explanation: By using an on-premise data gateway, Power Automate can connect to on-premises data sources through custom connectors.
Which of the following authentication types for custom connectors in Power Automate is best suited for cloud-based APIs?
- A. Basic
- B. OAuth 0
- C. API Key
- D. All of the above
Answer: B. OAuth 0
Explanation: OAuth 0 is typically utilized for securing cloud-based APIs as it is one of the most secure and commonly used methods.
Authorization Base URL is a mandatory field to be filled in the OAuth 0 authentication process for a custom connector.
- A. True
- B. False
Answer: A. True
Explanation: The Authorization Base URL directs the user to the login page of the identity provider in an OAuth 0 flow, thus it is a required field.
True or False: Refresh URLs are not required for API key authentication in custom connectors.
- True
- False
Answer: True.
Explanation: Refresh URLs are necessary for OAuth 0 authentication to refresh access tokens, but they are not required for API key authentication.
Does the ‘None’ Type of authentication mean that there is no security for the custom connector?
- A. Yes
- B. No
Answer: B. No
Explanation: ‘None’ type of authentication just means that there are no special requirements for authentication, it doesn’t imply a lack of security measures.
Standards-compliant OAuth 0 requires which of the following fields:
- A. Client ID
- B. Client Secret
- C. Login URL
- D. All of the above
Answer: D. All of the above
Explanation: To implement OAuth 0, you are required to input the client ID, client secret, and the login URL.
True or False: Custom connector’s definition includes a host.
- True
- False
Answer: True.
Explanation: The host is a part of the custom connector’s base URL and must be specified within its definition.
When defining actions in a custom connector, which HTTP methods can be used?
- A. GET
- B. POST
- C. PUT
- D. All of the above
Answer: D. All of the above
Explanation: Defining actions in a custom connector allows for a variety of HTTP methods, including GET, POST, and PUT.
Custom connectors can be used in _______.
- A. Power Apps
- B. Power Automate
- C. Both A & B
- D. Neither A nor B
Answer: C. Both A & B
Explanation: Custom connectors can extend Power Apps and Power Automate to suit precise, specific needs by enabling them to connect to the APIs you define in the custom connector.
Interview Questions
What is the primary use of custom connectors in Power Automate?
Custom connectors in Power Automate are primarily used to extend connectivity and interaction with different services not available out-of-the-box, by defining APIs for such services.
What types of authentication do custom connectors in Power Automate support?
Custom connectors in Power Automate support various types of authentication, such as No authentication, Basic authentication, API key, and OAuth 2.0.
What is OAuth 2.0 in the context of custom connectors?
OAuth 2.0 is a protocol that allows applications to gain limited access to user accounts on an HTTP service, such as Facebook, GitHub, and Power Automate. It is designed for applications that can store confidential information and are capable of securing a client secret.
How is No Authentication used in the context of custom connectors?
No Authentication is used for custom connectors that require no authentication at all. They allow anonymous access to the API, meaning any public APIs that don’t require authentication can be accessed.
What is Basic Authentication used for in custom connectors?
Basic Authentication is used for APIs that require username and password for access. It involves sending the username and password with each request to the API.
What are API keys in the context of custom connectors?
API keys are codes passed in by computer applications. These keys identify the calling program, its developer, or its user to the website. In Power Automate, API keys are used as a form of authenticating an API request in some connectors.
How can one test a custom connector in Power Automate?
A custom connector in Power Automate can be tested by creating a new connection and making a request to the API.
What do custom connectors in Power Automate require for creating an OAuth2 setup?
Custom connectors in Power Automate require client id and client secret, token URL, refresh URL, authorization URL, and the scope for creating an OAuth2 setup.
Where can you find the client id and client secret necessary for creating OAuth 2.0 setup in custom connectors?
The client id and client secret are typically provided by the service provider when you register your app.
After authentication setup, how can users make use of custom connectors?
Once the authentication setup is complete, users can make use of the custom connectors by connecting through Power Automate, Power Apps, or Azure Logic Apps, and can start making requests to the API.
What is the purpose of the token URL in OAuth 2.0 setup for custom connectors?
The token URL is used by Power Automate to exchange the authorization code for an access token. It is often the URL to which requests are sent for new access tokens or to refresh them.
What role does the scope play in OAuth 2.0 setup for custom connectors?
The scope is a mechanism in OAuth 2.0 that limits an application’s access to a user’s account. It specifies, for example, what data the application is allowed to access and what it can do with that data.
Can endpoints have different types of authentication?
Yes, different endpoints can indeed have different types of authentication in Power Automate’s custom connectors. Each action or trigger can have its own unique authentication type.
Besides the authentication types, what other information does Power Automate need to make authenticated API calls?
Besides the authentication type, Power Automate also needs to know the base URL for API calls, as well as the specific paths for those calls.
What is the prerequisite to implementing authentication for custom connectors in Power Automate?
Before implementing authentication for custom connectors in Power Automate, you must have relevant details about the API such as the base URL and the specific paths for those calls.