# Microsoft Entra ID temporary access

Create a temporary cloud-managed user with membership in selected groups. The
existing [customer provisioner](/docs/guides/provisioner) calls Microsoft Graph
from your network, in either push or pull mode. Keep the same single connection
token and manage target settings and member/service-token grants in Seekrit.

## Connect Entra ID

Select **Microsoft Entra ID** when adding a target. Choose your provisioner and
enter the tenant UUID, a verified cloud-managed domain (for example,
`example.onmicrosoft.com`), and the object IDs of the groups to grant.
Federated domains and existing-user password resets are not supported.

Supply JSON with `clientId` and `clientSecret` for a management application in
that tenant. It needs admin-consented Microsoft Graph application permissions
`User.ReadWrite.All`, `GroupMember.ReadWrite.All`, and
`User.EnableDisableAccount.All` (with user-read access). Directory roles may also
be required by the tenant for sensitive user operations. Prefer ordinary security
groups; role-assignable groups require additional directory-role permissions.
The browser encrypts the management credential and settings to your provisioner.
The public Microsoft cloud endpoints are used.

## Lease lifecycle

The provisioner creates a unique disabled user, assigns every configured group,
then enables it and encrypts its username and generated password to the requester.
A failed group grant never enables the user. The new user also receives whatever
baseline access your tenant assigns to all users; group membership does not
remove those tenant defaults or bypass Conditional Access/MFA requirements.

At revoke or expiry, the provisioner checks the exact principal name and ownership
markers, disables the account, and deletes it by object ID. Entra users have no
native per-user TTL: timely expiry depends on the provisioner remaining connected
and Seekrit delivering cleanup jobs. Already-issued application tokens or sessions
may remain valid according to their own lifetime. Deletion uses Graph's normal
soft-delete behavior; restoring a user manually is outside the lease lifecycle.

## CLI and API

Register with `seekrit dynamic target add --name entra-ci --config target.json`,
piping the management credential JSON on stdin:

```json
{
  "provider": "entra",
  "executor": "remote",
  "provisionerId": "prv_REPLACE_WITH_REGISTERED_ID",
  "settings": {
    "tenantId": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
    "domain": "example.onmicrosoft.com",
    "groups": ["bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb"]
  },
  "maxTtlSeconds": 3600
}
```

Request with `seekrit dynamic lease <target-id> --ttl 1h`. Existing lease API routes
accept `provider: "entra"`. Authorized members and service tokens sign with their
existing keys; no additional provisioner configuration is required.

See Microsoft's [create-user](https://learn.microsoft.com/en-us/graph/api/user-post-users?view=graph-rest-1.0),
[group-membership](https://learn.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0),
and [delete-user](https://learn.microsoft.com/en-us/graph/api/user-delete?view=graph-rest-1.0) references.
