Skip to content

Cognito Service

AWS Cognito provides the authentication and authorization infrastructure for the Arda Platform. One Cognito instance is deployed per Partition (Environment).

ComponentDescription
User PoolUser directory with custom attributes (tenant, role)
Resource ServerDeclares custom OAuth2 scopes
M2M Client ApplicationMachine-to-machine authentication using client_credentials flow
Web Client ApplicationUser-facing authentication using authorization_code (OIDC) flow
Post-Signup Lambda TriggerAuto-confirms new users
Password Reset Lambda TriggerSends password recovery emails
User Pool DomainHosts the Cognito-managed UI and OAuth2 endpoints

Scopes are declared on the Resource Server and are hierarchically inclusive (each scope implicitly includes access to all less-privileged scopes):

ScopeAccess Level
publicPublicly accessible resources; no authentication required
liteFreemium or limited subscription resources
subscriptionFull commercial subscription resources
ardaArda-internal resources only
systemInternal system processes only
AttributeDescription
custom:tenantTenant ID associated with the user: <tenant-name>::<tenant-uuid>
custom:roleUser’s role: one of public, lite, subscriber, admin, system

Custom attributes are strings only (max 2048 chars). JSON objects, arrays, and nested structures are not supported.

ClientFlowUse Case
M2M Clientclient_credentialsBackend-to-backend API authentication
Web Clientauthorization_code (OIDC)User-facing web application login

All exports use the prefix <infrastructure>-<partition> (e.g., alpha002-dev):

Export Name SuffixDescriptionExample
-API-UserPoolIdCognito User Pool IDalpha002-dev-API-UserPoolId
-API-UserPoolDomainCognito-hosted UI domainalpha002-dev-API-UserPoolDomain
-API-WebClientIdWeb Client App Client IDalpha002-dev-API-WebClientId
-API-WebSecretNameSecrets Manager name for Web Client secretalpha002-dev-API-WebSecretName
-API-M2MClientIdM2M Client App Client IDalpha002-dev-API-M2MClientId
-API-M2MSecretNameSecrets Manager name for M2M Client secretalpha002-dev-API-M2MSecretName
-ResourceServerIdResource Server IDalpha002-dev-ResourceServerId
Secret NameDescription
<infrastructure>-<partition>-API-WebSecretNameWeb Client secret
<infrastructure>-<partition>-API-M2MSecretNameM2M Client secret

To import Cognito outputs in another CDK stack:

// Via CDK
const userPoolId = cdk.Fn.importValue('alpha002-dev-API-UserPoolId');
// Via PartitionAuthn static method
const exports = PartitionAuthn.importValues(partitionLocator);
  • Integration with external OIDC providers (Google, LinkedIn)
  • Per-tenant role definitions for finer-grained RBAC
  • Multi-tenant user associations (one user, multiple tenants)
  • Facility-level scoping within tenants