Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Certified MuleSoft Platform Architect (Mule-Arch-201) Exam - Topic 4 Question 24 Discussion

Posted by Ranee on Jan 25, 2025 at 04:55 AM

An API is protected with a Client ID Enforcement policy and uses the default configuration. Access is requested for the client application to the API, and an approved

contract now exists between the client application and the API

How can a consumer of this API avoid a 401 error "Unauthorized or invalid client application credentials"?

Suggested Answer: C

When using the Client ID Enforcement policy with default settings, MuleSoft expects the client_id and client_secret to be provided in the URI parameters of each request. This policy is typically used to control and monitor access by validating that each request has valid credentials. Here's how to avoid a 401 Unauthorized error:

URI Parameters Requirement:

The default configuration for the Client ID Enforcement policy requires the client_id and client_secret to be included in each request's URI parameters. This is a straightforward way to authenticate API requests without additional configurations.

Why Option C is Correct:

Providing client_id and client_secret in the URI parameters meets the policy's requirements for each request, ensuring authorized access and avoiding the 401 error.

of Incorrect Options:

Option A (sending a token in the header) would be applicable for token-based authentication (like OAuth 2.0), not Client ID Enforcement.

Option B (request body) and Option D (header) are not valid locations for client_id and client_secret under the default configuration of Client ID Enforcement, which expects them in the URI.

Reference For more details, consult MuleSoft's documentation on Client ID Enforcement policies and expected request configurations


Get Premium Salesforce Certified MuleSoft Platform Architect (Mule-Arch-201) Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
36 comments · newest first
JE
Jerry 11 months ago
Agreed, A is the standard practice for API authentication.
LO
Lorriane 11 months ago
Isn't it risky to send client_secret in the request body?
UL
Ulysses 12 months ago
Wait, are we sure C is a bad idea? URI parameters can expose credentials!
LA
Laila 12 months ago
I think D is better, headers are more secure for sensitive info.
CR
Cristy 1 year ago
A is definitely the way to go, always send the token in the header!
CH
Charlesetta 1 year ago
I vaguely recall that sending credentials as URI parameters can expose them in logs, so I think that’s not a good idea. I’d lean towards option D instead.
GW
Gwen 1 year ago
I’m a bit confused about whether sending client_id and client_secret in the body is secure enough. I feel like headers are generally preferred for sensitive data.
MA
Marnie 1 year ago
I think we discussed something similar in class where we had to send credentials in the header. I feel like option A might be the right choice.
LO
Lonna 1 year ago
I remember that sending the token in the header is a common practice, but I'm not sure if that's the only way to avoid the 401 error.
MA
Mammie 1 year ago
The question states that the API is using the default configuration for the Client ID Enforcement policy, so the best way to avoid the 401 error is to send the obtained token as a header in every call. This is the most secure and recommended approach.
BR
Brigette 1 year ago
I'm not entirely sure about this one. Should I be sending the client_id and client_secret in the header or the request body? I want to make sure I understand the right approach before submitting my answer.
GA
Galen 1 year ago
Based on the question, the API is using a Client ID Enforcement policy, so the correct answer is to send the obtained token as a header in every call. This is the standard way to authenticate with an API protected by this type of policy.
RO
Rocco 1 year ago
Hmm, I'm a bit confused. Do I need to send the client_id and client_secret in the request body or as URI parameters? I'm not sure which one is the right approach.
NI
Niesha 1 year ago
The key here is to send the obtained token as a header in every call. That's the correct way to authenticate with the API and avoid the 401 error.
MI
Micah 2 years ago
Wait, we're not supposed to send the client secret as a URI parameter? But that's how I've been doing it all this time! No wonder my API has been getting 'hacked' daily.
JO
Joanne 2 years ago
↳ replying to Micah
B) Send the obtained: client_id and client_secret in the request body
DE
Dewitt 2 years ago
↳ replying to Micah
A) Send the obtained token as a header in every call
SU
Sunshine 2 years ago
Ah, the age-old dilemma of client credentials vs. token-based authentication. I'd say A is the way to go, unless you want your API to be hacked faster than a celebrity's Twitter account.
GA
Gabriele 2 years ago
↳ replying to Sunshine
User 2: Agreed, it's the most secure way to avoid unauthorized access.
JA
Jamal 2 years ago
↳ replying to Sunshine
User 1: I think sending the obtained token as a header is the best option.
EL
Elfrieda 2 years ago
B and C seem like they're just giving away the client secret, which is a big no-no. A is the way to go, no doubt.
VI
Vicky 2 years ago
↳ replying to Elfrieda
User2: Got it, thanks for the clarification
GW
Gwenn 2 years ago
↳ replying to Elfrieda
User3: User1 is right, A is the way to go to avoid exposing client_secret
JU
Junita 2 years ago
↳ replying to Elfrieda
User2: B) Send the obtained: client_id and client_secret in the request body
AR
Ardella 2 years ago
↳ replying to Elfrieda
User1: A) Send the obtained token as a header in every call
LA
Lasandra 2 years ago
Hmm, I'm torn between A and D. I guess I'll go with A, it sounds like the more straightforward option.
LA
Lamonica 2 years ago
↳ replying to Lasandra
Antonio: Definitely, it's important to ensure the client application credentials are valid.
DE
Dean 2 years ago
↳ replying to Lasandra
User 3: I agree, it's the most straightforward option to avoid a 401 error.
AN
Antonio 2 years ago
↳ replying to Lasandra
User 2: Yeah, sending the token as a header in every call seems like the best choice.
JO
Jospeh 2 years ago
↳ replying to Lasandra
User 1: I think option A is the way to go.
TI
Tiffiny 2 years ago
I'm not sure, but I think sending client_id and client_secret in the header makes sense for security reasons.
SH
Sherita 2 years ago
I think the answer is A. Sending the obtained token as a header in every call is the correct way to avoid a 401 error.
GE
German 2 years ago
↳ replying to Sherita
User2: Yes, you're right. That's the way to go to prevent unauthorized access.
KI
Kimbery 2 years ago
↳ replying to Sherita
User1: I think the answer is A. Sending the obtained token as a header in every call is the correct way to avoid a 401 error.
MA
Maybelle 2 years ago
I disagree, I believe the correct answer is D) Send the obtained client_id and client_secret in the header of every API Request call.
MA
Matthew 2 years ago
I think the answer is A) Send the obtained token as a header in every call.
0/2000 characters

Save Cancel