output "client_id" { description = "The exchange client's ID. A public identifier." value = oci_identity_domains_app.exchange.name } output "client_secret" { description = "Store this in the repository as OCI_EXCHANGE_CLIENT_SECRET. It cannot call Oracle Cloud APIs; it only lets GitHub tokens be exchanged." value = oci_identity_domains_app.exchange.client_secret sensitive = true } output "workflow_settings" { description = "What the quick start's workflow needs, besides the secret: the client ID, the domain URL it posts to (/oauth2/v1/token), and the tenancy and region for its session configuration. All identifiers." value = { client_id = oci_identity_domains_app.exchange.name domain_url = local.domain_url tenancy = var.tenancy_ocid region = var.region audience = local.audience } } output "service_user_ocid" { description = "The service user the workflow acts as. Its name appears in the audit log as the principal." value = oci_identity_domains_user.deploy.ocid } output "verify" { description = "How to prove only the named subjects can sign in, and that it is recorded." value = <<-EOT Print the subject a real token carries, in a workflow step with id-token: write: curl -sS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=${local.audience}" | jq -r .value | python3 -c 'import base64,json,sys; p=sys.stdin.read().split(".")[1]; print(json.loads(base64.urlsafe_b64decode(p + "=" * (-len(p) % 4)))["sub"])' It must equal one of allowed_subjects, character for character. Exchange it as the quick start's workflow does, with client ${oci_identity_domains_app.exchange.name} at ${local.domain_url}/oauth2/v1/token, then: oci --auth security_token iam compartment get --compartment-id ${var.compartment_ocid} From an allowed branch or environment the exchange returns a token. From any other, it is refused. Audit, in compartment ${var.compartment_ocid}: search for data.identity.principalName = '${oci_identity_domains_user.deploy.user_name}'. Each call the workflow made is there, for 365 days. ${local.oke ? "In a pod running as ${var.oke_namespace}/${var.oke_service_account} on the cluster, a call the grants allow succeeds with oci --auth oke_workload_identity; the same call from a pod with any other service account is refused." : "Set oke_cluster_ocid to let one OKE service account act here too."} EOT }