ags backend-sso-configs
The ags backend-sso-configs command manages the profiles that determine how the identity of the user verified in AGS will be passed to the service at the backend and how the session state of that service will be tracked. Its panel equivalent is the Backend SSO Configurations screen.
The profile does two jobs at once: it adds identity information to the verified requests (a header, Basic Auth, a Bearer token or a cookie) and defines what will happen when the backend loses the session or completes its own logout.
Command Summary
Writing Order
ags backend-sso-configs add name portal-ssoThe only required field is the name; the profile can be created empty and its content can be filled in afterwards with an update.
--injections.0.type header --injections.0.headerName X-User --injections.0.headerValue <user-expression>ags gateway update id <vService> --backendSsoConfig <profile>Required Fields
| Order | Field | Status | Value |
|---|---|---|---|
| 1 | name | Required | The name of the profile |
| — | backendLogoutRedirectHeaderName | Conditionally required | It is asked for only when customHeader is added to the redirection modes |
Every field outside these is optional and is written with the -- prefix. The injections, which are the actual content of the profile, are optional fields too: a profile without injections is valid but does not pass an identity to the backend.
The Injections
Every injection is written with the --injections.N. prefix, with its own index. First the type is selected, then the fields of that type are given.
type | What it does | The fields of that type |
|---|---|---|
header | Adds an HTTP header to the request | --injections.N.headerName · --injections.N.headerValue |
basicAuth | Adds Basic Auth credentials | --injections.N.username · --injections.N.password |
bearer | Adds a Bearer token | --injections.N.token (+ the optional --injections.N.bearerHeaderName) |
cookie | Sends a cookie to the backend | --injections.N.cookieName · --injections.N.cookieValue |
- The value fields accept a smart variable; the information of the verified user is passed from here. The variables that can be used change according to the flow and are listed with Tab. When a variable that contains parentheses is written, the value is put in double quotes.
| Field | What it does | What is written after it |
|---|---|---|
--injections.N.type | Selects the type of the injection; the fields of that type open accordingly | header · basicAuth · bearer · cookie |
--injections.N.cond | Allows the injection to be applied only to certain requests | A condition expression. When it is left empty it is applied to every verified request |
- If
--injections.N.bearerHeaderNameis not given, the header becomesAuthorization. - With
--injections.N.condthe injection is applied only to certain requests; if no condition is given it is applied to every verified request.
The Session Loss and Logout Behavior
| Field | Default | Its function |
|---|---|---|
--backendSessionLostCond | Undefined | The condition that shows the backend has lost the session |
--backendSessionLostStrategy | logout | What will be done on the session loss: logout logs the user out, resync runs the resynchronization step in the flow |
--backendSessionLostMaxAutoRetries | 2 | Only while resync is selected; the number of silent attempts, 0 asks for user interaction every time |
--backendLogoutCond | Undefined | The condition that shows the backend has completed its own logout; on a match the AGS session ends as well |
--backendLogoutRedirectTo | / | The address to be redirected to after the logout |
--backendLogoutRedirectModes.0 | httpRedirect | The redirection mode: httpRedirect and/or customHeader |
backendLogoutRedirectHeaderName | — | Required when customHeader is selected; the name of the header the address will return in |
The condition fields
The --backendSessionLostCond, --backendLogoutCond and --injections.N.cond fields expect a condition expression. The expression can be written on the command line too; the terms that can be used at the point reached are completed with Tab. Building the conditions visually is more practical in the panel.
Examples
Updating and Deleting
The update asks for the identity with the id field and changes only the fields that are written. The injection list is updated with the index; --injections.delete empties the whole list.
Things to Know
- A profile does not work on its own. Until it is bound to a gateway it has no effect; the binding is done with
ags gateway updateand every vService uses a single profile. - The values with parentheses require quotes. The command line counts the
(and)signs as separators; when a smart variable that contains parentheses is written, the whole value is put in double quotes. - The secrets are written on the command line. The Basic Auth password and the Bearer token are not asked for secretly; they appear on the line and fall into the command history.
- The resynchronization step is not defined here. The step to be run when the
resyncstrategy is selected is determined in the flow editor of the vService.
