Authorization provider used to to authorize operations using Oracle Cloud Infrastructure Identity and Access Management (IAM).

The driver uses this class internally for authorization with the Cloud Service. Normally, you do not need to use this class. Instead, create NoSQLClient instance by specifying iam property in AuthConfig as part of auth, as described in IAMConfig.

You may use this class as an alternative to specifying iam, as this may allow additional operations, e.g. retrieving resource principal claim information. Use this class as a value for provider property when creating NoSQLClient instance. This is shown in the example.

See

Example

Using IAMAuthorizationProvider when creating NoSQLClient instance.

const client = new NoSQLClient({
region: Region.US_PHOENIX_1,
compartment: "ocid1.compartment.oc1.............................",
auth: {
provider: new IAMAuthorizationProvider({
configFile: "~/myapp/.oci/config",
profileName: "Jane"
})
}
});

Hierarchy

  • IAMAuthorizationProvider

Implements

Constructors

Methods

  • Gets the region as determined by the provider. It may be provided in Config as region when creating NoSQLClient instance to connect to this region.

    The meaning of the returned region is determined by the authentication method used by this provider:

    • When using instance principal (see useInstancePrincipal) or OKE workload identity (see useOKEWorkloadIdentity), this method will return the region of the running OCI instance obtained via instance metadata service.
    • When using resource principal (see useResourcePrincipal), this method will return the region in which the OCI function is deployed.
    • When using OCI configuration file (see configFile and profileName), this method will return the region as specified in OCI configuration file, if available.
    • Otherwise, this method will return undefined.

    Returns

    Promise of Region. If the region cannot be determined, the promise resolves with undefined.

    Returns Promise<undefined | Region>

  • If using Resource Principal, gets the claims information in the resource principal session token (RPST) such as the resource tenant and compartment OCIDs.

    Async

    Returns

    If using Resource Principal, promise of ResourcePrincipalClaims containing RPST claim information, otherwise promise of undefined.

    Returns Promise<undefined | ResourcePrincipalClaims>

  • Overload

    A convenience method to create new instance of IAMAuthorizationProvider for session token-based authentication using default OCI configuration file and specified or default profile name.

    Other applicable properties are initialized to their defaults as described in IAMConfig.

    Returns

    New instance of IAMAuthorizationProvider using session token-based authentication

    See

    Parameters

    • Optional profileName: string

      Optional profile name in the default OCI configuration file. Defaults to value "DEFAULT"

    Returns IAMAuthorizationProvider

  • Overload

    A convenience method to create new instance of IAMAuthorizationProvider for session token-based authentication using specified OCI configuration file and profile name.

    Other applicable properties are initialized to their defaults as described in IAMConfig.

    Returns

    New instance of IAMAuthorizationProvider using session token-based authentication

    See

    Parameters

    • configFile: string

      OCI configuration file path. See configFile

    • Optional profileName: string

      Optional profile name in the default OCI configuration file. Defaults to value "DEFAULT"

    Returns IAMAuthorizationProvider

Generated using TypeDoc