Advanced Access Gateway policy examples
This topic provides advanced policy configuration examples. These examples are for illustration and educational purposes only.
- Fix the case of all URI strings
- Select the fields to send to specific URLs
- Set a timeout for large file uploads and downloads
- Send a specific error code and URL to a URI
- Specify a behavior based on query arguments
- Rewrite URL strings
- Don't protect certain file types
- Extend AJAX session handling
- Reject requests with certain characters
- WebSocket security
Fix the case of all URI strings
|
Description |
Convert all URI strings to lower case. |
|
Scenario |
Some systems may interpret the upper and lower case versions of a character as different letters. Enter all letters in lower case to avoid this situation. |
|
Configuration |
Configure a protected rule that applies this setting to the |
|
Example |
|
Select the fields to send to specific URLs
|
Description |
Specify the fields to include in a request to a specific URL. |
|
Scenario |
You want to send only the fields that are needed for processing a request. This lets you avoid sending unneeded information, save bandwidth and storage, and so on. |
|
Configuration |
Click the pencil icon beside the name of an attribute. To include the attribute, turn on the toggle switch so that it says Send. To exclude the attribute, turn off the toggle. |
|
Example |
Add a variable to a header.
|
Set a timeout for large file uploads and downloads
|
Description |
Set the timeout limit for uploading and downloading large files. |
|
Scenario |
Access Gateway returns network failed error messages when uploading or downloading large files. |
|
Configuration |
Open a protected or default rule for a resource and specify the timeout period in . |
|
Example |
|
Send a specific error code and URL to a URI
|
Description |
Return a specific return code and URL for a given URI. |
|
Scenario |
You don't want users to see the default error message and you want to redirect them to a custom HTML page. |
|
Configuration |
Configure a protected rule that specifies the return code and URL. |
|
Example |
|
Specify a behavior based on query arguments
|
Description |
You want to configure dynamic responses for different situations. |
|
Scenario |
You want to skip authentication when testing configurations. |
|
Configuration |
Configure protected rules that determine what happens when certain conditions exist. |
|
Example |
|
Rewrite URL strings
|
Description |
When URL rewrites are enabled in the gateway, some links and redirects point the browser to the wrong URL. |
|
Scenario |
You have a public domain called |
|
Configuration |
Configure protected rules for redirecting requests from one URL to another. |
|
Notes |
By default |
|
Example for a single redirect |
|
|
Example for multiple redirects |
|
Redirect non-Chrome agents to a different location
|
Description |
Redirect all users not using a specific user agent (in this case, Chrome) to a different URL. |
|
Scenario |
You want to prevent bots and other automatic requests from sending requests to your servers. |
|
Configuration |
Configure a protected rule where Access Gateway redirects requests from non-Chrome agents to a specific URL and returns 301 (moved permanently). |
|
Example |
|
Don't protect certain file types
|
Description |
You don't want to protect certain file types, like images and style sheets. |
|
Scenario |
Your previous platform allowed unrestricted access to images, style sheets, and similar files. You want to do the same with Access Gateway. |
|
Configuration |
Configure a protected rule for each file type that you don't want to protect. |
|
Example |
|
Extend AJAX session handling
|
Description |
Apps that use AJAX calls hang or require a refresh after a session timeout. |
|
Scenario |
An app makes AJAX calls. It's idle for a period and the session times out. When the app makes a follow-up AJAX call, it fails because the session is now inactive. |
|
Configuration |
Configure a protected rule to extend the session. |
|
Notes |
The example scripts run at the defined interval to check if a user session is inactive. When a user session expires, the script alerts the user and refreshes the page. The user then gets a new session if an Okta session exists. Otherwise, the user must reauthenticate. The scripts accept three parameters:
If the app page includes the JQuery library, follow the examples that include JQuery. |
|
Example 1 |
The app uses JQuery. Replace the sample message with a customer-facing message.
|
|
Example 2 |
The app doesn't use JQuery. Replace the sample message with a customer-facing message.
|
|
Example 3 |
The app uses iFrame and JQuery. Identify a tag to replace, represented by <tag-to-replace>, in one of the iFrame pages.
|
|
Example 4 |
The app uses iFrame and doesn't use JQuery. Identify a tag to replace, represented by <tag-to-replace>, in one of the iFrame pages.
|
Reject requests with certain characters
|
Description |
Reject requests that contain risky characters. |
|
Scenario |
Certain characters are used in attacks on back-end web apps. Rejecting requests that contain these characters removes a potential attack surface. |
|
Configuration |
Configure a protected rule that contains the characters you want to block. |
|
Example |
|
WebSocket security
|
Description |
Translate HTTP calls to WebSocket (WSS) calls. |
|
Scenario |
You use WSS as a communications protocol. Access Gateway must tell the back-end server that it's translating calls from HTTP to WSS. |
|
Configuration |
Create a protected rule for each WSS resource:
|
|
Example |
|