Apply policy from API Manager
Now let’s get back to API Manager in the Anypoint Platform and click on the “Bank Accounts” API URL which should take us to Settings page.
10.) Let’s add a new policy by clicking the button “API level policies” and selecting “JWT Validation” from the available in the Security Validation.
| Policy Property | Value |
|---|---|
| JWT origin | HTTP Bearer Authentication Header |
| JWT Signing Method | RSA |
| JWT Signing Key Length | 256 (Look out for checking the supporting key length and other information here) Hit this link in the Postman or any of your favorite tool https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration and you should see the following in the response: “id_token_signing_alg_values_supported”: [ “RS256” ] |
| JWT Key origin | JWKS |
| JWKS Url | You can find the URL from the response from https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration that you hit earlier to find out the JWT Signing Key Length jwks_uri”: “https://login.microsoftonline.com/common/discovery/v2.0/keys“ |
| JWKS Caching TTL (minutes) | 60 |
| JWKS Connection Timeout (milliseconds) | 10000 |
| Skip Client Id Validation | checked |
| Validate Audience Claim | checked |
| Audience Claim Values | Provide the application URI that we generated during application registration in Azure. In my case it is api://cad5e6b1-5482-4a53-90fd-5db00f6bc76f |
Run the JWT validation tests
Let’s test the policy by hitting the application and the proxy. We should see still we should be able to hit the application endpoint without any issue, but for proxy it should throw error.
13.) Hitting Application endpoint| grant_type | client_credentials |
| client_id | client_id copied from the azure portal (application id) |
| client_secret | Secret value copied from the azure portal |
| scope | api://cad5e6b1-5482-4a53-90fd-5db00f6bc76f/.default |
001116448

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.