Add available credentials (and the authentication order in which credentials should be chosen) into a cache within the specified session. Using that cached information put only the top selected credential as the credential to be used by the session.
Modified. A session configuration object into which we place cached creds and the selected creds.
Input. The set of arguments with which the calling function is operating. For CLI, the cmdArgs come from the command line, profile, or environment. Other apps can place relevant arguments into this object to be processed by this function.
If cmdArgs is not supplied, we only cache creds found in the sessCfg.
Convert an AUTH_TYPE_CHOICES array to a string that is an appropriate value for the "authOrder" configuration property.
input. An array of auth types.
A string containing a valid value for the authOrder configuration property.
Convert a string that is an appropriate value for the "authOrder" configuration property into an array of AUTH_TYPE_CHOICES.
input. An authOrder property value.
An array of AUTH_TYPE_CHOICES.
Cache the authOrder property from the supplied cmdArgs. If no authOrder exists in cmdArgs, a default authOrder is created and cached.
Modified. A session configuration object into which we store the auth cache.
Input. The set of arguments that the calling function is using.
Cache the named credential into our cache of available credentials.
Input. The name of a cred to be cached in a session.
Modified. A session configuration object.
Input. The set of arguments with which the calling function is operating.
Cache all of the credentials that are available in either the supplied sessCfg object or in the supplied command arguments. Also cache the authOrder that is specified in the supplied command arguments. The cache properties are stored into the sessCfg object itself.
Downstream logic uses this cache to determine which auth type should be used in the final session used by a client REST request.
Modified. A session configuration object to which we place the cached creds.
Input. The set of arguments with which the calling function is operating. For CLI, the cmdArgs come from the command line, profile, or environment. Other apps can place relevant arguments into this object to be processed by this function.
If cmdArgs is not supplied, we only cache creds found in the sessCfg.
Cache the default authentication order to be used when the user has NOT specified an order. No action is performed if the end-user HAS defined an authentication order in their zowe client configuration.
For historical reason, we have 2 default orders. Thus, the caller can specify which of 2 creds to use as the top cred in the authentication order: SessConstants.AUTH_TYPE_BASIC or SessConstants.AUTH_TYPE_TOKEN
Modified. A session configuration object into which we place the default order.
Input. The authentication type that will be used first.
True when the default order was cached. False when the user supplied an order, because you cannot override the user-supplied order with any default.
Choose a default authentication order and place it into the session sessCfg.
Other classes in the Zowe client API (like AbstractRestClient) call cacheDefaultAuthOrder to specify the top default authentication type. If so, we keep any topDefaultAuth that has already been set.
If topDefaultAuth has NOT been set, we set basic authentication as the topDefaultAuth.
Modified. A session configuration object.
Clears the authentication cache.
To get the right creds and auth order in your session after calling this function you must once again call the appropriate combination of: AuthOrder.addCredsToSession AuthOrder.cacheDefaultAuthOrder AuthOrder.putTopAuthInSession
Find the auth cache in the session config. If there is no cache recorded in the session config, create a new auth cache entry.
Input. A session configuration object into which we record any newly created cache.
Form a new auth type array from an existing array and a second array whose members should come first in the new array. Duplicates are removed from the resulting authOrder array. Any auth types from the existing array remain later in the array, unless newAuthsOpts.onlyTheseAuths is true.
input. An existing array of auth types.
input. An array of one or more auth types to be placed at the front of the the existing array of auth types.
input. Options that control some replacement choices.
A new array of AUTH_TYPE_CHOICES.
Returns the cached authentication order. If no auth order exists, we create and return a default auth order.
Modified. The session config from which we retrieve the cached auth order. When no auth order exists in the sessCfg, a default auth order is stored in the sessCfg, before returning that newly created value.
The cached authentication order.
Get the correct property name for use in either a session or in a config file. Currently only certificate property names are different between the two.
input. The name of a property for which we must select the correct name to.
input. Specifies where property is to be used.
The cached authentication order.
Keep the specified credential by deleting it from the set of credentials to remove.
Input. The credential that we want to keep.
Modified. The set of credentials that will be removed.
Record that the session is being used to make a request for a token (ie logging into APIML).
Modified. The session config into which we record that we are requesting a token.
Put the specified array of auth types first in the authOrder for the specified session. Duplicates are removed from the resulting authOrder array. Any existing auth types remain later in the array, unless newAuthsOpts.onlyTheseAuths is true.
Calling apps should NOT use this function to impose a hard-coded authentication order for the session. Users control that decision. Apps should only call this function if the app is implementing a directive from the user which implies that the authOrder should be changed. An example is when a user logs into APIML. The implication is that the user wants to use a token, and that tokens should be at the front of the authentication order.
Modified. The session config into which we place the modified array of auth types.
input. An array of one or more auth types to be placed at the front of the the existing array of auth types.
input. Options that control some replacement choices.
Put the specified array of auth types first in the authOrder property for the specified profile and save it to the client config file on disk. A new authOrder property will be created if needed. Duplicates from any existing authOrder are removed from the resulting authOrder. Any existing auth types remain later in the property value, unless newAuthsOpts.onlyTheseAuths is true.
Calling apps should NOT use this function to impose a hard-coded authentication order for a profile. Users control that decision. Apps should only call this function if the app is implementing a directive from the user which implies that the authOrder should be changed. An example is when a user logs into APIML. The implication is that the user wants to use a token, and that tokens should be at the front of the authentication order.
input. The name of the profile into which the authOrder property will be placed.
input. An array of one or more auth types to be placed at the front of the the existing array of auth types.
Find the highest auth type (according to the authOrder) that exists in availableCreds within the supplied session config. Then place the credentials associated with that auth type into the top-level of the session config. Finally, remove credentials for all other auth types from the top-level of session config.
Modified. Authentication properties are added to and removed from this session configuration, which can already have properties in this object when passed to this function.
Remove all credential properties from the supplied session except for the creds related to the session type specified within the sessCfg argument.
Modified. Authentication credentials are removed from this session configuration.
Remove any request-for-token from the session config.
Modified. The session config from which we remove a request-for-token.
Generated using TypeDoc
The purpose of this class is to detect an authentication order property supplied by a user in a profile, command line, or environment variable. That authOrder is then used to place the correct set of credentials into a session for authentication.
To accomplish this behavior, we call AuthOrder.addCredsToSession early in the processing of a command (when both a session configuration and command arguments are available). For example in: ConnectionPropsForSessCfg.addPropsOrPrompt or ProfileInfo.createSession
Before we use the session, we call AuthOrder.putTopAuthInSession. For example in: AbstractRestClient.constructor AbstractRestClient.request AuthOrder.putTopAuthInSession ensures that the session only contains the credentials for the desired type of authentication.